Skip to content

feat: track upstream errors in interception record #114

Closed

Description

@dannykopping

We should categorise the errors that occur during an interception.

Possible enum values:

  • bad request
  • overloaded
  • rate-limited

Overloaded is a bit of a shit one right now though because the SDKs don't handle these correctly (see OpenAI / Anthropic issues).

We're relaying the errors to the client correctly, but not recording them in the store.

Context: at the time of writing, the Anthropic API is overloaded and is returning these errors. We don't have any indication that these requests failed in the UI, so all an operator has to go on is the coder_aibridged_interceptions_total{status="failed"} metric series, which is fine, but it'd be good to tie this back to the data model.

2026-01-14 10:51:02.519 [warn]  coderd.aibridged.pool: interception failed  trace=a01b65e811d3fbc10936e24415ec5e24  span=67c621daae09dda4  route=/v1/messages  provider=anthropic  interception_id=9e77b996-cfb1-47ac-a4d2-46b898d94742  user_agent="ai-sdk/anthropic/2.0.57 ai-sdk/provider-utils/3.0.20 runtime/node.js/22"  streaming=true  request_id=e6e239aa-6acc-46c0-9e87-c69d12022c3c  error="unknown stream error: received error while streaming: {\"type\":\"error\",\"error\":{\"details\":null,\"type\":\"overloaded_error\",\"message\":\"Overloaded\"},\"request_id\":\"req_011CX79DTmU6Jrsguhszr5fj\"   }\n"
Image

Activity

  1. added theissue type on Jan 14, 2026
  2. added this to the Observe milestone on Feb 3, 2026
  3. ssncferreira commented on May 26, 2026

    @ssncferreira
    Contributor

    With the introduction of automatic key failover on aibridge: coder/internal#1446
    We should also include keypool-related errors. A possible suggestion would be to show the keypool status, specifying which keys are temporary/permanent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions