⛔ DO NOT MERGE — feat: wire OpenCode into spawn dialogs and empty-state UI (headless routing)#140
⛔ DO NOT MERGE — feat: wire OpenCode into spawn dialogs and empty-state UI (headless routing)#140khaliqgant wants to merge 8 commits into
Conversation
Bumps all @agent-relay/* packages to ^8.3.0 which ships Codex app-server adapter, headless agent runtime, and SpawnCliInput. Pear now tracks each agent's runtime (pty | headless) from the agent_spawned event and skips PTY snapshot/resize in attachTerminal for headless agents. The terminal pane shows a placeholder for headless agents instead of an xterm instance. Also improves the xterm.js config: lineHeight 1.2, letterSpacing 0.5, bar cursor, 10k scrollback, alt fast-scroll, macOptionIsMeta, and replaces instant display:none tab switching with a 150ms opacity fade. Deferred (noted for follow-up): - Structured output rendering for Claude (--output-format stream-json) - Structured output rendering for Codex (app-server events) - Native approval-prompt UI cards (vs y/n in terminal) - Bundled monospace font (Geist Mono / Berkeley Mono) https://claude.ai/code/session_01KXU1uAUwx3L82TMLnAmU4z
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Your free trial PR review limit of 300 PRs has been reached. Please upgrade your plan to continue using CodeAnt AI. |
|
Warning Review limit reached
More reviews will be available in 2 minutes and 13 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (10)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
|
ℹ️ pr-reviewer: review only — no file changes were applied to the PR (nothing to commit after review). The notes below are advisory and were not pushed. Reviewed PR #140 against No code changes were needed. The Validation run:
Notes:
I’m not printing |
…red-output CLIs
Claude uses --output-format stream-json and Codex has its own app-server; neither
needs an interactive PTY. spawnAgentOnce now routes these two CLIs through
spawnCli({ transport: 'headless' }) (relay 8.3.0) while shells and unknown
executables continue to use spawnPty.
The resolved runtime is set on agentRuntimes immediately after spawn so
attachTerminal skips PTY-only operations (resize, snapshot) without a race
against the async agent_spawned event.
worker_stream chunks still flow through broker:pty-chunk → xterm, so the
headless placeholder that hid the terminal entirely is removed — V1 rendering
is unaffected.
https://claude.ai/code/session_01KXU1uAUwx3L82TMLnAmU4z
|
Your free trial PR review limit of 300 PRs has been reached. Please upgrade your plan to continue using CodeAnt AI. |
There was a problem hiding this comment.
1 issue found across 2 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
|
Your free trial PR review limit of 300 PRs has been reached. Please upgrade your plan to continue using CodeAnt AI. |
There was a problem hiding this comment.
1 issue found across 3 files (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
Three bugs caught in review: 1. SpawnCliInput was missing from the @agent-relay/harness-driver import block, causing a TypeScript compile error wherever it was referenced. 2. The immediate agentRuntimes.set() after spawnCli used a bare agent name, while every other read/write in the map (agent_spawned event, syncAgents, attachTerminal) used the composite "sessionKey:name" key from getAgentRuntimeKey(). The cache miss meant the early-set optimization — intended to prevent a race between spawnAgent returning and attachTerminal reading before agent_spawned fires — was always a no-op. 3. The broker test mock's listAgents/getStatus always returned runtime:'pty' for every agent, including those spawned via spawnCli. This would overwrite the correct headless runtime in agentRuntimes on the next listAgents poll. The mock now tracks runtimes per agent in a local Map, consistent with how spawnPty/spawnCli register them. https://claude.ai/code/session_01KXU1uAUwx3L82TMLnAmU4z
|
Your free trial PR review limit of 300 PRs has been reached. Please upgrade your plan to continue using CodeAnt AI. |
OpenCode was already registered as a harness in proactive agents, burn stamping, the cloud agent picker, and the toolbar — but was missing from the interactive spawn surfaces. Adds OpenCode to SpawnAgentCli type, SpawnAgentDialog AGENT_OPTIONS (3-col grid), and TerminalPane empty-state quick-spawn buttons. OpenCode runs headless via the app-server (relay 8.3.0), so spawning it will use the headless runtime path rather than a PTY terminal. Native structured output rendering is tracked separately. https://claude.ai/code/session_01KXU1uAUwx3L82TMLnAmU4z
OpenCode exposes an HTTP app-server (opencode serve); relay connects to it
instead of spawning an interactive PTY. spawnAgentOnce routes cli=opencode
through spawnCli({ transport: 'headless' }) (relay 8.3.0 API).
Adds the agentRuntimes map and attachTerminal headless guard so PTY-only
operations (resize, snapshot) are skipped for OpenCode agents. worker_stream
chunks still flow through broker:pty-chunk → xterm for V1 terminal rendering.
https://claude.ai/code/session_01KXU1uAUwx3L82TMLnAmU4z
6e59aa7 to
a3c8a42
Compare
|
Your free trial PR review limit of 300 PRs has been reached. Please upgrade your plan to continue using CodeAnt AI. |
What this PR does
OpenCode was already registered across pear's harness surfaces (proactive agents, burn stamping, cloud agent picker, toolbar,
AgentIcons) but was missing from the interactive spawn surfaces users touch directly.Changes (diff vs PR #139 base):
SpawnAgentClitype:'claude' | 'codex'→'claude' | 'codex' | 'opencode'SpawnAgentDialog: adds OpenCode card to the spawn gridTerminalPaneempty state: adds OpenCode quick-spawn buttonbroker.ts: adds'opencode'to the headless agent list so it routes throughspawnCli({ transport: 'headless' })rather thanspawnPty()This PR is rebased on #139 — all headless infrastructure (runtime tracking,
attachTerminalguard, composite key fix,SpawnCliInputimport) lives in #139, not duplicated here.Critical gap — structured output rendering is NOT in this PR
Same gap as #139: the output pipeline (
worker_stream→broker:pty-chunk→ xterm) is unchanged. For OpenCode headless agents, raw event JSON from OpenCode's app-server will hit xterm verbatim. This is not the intended end state.How OpenCode's structured output works
OpenCode runs
opencode serve --port <n>and exposes an SSE endpoint at/event. Events of interest:message.delta— streamed text outputfile.changed— file edit notificationspermission.requested— approval promptsV1 plan: parse these SSE events from
worker_streamchunks, extractmessage.deltatext, emit formatted text to xterm.V2 plan: no xterm; render
message.deltaas message bubbles,file.changedas diff cards,permission.requestedas native approval dialogs.Merge order
npm installfirstConflicts to expect at merge
SpawnAgentDialog,TerminalPane, andSpawnAgentCliare also touched by PR #138 (Grok). Conflicts are trivial — result should be all four harnesses in each location.Deferred
permission.requestedand render as Pear dialog cardsGenerated by Claude Code