Skip to content

fix: keep API errors out of terminal UI#244

Open
floze-the-genius wants to merge 1 commit into
griffinmartin:mainfrom
floze-the-genius:fix/243-limit-error-ui
Open

fix: keep API errors out of terminal UI#244
floze-the-genius wants to merge 1 commit into
griffinmartin:mainfrom
floze-the-genius:fix/243-limit-error-ui

Conversation

@floze-the-genius

Copy link
Copy Markdown
Contributor

Summary

Stops non-2xx Anthropic responses from being written directly through console.warn, where the raw line can overwrite OpenCode's terminal UI.

Structured fetch_error_response diagnostic logging remains unchanged. The response is still returned to OpenCode with its original status, headers, and body, so normal quota handling and retry UI continue to work.

Related issue

Closes #243.

Testing

  • Added a deterministic mocked 429 regression with no live Anthropic request.
  • Verified no terminal warning is emitted.
  • Verified status 429, retry-after: 11218, and the JSON error body are preserved unchanged.
  • Verified the outbound request occurs once.
  • make all
    • lint and format clean
    • TypeScript build passes
    • 204 / 204 tests pass
  • git diff --check

Checklist

  • PR title follows Conventional Commits
  • make all passes locally
  • Tests added or updated where applicable
  • README or docs updated where applicable (not needed; no user-facing configuration changed)

Stop writing non-2xx Anthropic responses directly to stderr where they corrupt OpenCode terminal rendering. Preserve structured debug logging and return the original status, headers, and body unchanged.
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.

Hitting Claude limit damages Opencode UI

1 participant