Skip to content

fix: keep API errors out of terminal UI#244

Merged
griffinmartin merged 1 commit into
griffinmartin:mainfrom
floze-the-genius:fix/243-limit-error-ui
Jul 25, 2026
Merged

fix: keep API errors out of terminal UI#244
griffinmartin merged 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.
@griffinmartin
griffinmartin merged commit baf1ffd into griffinmartin:main Jul 25, 2026
4 checks passed
griffinmartin pushed a commit that referenced this pull request Jul 25, 2026
🤖 I have created a release *beep* *boop*
---


##
[2.0.1](v2.0.0...v2.0.1)
(2026-07-25)


### Bug Fixes

* keep API errors out of terminal UI
([#244](#244))
([baf1ffd](baf1ffd))
* normalize fractional credential expiry timestamps
([#246](#246))
([686a543](686a543))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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

2 participants