Repository navigation
docs(tui-agent-config): correct the OpenCode readiness-budget rationale - #22593
Conversation
The comment merged with #22546 claimed ConPTY never forwards DECSET 2004 and that the signal therefore cannot fire on Windows. Verification on two real Windows hosts refuted that: the sequence arrives in order on both ConPTY backends, and the readiness signal fired in every run. The budget was the actual problem — opencode does not enable bracketed paste until ~4.8s and its composer is not ready until ~10s, so the 8s default expired first and the draft was pasted blind. Same fix, accurate reason. Note the claim that seeded this: terminal-agent-paste-bracketing.ts says 2004 "can be lost by remote replay or ConPTY", which is careful and not contradicted here; the absolutism was mine.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe opencode configuration comment now states that the cursor-gated paste signal fired in measured Windows runs, but the 8-second readiness budget expired before the composer was ready. The configured timeout remains 20 seconds. Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to This updates the explanation for the existing OpenCode timeout without changing startup behavior; no merge-blocking risk is identified. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 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 |
There was a problem hiding this comment.
ℹ️ No critical issues — the rationale fix is accurate and well-scoped. One informational note below about the same overclaim that still lives in two untouched comments.
Reviewed changes
- OpenCode readiness rationale corrected: replaces the claim that ConPTY never forwards DECSET 2004 (so the readiness signal can't fire on Windows and the budget is just a blind-paste settle delay) with the measured reason — bracketed paste at ~4.8s and composer ready at ~10s means the 8s default expired first and the draft pasted blind, while the signal itself fired each run (#22479).
The new rationale cross-checks cleanly: src/shared/tui-agent-config.ts is comment-only, the constant stays 20_000, local-pty-utils.ts:174-175 does pin useConptyDll: true, and terminal-agent-paste-bracketing.ts:8 carries only the hedged "can be lost by remote replay or ConPTY" claim that the PR correctly leaves alone. The scoping to "those runs" is appropriately not-universal.
ℹ️ The same absolute overclaim survives in two other comments
The PR's own measurement (ConPTY dll backend forwards ?2004h in order, and the signal fired every run) directly contradicts two other comments that assert the opposite as universal fact. This is pre-existing text the PR does not touch, so it does not block; flagging it because the PR's whole point is to stop asserting more than the evidence supports.
Technical details
# Stale "ConPTY never forwards DECSET 2004" absolutes
## Affected sites
- `src/renderer/src/lib/agent-paste-draft.ts:128-130` — "On Windows this is the ONLY path: ConPTY does not forward DECSET 2004, so no 2004-anchored ready signal can ever fire." Contradicted by the PR's measurement on the dll backend.
- `src/renderer/src/lib/agent-paste-draft-readiness-budget.test.ts:99` — "Regression (#22479): ConPTY never forwards DECSET 2004, so on Windows this is the only path opencode can take."
- `src/renderer/src/components/terminal-pane/terminal-agent-paste-bracketing.test.ts:163` — same wording; the PR body already acknowledges this test name.
## Required outcome
- None blocking. If the author wants the correction to be complete, reword these to the hedged form used at `terminal-agent-paste-bracketing.ts:8` ("can be lost by remote replay or ConPTY") rather than asserting the signal can never fire on Windows.
## Open questions for the human
- Whether these are tracked separately, or intentionally left as historical descriptions of the #22479 regression scenario.DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
…le (stablyai#22593) The comment merged with stablyai#22546 claimed ConPTY never forwards DECSET 2004 and that the signal therefore cannot fire on Windows. Verification on two real Windows hosts refuted that: the sequence arrives in order on both ConPTY backends, and the readiness signal fired in every run. The budget was the actual problem — opencode does not enable bracketed paste until ~4.8s and its composer is not ready until ~10s, so the 8s default expired first and the draft was pasted blind. Same fix, accurate reason. Note the claim that seeded this: terminal-agent-paste-bracketing.ts says 2004 "can be lost by remote replay or ConPTY", which is careful and not contradicted here; the absolutism was mine. (cherry picked from commit 795b64b)

ELI5
A comment I merged yesterday explains why OpenCode gets a longer startup wait on Windows. The explanation was wrong. The fix it justifies is still correct — this just replaces the reason with the one I actually measured.
What Changed
Comment only. One
Why:block insrc/shared/tui-agent-config.ts.Before (merged with #22546):
After:
Why
I verified #22546's premise on two real Windows hosts (build 10.0.26200) after merging it, through the repo's own
node-ptywithuseConptyDll: true— the backendlocal-pty-utils.ts:174-175pins for Orca's terminals:And from a real OpenCode 1.18.16 TUI:
?2004harrives in order and the readiness signal fires. Three runs: ready at 10086 / 9783 / 9989 ms — every one past the 8s default, none near 20s. So the 20s budget is right and has ~2x headroom; the stated cause was not.Where the wrong claim came from, since it's worth not repeating:
terminal-agent-paste-bracketing.ts:8says 2004 "can be lost by remote replay or ConPTY" — careful, hedged, and not contradicted by this measurement. A test name in the same area reads "ConPTY never forwarded DECSET 2004". I turned the hedged claim plus the test name into an absolute one and built an explanation on it. This PR does not touch either of those; it only stops the OpenCode entry from asserting something stronger than the evidence supports.I am also deliberately not asserting the converse. These runs show ConPTY forwarding 2004 on this Windows build and backend. That does not prove it never drops it, so the comment now says what was observed rather than what is universally true.
Linked Issue
Refs #22479 — follow-up to #22546, no behaviour change.
Visual Proof
N/A— comment-only; no code path, no UI.Testing
pnpm test src/shared/tui-agent-config.test.ts src/main/runtime/orca-runtime.test.ts→ 2 files, 1304 passed.pnpm tcclean.pnpm run check:code-quality:changed→ 0 findings.No behavioural change, so nothing new to pin; the 20s budget stays covered by the runtime test added in #22546 (
gives OpenCode the 20s main-runtime startup readiness budget).AI Disclosure
Review
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
20_000.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm testpass locally