fix(cli): stop quoting plain run prompt arguments
Issue for this PR
Closes #1560
Type of change
- Bug fix
- New feature
- Refactor / code improvement
- Documentation
What does this PR do?
altimate-code run "Fix the failing test" sent the prompt to the model wrapped in literal quotes, because run quoted every argument containing a space. That quoting only matters for --command, whose template splits arguments on quotes. One side effect: learn capture missed corrections sent this way ("No, ..." does not read as a correction).
Was โ now: plain prompts are joined with single spaces and keep any quotes the user typed. --command is unchanged. The change is one helper, joinRunMessage, marked as an upstream fix.
How did you verify your code works?
- New unit tests on the real helper: plain prompts, several arguments, unchanged
--commandquoting and escaping, and a one-argument correction that the learn classifier now recognizes. The old quoted form is not recognized. - Run CLI suites: 467 pass. The 3 timing-sensitive time-budget tests that failed also fail at base on this machine.
- Typecheck clean. Local Codex review and independent review: no findings.
Cost side effects
None.
Screenshots / recordings
N/A (CLI text).
Checklist
- I have tested my changes locally
- I have not included unrelated changes in this PR
- I checked for cost side effects (model calls, queries or cloud resources that grow with user data) and described them, or wrote "none"
๐ค Generated with Claude Code
[!NOTE]
Low Risk
Narrow CLI message-formatting change with tests; --command quoting is unchanged.
Overview
Fixes how run builds the user message from CLI arguments so plain prompts are no longer wrapped in literal double quotes when an argument contains spaces.
The handler now uses exported helper joinRunMessage(args, command): non-command runs join arguments with single spaces and leave user-typed quotes unchanged; --command runs keep the previous behavior (quote space-containing args and escape embedded quotes) for $1/$2 parsing.
Adds run-message.test.ts covering plain prompts, command quoting parity, and that one-argument corrections like No, use to_utc. still match correctionReason for learn capture.
Reviewed by Cursor Bugbot for commit d6a3279724a2b6f21b8263332f65a09cb090e9c8. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by cubic
Fixes altimate-code run sending plain prompts wrapped in literal double quotes, which reached the model and broke learn capture so corrections like run --session <id> "No, use to_utc." were never recognized.
- Plain prompt arguments are now joined with single spaces, keeping quotes the user typed inside the text.
--commandbehavior is unchanged: arguments containing spaces are still quoted and embedded quotes escaped exactly as before.- Adds
joinRunMessageas an exported helper and a new test suite covering plain prompts,--commandquoting, and correction classification.