Repository navigation
Conversation
splitRawArgumentString treated every quote character as the start of a
quoted string, so an apostrophe in ordinary text ("fix the user's bug
--background") swallowed the rest of the line: the words merged into one
token and flags after it, such as --background or --model, became prompt
text. parseArgs split --key=value with split("=", 2), which drops
everything after a second "=" (openai#807).
- Quotes group words only when they open a token or follow "=", and only
when a matching closing quote exists; other quotes are literal.
- A backslash only escapes quotes, whitespace, and backslashes, so text
such as a regex (\d+) or a Windows path keeps its backslashes.
- --key=value splits at the first "=".
Fixes openai#807
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0d4845fe53
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const closing = text.indexOf(character, index + 1); | ||
| if (closing !== -1) { | ||
| current += text.slice(index + 1, closing); |
There was a problem hiding this comment.
Honor escapes while scanning quoted tokens
When one-string slash-command arguments contain an escaped delimiter inside a quoted group (for example, a prompt containing "hello \"world\" today"), indexOf treats the escaped quote as the closing delimiter and the sliced contents bypass the ESCAPABLE handling. splitRawArgumentString consequently corrupts and splits the quoted prompt or option value instead of preserving hello "world" today as one token; scan for an unescaped matching quote and process escapes within the quoted range.
Useful? React with 👍 / 👎.
Import upstream openai#816 and openai#817
Summary
Slash commands pass
$ARGUMENTSto the companion as one string, whichsplitRawArgumentStringsplits into tokens. It treated every'or"as the start of a quoted string, so an apostrophe in ordinary text swallowed the rest of the line:Separately,
parseArgssplit--key=valuewithsplit("=", 2), which drops everything after a second=(#807):--prompt-file=notes=v2.txtbecamenotes.Changes
=, as in--prompt-file="my notes.txt") and only when a matching closing quote exists. Other quotes, like apostrophes inside words, are literal.\d+) or a Windows path keeps its backslashes."") stays an empty argument; before, it was dropped.--key=valuesplits at the first=.Tests
New
tests/args.test.mjscovers apostrophes, quoted groups, empty quoted arguments,=values, backslashes, and whitespace. All five tests fail onmainand pass with this change.npm test(96 tests) andnpm run buildpass.Fixes #807
🤖 Generated with Claude Code