Skip to content

Submit initial OpenCode 2.0.12 prompts through the native startup plugin - #25428

Merged
nwparker merged 5 commits into
mainfrom
orca/opencode-v2-2012-startup-prompt
Oct 5, 2026
Merged

nwparker merged 5 commits into
mainfrom
orca/opencode-v2-2012-startup-prompt

Conversation

@nwparker

@nwparker nwparker commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​97 $\color{#cf222e}{\Huge{\mathbf{−}}}$​40 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​57
Prod 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​10 $\color{#cf222e}{\Huge{\mathbf{−}}}$​2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​8

ELI5

OpenCode 2.0.12 worktrees now send their initial prompt automatically instead of leaving it in the composer.

What Changed

Recognize the reported 2.0.12 release alongside 2.0.16 and send its initial prompt through Orca’s existing native startup plugin. After the current location loads, the plugin claims the prompt once and submits it through OpenCode’s composer. The hydration test waits for its asynchronous file read before checking that single claim.

Why

The reported release was outside this managed startup path. Reusing the existing claim avoids a second submission mechanism or an Enter that could submit twice. Only exact 2.0.12 and 2.0.16 use this path; prereleases and unreviewed versions keep the conservative fallback.

Linked Issue

Fixes #22829. Thanks to @puscasurazvan for the original report.

Visual Proof

BEFORE: the official OpenCode 2.0.12 binary leaves the prompt in its composer after 40 seconds.

OpenCode 2.0.12 prompt unsubmitted after 40 seconds

AFTER: the managed prompt starts and completes.

OpenCode 2.0.12 managed prompt working

OpenCode 2.0.12 managed prompt completed

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

The version-support change passed 101 focused tests, Node and CLI typechecks, changed-file quality checks, and the isolated Electron, relay and CLI build checks. The later asynchronous test correction passed 93 tests across three files and preserves the before-hydration and exactly-once assertions.

Both runtime comparisons used the official 2.0.12 binary on macOS. Before the fix, its plain --prompt command painted the complete prompt for 40.565 seconds without a provider request or session message. After the fix, public worktree create --agent opencode --prompt sent a Unicode prompt through one native claim and one primary request to a local test provider; canonical completion and a closed SQLite copy confirmed the exact prompt once and a completed session. Both private apps, child processes and endpoints were closed and verified.

The managed runtime used the reviewed build; this PR preserves its five changed files on named Main apart from the test wait. Previously captured 2.0.16 behavior is separate evidence. Windows, Linux and SSH were not tested at runtime for this change. Full PR checks remain a merge gate. The catalog test corrections merged in #25442 are included through the normal Main merge; their 12 tests also pass on current Main.

Review

The five files preserve the reviewed version-support change. Normal Main merges retain unrelated changes. No remote wire or agent status-store change.

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

OpenCode 1 behavior and SSH/WSL negotiation use their existing paths. Later OpenCode versions need their own contract review.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

Route the reported release through the existing native startup intent.
Retain conservative behavior for other unreviewed versions.
@nwparker
nwparker marked this pull request as ready for review October 5, 2026 08:30
@pullfrog

pullfrog Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Pullfrog  | View workflow run | via Pullfrog | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@coderabbitai

coderabbitai Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

🧰 Additional context used
📚 Code guidelines (1)
AGENTS.md — auto-discovered

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 57e7d976-7bdf-4aeb-a484-0729a18ea6cd
📥 Commits

Reviewing files that changed from the base of the PR and between 67fc708 and c64677b.

📒 Files selected for processing (5)
  • src/main/opencode/opencode-pty-launch.test.ts
  • src/main/opencode/opencode-startup-prompt-source.test.ts
  • src/main/opencode/opencode-startup-prompt-source.ts
  • src/shared/opencode-cli-version.test.ts
  • src/shared/opencode-cli-version.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.


📝 Walkthrough

Walkthrough

OpenCode 2.0.12 joins the supported native prompt versions alongside 2.0.16. Prompt capability detection and startup prompt generation now use the shared supported-version list. Tests cover version detection, startup prompt hydration and submission, and PTY launch behavior across supported and unverified versions.

Priority: ➖ Normal

Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to c6467

No actionable issue remains for the reviewed change. Complete the normal PR checks before merging.

Security Architecture Review

Security architecture risk: 🔵 Low · up to c6467

The change is restricted to one additional exact OpenCode release and preserves existing launch authorization and duplicate-prevention controls. No introduced security bypass was identified. Confidence is limited by incomplete validation of the release’s integration across eligible platforms.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The direct expansion is automatic delivery into newly eligible OpenCode 2.0.12 fresh local runs, not a new remotely reachable service or broader launch authority. Downstream task effects depend on the existing agent’s tools and permissions, which this evidence does not comprehensively characterize.

Trust Boundaries and Controls

  • observed — The hook server authenticates requests before reading their bodies. Claims additionally require a matching nonce and digest, current fresh-spawn ownership, and no prior user input. Owner admission checks PTY incarnation, provider presence, stop state, and launch identity; another request identity cannot replay an already granted operation.

Resilience and Maintainability Implications

  • observed — Transient claim failures retry with the same operation identity. User input, disposal, expiry, changed location or composer state, failed spawn commit, PTY exit, and server shutdown cancel or settle the operation. Revalidation after asynchronous work prevents a late grant from overriding those terminal states.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 5 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly states the main change: submitting initial OpenCode 2.0.12 prompts through the native startup plugin.
Description check ✅ Passed The description covers the required sections, links issue #22829, includes before-and-after visual proof, and explains the change, rationale, and testing. It also states that full PR checks remain a m…
Linked Issues check ✅ Passed Issue #22829 reports the failure with OpenCode 2.0.12. This PR adds exact 2.0.12 support to the native startup-prompt path. The capability tests verify that 2.0.12 uses prefill, and the startup-plug…
Out of Scope Changes check ✅ Passed All changes support issue #22829. The version capability, PTY launch, startup plugin, and test changes implement or verify initial-prompt submission for the reported OpenCode release. No unrelated cha…
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
  • Autopilot · 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.

@nwparker
nwparker merged commit 8b5de39 into main Oct 5, 2026
43 of 57 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: OpenCode 2 --prompt only fills the composer — worktree create --agent opencode/opencode2 never submits the initial prompt

1 participant