Skip to content

fix(cli): stop quoting plain run prompt arguments - #1561

Merged
anandgupta42 merged 1 commit into
mainfrom
fix/run-message-quoting
Oct 19, 2026
Merged

anandgupta42 merged 1 commit into
mainfrom
fix/run-message-quoting

Conversation

@anandgupta42

@anandgupta42 anandgupta42 commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

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 --command quoting 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 d6a3279. 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.
  • --command behavior is unchanged: arguments containing spaces are still quoted and embedded quotes escaped exactly as before.
  • Adds joinRunMessage as an exported helper and a new test suite covering plain prompts, --command quoting, and correction classification.

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

View guided diff Turn on auto-fix

@cursor

cursor Bot commented Oct 19, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: f8661666-f3d9-4cb8-b88b-be0f24764927)

@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 7 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 93177976-2042-485b-81fe-7f03437fbb13
📥 Commits

Reviewing files that changed from the base of the PR and between 3d5a704 and d6a3279.

📒 Files selected for processing: 2
  • packages/opencode/src/cli/cmd/run.ts
  • packages/opencode/test/cli/cmd/run-message.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-19T03:47:39.681596Z d6a3279 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown

👋 This PR was automatically closed by our quality checks.

Common reasons:

  • New GitHub account with limited contribution history
  • PR description doesn't meet our guidelines
  • Contribution appears to be AI-generated without meaningful review

If you believe this was a mistake, please open an issue explaining your intended contribution and a maintainer will help you.

@github-actions

Copy link
Copy Markdown

👋 This PR was automatically closed by our quality checks.

Common reasons:

  • New GitHub account with limited contribution history
  • PR description doesn't meet our guidelines
  • Contribution appears to be AI-generated without meaningful review

If you believe this was a mistake, please open an issue explaining your intended contribution and a maintainer will help you.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No issues found across 2 files

View guided diff | Turn on auto-fix | Re-trigger cubic

Plain `run` prompts are joined with spaces instead of having each
space-containing argument wrapped in quotes, which reached the model and
hid corrections from learn capture. `--command` keeps its quoting for
`$1`/`$2` expansion.

Closes #1560

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@anandgupta42
anandgupta42 force-pushed the fix/run-message-quoting branch from 14b3002 to d6a3279 Compare October 19, 2026 03:46
@cursor

cursor Bot commented Oct 19, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: d8fb4709-8e1e-4a15-9e86-0af0b789e848)

@kilo-code-bot

kilo-code-bot Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (2 files)
  • packages/opencode/src/cli/cmd/run.ts
  • packages/opencode/test/cli/cmd/run-message.test.ts

Reviewed by gemini-4-argon · Input: 85.2K · Output: 1.2K · Cached: 272.4K

Review guidance: REVIEW.md from base branch main (truncated)

@anandgupta42
anandgupta42 merged commit 350938c into main Oct 19, 2026
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

run wraps space-containing prompt arguments in literal quotes

1 participant