fix(agents): continue model fallback on failover text payloads#19252
fix(agents): continue model fallback on failover text payloads#19252mahsumaktas wants to merge 2 commits intoopenclaw:mainfrom
Conversation
29d6606 to
3eea4a0
Compare
|
Rebased on latest main and resolved runner-layer conflicts with a conservative merge strategy (kept new context/auth wiring + fallback improvements).\n\nValidation run locally:\n- pnpm vitest run --config vitest.e2e.config.ts src/agents/model-fallback.e2e.test.ts src/agents/pi-embedded-helpers.isbillingerrormessage.e2e.test.ts\n- pnpm vitest run src/agents/model-fallback.probe.test.ts\n- pnpm vitest run src/auto-reply/reply/followup-runner.test.ts src/auto-reply/reply/agent-runner.runreplyagent.test.ts\n- pnpm oxlint --type-aware (touched files)\n\nAll passed locally; PR is now mergeable and CI is running. |
|
This pull request has been automatically marked as stale due to inactivity. |
|
Closing due to inactivity. |
Summary
runWithModelFallback402textTesting
pnpm vitest run --config vitest.e2e.config.ts src/agents/model-fallback.e2e.test.tspnpm oxlint --type-aware src/agents/model-fallback.ts src/agents/model-fallback.e2e.test.tsGreptile Summary
Extends model fallback system to detect and retry when providers return failover-shaped error payloads as "successful" run results. The PR adds:
resolveFailoverPayloadMessage) inmodel-fallback.ts:89-134that inspects successful run results for error text payloads and converts them to fallback retriesrequires more credits,can only afford) to catch OpenRouter-style 402 messagesModelFallbackRunContext) passed to all run callbacks, enabling callers to know when fallback chains are activeprobePrimaryDuringCooldownconfiguration set to"always"across auto-reply, followup, memory, and CLI flows so primary models are always attempted first (then fallback if rate-limited)fallbackswhen agent configs only overrideprimaryThe detection logic guards against false positives by requiring error-like signals (payload marked
isError, stopReason"error", or regex match for HTTP codes/error keywords) before treating instructional text about rate limits as actual failures.Confidence Score: 5/5
Last reviewed commit: 29d6606