fix(opencode): surface stall errors and clear thinking spinner#869
fix(opencode): surface stall errors and clear thinking spinner#869swear01 wants to merge 5 commits into
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
…tiann#865) Route quota/rate-limit/HTTP-2 cancel stderr through error-styled agent messages, cancel the in-flight prompt, and clear thinking so the web UI does not stay stuck while OpenCode retries upstream. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Findings
- [Minor] Shared ACP retry stderr names OpenCode —
AcpStdioTransportis used by Cursor ACP, Gemini, Kimi, and OpenCode, and those launchers forwarderror.messageto the session. The new shared retry-backoff branch can therefore show “OpenCode is retrying...” in non-OpenCode sessions when their stderr containsretrying in. Evidence:cli/src/agent/backends/acp/AcpStdioTransport.ts:369.
Suggested fix:message: 'The ACP agent is retrying after an upstream failure. The turn may be stalled.',
Summary
Review mode: initial
One minor user-facing wording issue found in shared ACP stderr handling. Residual risk: review was static only; PR tests were not run in this review pass.
Testing
Not run (automation)
HAPI Bot
| if (matchesAcpRetryBackoff(text)) { | ||
| this.stderrErrorHandler({ | ||
| type: 'unknown', | ||
| message: 'OpenCode is retrying after an upstream failure. The turn may be stalled.', |
There was a problem hiding this comment.
[MINOR] This retry-backoff parser lives in AcpStdioTransport, which is shared by Cursor ACP, Gemini, Kimi, and OpenCode. The other ACP launchers register onStderrError and forward error.message to the session, so any non-OpenCode ACP stderr containing retrying in will now tell users “OpenCode is retrying...” in the wrong session.
Suggested fix:
message: 'The ACP agent is retrying after an upstream failure. The turn may be stalled.',AcpStdioTransport is shared by Cursor, Gemini, Kimi, and OpenCode. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Findings
No issues found.
Summary
Review mode: follow-up after new commits
No remaining high-confidence issues found in the current diff. The follow-up commit addresses the prior shared ACP wording finding. Residual risk: targeted tests were not run because bun is unavailable in this runner environment.
Testing
Not run: bun command not found while attempting targeted CLI/web tests.
HAPI Bot
…ode-stuck-thinking # Conflicts: # cli/src/agent/messageConverter.test.ts # web/src/chat/normalizeAgent.ts
There was a problem hiding this comment.
Findings
No issues found.
Summary
Review mode: follow-up after new commits
No high-confidence correctness, security, regression, data loss, performance, or maintainability issues found in the current diff. Residual risk: tests were not run in this runner because bun is unavailable.
Testing
Not run (automation): bun command not found.
HAPI Bot
Closes #865
Summary
sendAgentMessage({ type: 'error' })instead of faint system messagesthinkingand callcancelPrompt()so the web UI does not stay stuck while OpenCode retries upstreamdata.type === 'error'with warning-styled presentationTest plan
bun typecheckpassesbun run testpasses (cli + hub + web + shared)Made with Cursor