GeezerVison is showing github.com — fix(cli): submit arguments after separator once by rekram1-node · Pull Request #60547 · anomalyco/opencode
Conversation
rekram1-node
commented
Oct 30, 2026
•
edited by opencodejr
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Problem
opencode run appended arguments after -- twice. The parser already includes them in the message, but the handler appended the raw argv suffix again.
Change
Use the parsed message without appending argv again.
opencode run before -- after
-prompt: before after after
+prompt: before after
Two in-process regressions use the registered command parser and real handler for run -- marker and run prefix -- one two. They stub only server resolution and the runner, with argv and spies restored after each test. No HTTP server, subprocess or model call is needed.
Out of scope
No changes to prompt quoting, stdin merging, the interactive interface or server admission.
Verification
- Both regressions fail against the original handler and pass with the fix.
- CLI input, noninteractive, mini and server-connection tests: 31 pass.
- New input tests randomized and repeated ten times: 20 pass.
bun run check: passes, with existing lint warnings.
Visual
<svg xmlns="http://www.w3.org/2000/svg" width="240" height="72" viewBox="0 0 240 72">
<g fill="none" stroke="currentColor" opacity=".7">
<rect x="8" y="20" width="82" height="32" rx="6"/>
<path d="M98 36h36m-6-6 6 6-6 6"/>
<rect x="144" y="20" width="88" height="32" rx="6"/>
</g>
<g fill="currentColor" font-family="monospace" font-size="12" text-anchor="middle">
<text x="49" y="40">-- prompt</text>
<text x="188" y="40">once</text>
</g>
<circle cx="114" cy="36" r="3" fill="currentColor">
<animate attributeName="opacity" values=".2;1;.2" dur="2s" repeatCount="indefinite"/>
</circle>
</svg>
Added by the opencode bot (AI-generated).
Fixes #57678
Related: #56120
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fix is sound. Removing the second process.argv append is right, because the parser already puts arguments after -- into input.message.
I checked it against a real opencode serve with a mock provider. On the base, run -- DUPREPRO sent DUPREPRO DUPREPRO and run a -- b c sent a b c b c. With this PR they send DUPREPRO and a b c. The new tests fail on the base and pass here.
Public API is unchanged: run keeps the same flags and arguments, and only the duplicated text goes away.
The only point is the test file (inline): it's a lot of scaffolding for a one-line fix and can be dropped.
Fixes #57678
Related: #56120
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
@@ -0,0 +1,69 @@ |
|
|
import { expect, test } from "bun:test"
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a one-line fix, and this 69-line subprocess test fakes six server endpoints (info, location, session, an SSE stream, and a prompt that answers 500 on purpose) just to read the request body. It's tightly bound to the current client/server sequence of calls, so it will break whenever that changes. I'd drop it to keep the change minimal.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replaced the subprocess and fake HTTP/SSE server with a 36-line in-process test using the registered command parser and real handler. It covers run -- marker and mixed-prefix arguments; both fail against the original append and pass with the fix. No runtime code changed in this follow-up.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My earlier point about the test is addressed. It now runs inside the test process and checks the message passed to the runner, with no fake HTTP server or subprocess. The handler fix is unchanged from what I checked end to end before. The new test passes here and fails on the base. Public API is unchanged. Nothing new to raise.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Closing, this was fixed by #61721.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
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.
|