Missing comprehensive error handling for OpenRouter API failures
Next step: Evaluate this item to determine if it's worth fixing. Or approve directly if you already know what needs to be done.
Location
src/supervisor/engine.py:666
Description
engine.py _call_openrouter() (lines 617-688) has retry logic for 429/5xx but doesn't handle malformed JSON responses, missing 'choices' key gracefully until after retries exhausted (line 666). If OpenRouter returns a valid HTTP 200 but with unexpected JSON structure (model quota exceeded, invalid tool call format), the error is raised after all retries, wasting time and potentially leaving runs in RUNNING state. Also, httpx exceptions other than TimeoutException (line 675) aren't caught, causing runs to fail without proper error messages. Should validate response structure earlier and handle all httpx exceptions with specific error messages.
Evaluation
Click "Evaluate with Claude Code" to have an agent analyze this item.