Skip to content

fix(adapter): surface OpenRouter error body instead of KeyError('choices')#42

Merged
jonathanbbechtel merged 2 commits into
mainfrom
fix/adapter-surface-error-body
Jun 11, 2026
Merged

fix(adapter): surface OpenRouter error body instead of KeyError('choices')#42
jonathanbbechtel merged 2 commits into
mainfrom
fix/adapter-surface-error-body

Conversation

@jonathanbbechtel

Copy link
Copy Markdown
Collaborator

Summary

OpenRouter returns error objects with HTTP 200 for some failures (context length exceeded, provider moderation). The adapter crashed with an opaque KeyError('choices'); it now raises RuntimeError carrying the provider's actual error message.

Found live during the official leaderboard run: openai/gpt-oss-120b (131k context) hit the ~184k-token operations tasks and every failure logged as FAILED ('choices') with no hint of the real cause.

Tests

  • test_error_body_with_200_surfaces_provider_message — error body + HTTP 200 → RuntimeError with provider message
  • test_empty_choices_list_raises_runtime_error — empty choices list → legible RuntimeError

🤖 Generated with Claude Code

…ces')

OpenRouter returns error objects with HTTP 200 for some failures (context
length exceeded, provider moderation). The adapter crashed with an opaque
KeyError('choices'); now it raises RuntimeError with the provider's actual
error message. Found live when gpt-oss-120b (131k context) hit the ~184k-token
operations tasks.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@pearleng-atlantis

Copy link
Copy Markdown
Error: This repo is not allowlisted for Atlantis.

@jonathanbbechtel jonathanbbechtel merged commit 091789c into main Jun 11, 2026
2 checks passed
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.

2 participants