Skip to content

fix(opencode): surface stall errors and clear thinking spinner#869

Open
swear01 wants to merge 5 commits into
tiann:mainfrom
swear01:fix/issue-865-opencode-stuck-thinking
Open

fix(opencode): surface stall errors and clear thinking spinner#869
swear01 wants to merge 5 commits into
tiann:mainfrom
swear01:fix/issue-865-opencode-stuck-thinking

Conversation

@swear01

@swear01 swear01 commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Closes #865

Summary

  • Route OpenCode quota/rate-limit/retry/HTTP-2 cancel stderr through sendAgentMessage({ type: 'error' }) instead of faint system messages
  • On stall-class stderr, clear thinking and call cancelPrompt() so the web UI does not stay stuck while OpenCode retries upstream
  • Add web handling for data.type === 'error' with warning-styled presentation

Test plan

  • Failing tests added for stall stderr (quota, HTTP/2 CANCEL) and web error normalization/presentation
  • Negative test: non-stall stderr surfaces error without canceling prompt or clearing thinking
  • bun typecheck passes
  • bun run test passes (cli + hub + web + shared)
  • Manual: remote OpenCode session hits quota/upstream cancel → error shows with ⚠️ and spinner clears

Made with Cursor

swear01 and others added 3 commits June 10, 2026 14:27
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>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Findings

  • [Minor] Shared ACP retry stderr names OpenCode — AcpStdioTransport is used by Cursor ACP, Gemini, Kimi, and OpenCode, and those launchers forward error.message to the session. The new shared retry-backoff branch can therefore show “OpenCode is retrying...” in non-OpenCode sessions when their stderr contains retrying 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.',

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

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.

fix(opencode): quota/retry stalls leave web UI stuck in thinking; errors not surfaced

1 participant