fix(slash-commands): trim args before toLowerCase in /fast and /browser#3313
Open
oldschoola wants to merge 1 commit into
Open
fix(slash-commands): trim args before toLowerCase in /fast and /browser#3313oldschoola wants to merge 1 commit into
oldschoola wants to merge 1 commit into
Conversation
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.
roboomp
reviewed
Jun 23, 2026
roboomp
left a comment
Collaborator
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 headlessdidn't match"headless".All other handlers in the same file already use the
.trim().toLowerCase()pattern. This aligns the three outliers.Changes
/fasthandler (builtin-registry.ts:387): added.trim()before.toLowerCase()/browserhandler (builtin-registry.ts:779): same fix/browserhandleTui (builtin-registry.ts:806): same fixTests
bun checkpassesslash-command-format.test.tsandavailable-commands.test.tspass