Files
hermes-agent/plugins/model-providers/opencode-zen
Turgut Kural ba560a7067 fix(agent): keep OpenCode Go keys on a per-model upstream 429
OpenCode Go answers 429 for two different walls. GoUsageLimitError is the
key's plan window and must bench the key (the built-in pipeline already
classifies it as billing). 'Upstream request failed: Rate limit exceeded'
is a single model's upstream throttle: the key keeps serving every other
model, yet the pool benched it for the 429 hour. With a two-key pool whose
primary hit its weekly window, one throttled main model benched the backup
too, and every auxiliary task on a different model failed with
'no available entries'.

The opencode-go profile now classifies that body as upstream_rate_limit
through its classify_api_error hook, which the main recovery path already
treats as 'credential healthy, defer to fallback'. The auxiliary pool
recovery consulted only substring predicates, so it now also skips the
bench for an upstream_rate_limit verdict (covers OpenRouter-wrapped
upstream 429s the same way).

Salvaged from #140713.
2026-11-08 13:18:54 +05:30
..