Skip to content

fix(slash-commands): trim args before toLowerCase in /fast and /browser#3313

Open
oldschoola wants to merge 1 commit into
can1357:mainfrom
oldschoola:fix/slash-command-trim-args
Open

fix(slash-commands): trim args before toLowerCase in /fast and /browser#3313
oldschoola wants to merge 1 commit into
can1357:mainfrom
oldschoola:fix/slash-command-trim-args

Conversation

@oldschoola

Copy link
Copy Markdown
Contributor

Problem

Three slash command handlers used command.args.toLowerCase() without a preceding .trim(), so trailing whitespace caused silent failures: /fast on (with trailing space) didn't match "on", and /browser headless didn't match "headless".

All other handlers in the same file already use the .trim().toLowerCase() pattern. This aligns the three outliers.

Changes

  • /fast handler (builtin-registry.ts:387): added .trim() before .toLowerCase()
  • /browser handler (builtin-registry.ts:779): same fix
  • /browser handleTui (builtin-registry.ts:806): same fix

Tests

  • bun check passes
  • slash-command-format.test.ts and available-commands.test.ts pass

Three slash command handlers used command.args.toLowerCase()
without a preceding .trim(), so trailing whitespace caused
silent failures: '/fast on ' (with trailing space) didn't
match 'on', and '/browser headless ' didn't match 'headless'.

All other handlers in the same file already use the
.trim().toLowerCase() pattern. This aligns the three
outliers.
@github-actions github-actions Bot added the vouched Passed the vouch gate label Jun 23, 2026
@roboomp roboomp added cli CLI commands and arguments fix review:p0 triaged labels Jun 23, 2026

@roboomp roboomp left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P0 — lgtm. Three-line correctness fix: adds the missing .trim() before .toLowerCase() in the three handlers (/fast handle at builtin-registry.ts:387, /browser handle at :779, /browser handleTui at :806) that were the only outliers — the surrounding handlers (:217, :410, :926, :1049, :1519) already used .trim().toLowerCase(). Changelog entry is correctly placed under packages/coding-agent/CHANGELOG.md ## [Unreleased]### Fixed. No new test, but the change is mechanical pattern alignment and per AGENTS.md testing guidance a regression test here would mostly defend String.prototype.trim. Thanks @oldschoola.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI commands and arguments fix review:p0 triaged vouched Passed the vouch gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants