GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||
GeezerVison is showing github.com — fix(cli): preserve literal prompt arguments by HootRock · Pull Request #56206 · anomalyco/opencode Conversation
|
|
The following comment was made by an LLM, it may be inaccurate: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The fix works. I ran the reproduction from #56120 from source on the base and on this branch (local mock provider, opencode serve plus --server). On the base, opencode run 'Reply with: one two' stored the prompt with literal quotes added. With this change it is stored exactly as given, the same as the separate-arguments and stdin forms. The CLI type check passes. formatMessage is only called from run(), and the V1 command path goes through the same function, so nothing else depended on the old quoting.
Public API: unchanged. The prompt text sent by opencode run simply no longer gets extra quotes.
The one-line fix doesn't need the new 105-line subprocess test, so packages/cli/test/run/input.test.ts can be dropped to keep the change minimal (see the inline comment).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| stdin: 'a "quoted" line\n', | ||
| expected: 'compare first file second file\na "quoted" line\n', | ||
| }, | ||
| ])("run preserves prompt text from $name", async ({ args, stdin, expected }) => { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This test is large and brittle for a one-line fix. It hand-mocks about eight server endpoints and their event shapes (/api/info, /api/location, /api/session, /api/event, prompt, permission/form, wait, message) just to check how argv is joined, so any protocol change will break it for reasons unrelated to this behaviour. It also starts two full CLI processes (about 1.3s of CPU each), and the CLI unit-test guidance in .opencode/skills/unit-tests asks to test parsing in-process and keep spawned processes to a minimum. I'd drop this file so the change stays a one-liner.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Removed the subprocess fixture in 7460c22. The aggregate diff is now the one-line prompt join; the local base/head reproduction and regression evidence are retained outside the PR. The existing mini tests pass 12/12, and CLI typecheck plus scoped lint/format pass. These tests cover stdin merging but do not replace the removed exact-argv cases. The PR description now distinguishes this fresh validation from the earlier full-package run.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I checked 7460c22: the test file is removed and the change is now just the one-line join in packages/cli/src/run/run.ts. That's the same change I verified with the #56120 reproduction, so I have no further concerns about it.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
fix(cli): run adds literal quotes to spaced prompt arguments
There was an error while loading. Please reload this page.