Skip to content

fix(chat): sanitize preset command values - #3196

Open
tracerat[bot] wants to merge 1 commit into
mainfrom
fix/safe-preset-command-values
Open

fix(chat): sanitize preset command values#3196
tracerat[bot] wants to merge 1 commit into
mainfrom
fix/safe-preset-command-values

Conversation

@tracerat

@tracerat tracerat Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Give preset command-menu items a stable, selector-safe value.
  • Normalize both preset titles and descriptions while keeping their displayed text unchanged.
  • Add a regression test covering selector metacharacters in both fields.

Verification

  • pnpm --dir frontend test agent-presets-builder
  • pnpm --dir frontend run typecheck
  • pnpm --dir frontend exec biome check src/lib/agent-presets.ts src/components/chat/chat-session-pane.tsx tests/agent-presets-builder.test.tsx

LOC

Category + -
Logic 19 1
Tests 22 0

Summary by cubic

Sanitize chat preset command values so they’re selector-safe while remaining searchable. Keeps visible preset names/descriptions unchanged and prevents command-menu selector errors.

  • Bug Fixes
    • Generate selector-safe, searchable values via buildAgentPresetCommandItemValue from preset titles/descriptions.
    • Add regression test covering quotes, brackets, and other selector metacharacters.

Written for commit fd8f360. Summary will update on new commits.

Review in cubic

@tracerat tracerat Bot added agents LLM agents bug Something isn't working fix Bug fix tests Changes to unit and integration tests ui Improvements or additions to UI/UX labels Aug 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents LLM agents bug Something isn't working fix Bug fix tests Changes to unit and integration tests ui Improvements or additions to UI/UX

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants