Repository navigation
Pass wrapped OpenCode run prompts as positional messages - #25001
Conversation
Reuse captured composer readiness on local and paired execution hosts and revoke launching-shell paste anchors. Co-authored-by: Brennan Benson <79079362+brennanb2025@users.noreply.github.com>
Co-authored-by: Adnan Khan <adnank11427@gmail.com>
Reuse captured composer readiness on local and paired execution hosts and revoke launching-shell paste anchors. Co-authored-by: Brennan Benson <79079362+brennanb2025@users.noreply.github.com>
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
The commits since the prior pullfrog review (b78c1aa) extract the OpenCode plugin-config writer into its own module and re-apply the four OpenCode layers on current main; the run core is byte-identical to the prior review.
- Extracted
writeOpenCodePluginConfigintosrc/main/opencode/opencode-plugin-config-writer.ts—writePluginIntoOverlay/writePluginToConfigDirnow delegate to a pure function that owns themkdir/source/tui-only/atomic-write sequence, selectingisOverlay…/isInstalled…and the matching atomic writer from theownershipargument. Verified against the removed inline bodies: theinstallsTuiPluginguard andtuiOnlyDirectoryearly return are preserved exactly, so this is behavior-preserving.hook-service.tsis the only importer. - Re-applied the caps/intent/overlay/run layers on current
main(a77cea7f81,b43c77d7f5,f45ae0bf1d,7a24ede575) with the rest of the 216-file diff being mergedmain(#25059,#25107,#24644, and others), not authored here. - Ran the three hook-service suites — 41 passed — and
pnpm tc:node(clean) at7a24ede575.
The sole prior inline thread (env-wrapper options) is resolved. Prior body-only nits (runIndex unused; the "Mirrors" comment) are unchanged and not re-raised.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
The commits since the prior pullfrog review (7a24ede) advance the layered base branch and re-apply the run layer on top; this PR's net diff (d12f6b5..9a90462) is byte-identical to the version approved at 7a24ede.
- Rebased the run layer onto the advanced base —
9a90462re-appliesflag-prompt-startup.ts,opencode-startup-prompt.ts,tui-agent-startup.ts, and the prompt test ontonwparker/OpenCode-Overlay-Cleanup-Guard(d12f6b5), which now carries the sibling intent/overlay layers.git diff 7a24ede 9a90462shows no change to any of these four files, so the approved positional-run behavior is unchanged. - Folded the location-hydration wait into the shared prompt plugin — the only content differing between
7a24edeand9a90462issrc/main/opencode/opencode-startup-prompt-source.ts(+ its test):submitStartupPromptnow gates claiming and dispatch onctx.data.location.sync(ctx.location)resolving, and fails closed whensyncis missing or rejects. That file lives on the base branch (85efe85/d12f6b5), so it is not part of this PR's diff; I reviewed it as the delta since the last run and found no correctness issue. - Retired prior feedback — the sole open pullfrog thread (
envoptions inopencode-headless-command.ts) is resolved; the two prior body-only nits remain unaddressed and are not re-raised.
The env-option handling and wrapper detection in src/shared/opencode-headless-command.ts are not in the current PR diff (already on the base branch); grep confirmed the shell-aware signatures match this PR's call sites.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
The two commits since the prior pullfrog review (9a90462) bind OpenCode startup-prompt hydration to the current home location. This PR's own run-positional diff is unchanged.
- Bound hydration to the current location — the injected plugin replaces the one-shot
locationReadyflag with a[directory, workspaceID]key; it syncs the location it is about to read, ignores stale completions, re-syncs when the home location changes, and fails closed whensyncis missing or rejects. - Re-checked the location around delivery — a granted claim is refused, and the prompt is not inserted, when the location key changed while the claim was in flight.
- Added transition controls — four tests cover a startup-directory change mid-hydration, an unset location, a workspace change under the same directory, and a granted claim after the composer moves; each asserts exact
synccall counts and that no claim or insert happens for a stale location. - This PR's authored diff is unchanged —
git diff 9a90462 HEADoversrc/shared/{flag-prompt-startup,opencode-startup-prompt,tui-agent-startup}.tsandopencode-startup-prompt.test.tsis empty, and the delta filesrc/main/opencode/opencode-startup-prompt-source.tsis byte-identical to the advanced base branch (git diff 0dd7371 HEAD -- <file>is empty), so it is not authored by this PR.
I reran src/main/opencode/opencode-startup-prompt-source.test.ts — 54 passed.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
Preserve OpenCode launch ownership and location-bound startup claims while inheriting current terminal observations and installer corrections.
Preserve OpenCode launch ownership and location-bound startup claims while inheriting current terminal observations and installer corrections.
Preserve OpenCode launch ownership and location-bound startup claims while inheriting current terminal observations and installer corrections.
Preserve OpenCode launch ownership and location-bound startup claims while inheriting current terminal observations and installer corrections.
|
Fresh and nested startup now pass with genuine installed OpenCode 2.0.16 on exact combined commit Each launch submitted exactly one Unicode user prompt, received one granted and transmitted startup claim, used the unchanged configured model A and completed in SQLite and the authoritative status store. The nested launch followed positive closure of the fresh app/TUIs/service and used the same healthy private profile. Its real TUI and service selected one combined overlay, retained the original user-plugin source pointer and left all seven inherited overlay members byte-for-byte unchanged. Root and an independent reviewer inspected the raw provider, PTY, claim, process-environment and copied SQLite evidence, plus these hidden-renderer images. All 319 recorded test process incarnations exited and four private ports closed; a reused unrelated PID was untouched. These are macOS tests with a controlled loopback provider. The newer-main source composition and its CI remain separately qualified; no paid-provider, Windows, SSH or IME result is claimed. Earlier failed attempts remain preserved. |
Preserve current overlay cleanup and restore the qualified run prompt contract.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 🧰 Additional context used📚 Code guidelines (1)No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (4)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughFlag-prompt startup planning now uses a shared plan builder. For OpenCode run commands, it places the quoted prompt after an existing message separator or adds Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to OpenCode run commands now receive the task as a positional message, and other agents keep Architecture SummaryArchitecture risk: 🟡 Medium · up to The change affects 1 system. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
Reliability and maintainability
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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. Comment |



ELI5
Wrapped
opencode runcommands received a TUI-only--promptflag and could exit before sending the task. They now keep their run options and receive the task as a positional message.What Changed
Use the existing command parser to recognize supported environment prefixes, PowerShell call syntax, and an existing
--separator. Reuse shell quoting and the existing startup environment when building the launch command.Why
OpenCode's
runcommand accepts a positional message. Handling this in the launch builder preserves the user's command and literal task text without requiring a separate prompt submission.Linked Issue
Focused follow-up for #17551; credit @coelho-doti (#13065).
Visual Proof
N/A — command argument handling adds no rendered controls. Recorded actual before/after evidence remains pinned to its tested source.
Testing
The current source passes 248 tests across 17 files, all three desktop typechecks, lint and format for all four changed files, and changed code-quality checks. The tests also cover startup intent and configuration cleanup together. Public CI will cover the published merge.
Review
The normal merge preserves current main's configuration cleanup and all previous PR history. Only four launch files differ from main. Earlier app builds and actual OpenCode runs remain evidence for their recorded commits.
Agent skill upstream boundary
Notes
Shell argument tests cover POSIX, PowerShell, and CMD. Actual CLI turns used controlled model responses on macOS. Windows, SSH, and paid-model entitlement are not established by those runs.
Checklist