fix(agents): probe primary after auto fallback pin#82707
Conversation
|
Codex review: needs real behavior proof before merge. Summary Reproducibility: yes. Current main source shows auto fallback selections are persisted and reused as stored session overrides, and the linked issue supplies concrete production occurrences; I did not run a live provider outage/recovery repro in this read-only review. Real behavior proof Next step before merge Security Review detailsBest possible solution: Land a reviewed recovery policy that retries the configured primary for auto-sourced pins, clears only matching auto state, preserves user/live model switches, and tracks any no-visible-reply persistence policy separately if needed. Do we have a high-confidence way to reproduce the issue? Yes. Current main source shows auto fallback selections are persisted and reused as stored session overrides, and the linked issue supplies concrete production occurrences; I did not run a live provider outage/recovery repro in this read-only review. Is this the best way to solve the issue? Yes, with a proof caveat. A throttled primary probe for auto-sourced pins is a narrow maintainable fix that preserves explicit user selections, but it still needs real behavior proof before merge. Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 1586085c7fcb. |
|
Verification before merge: Local proof:
Local result:
Real behavior proof:
CI:
Known proof gap:
|
Summary
Verification
Real behavior proof
Behavior addressed: Auto-pinned fallback sessions periodically retry the configured primary and clear the pin when it succeeds.
Real environment tested: Local OpenClaw source checkout at b098e77 on macOS, Node 26.0.0.
Exact steps or command run after this patch: Ran a production helper probe with node --import tsx --input-type=module against src/agents/agent-scope.ts.
Evidence after fix: Terminal output from the local OpenClaw runtime probe:
{ "firstProbe": { "provider": "openai", "model": "gpt-5.5", "fallbackProvider": "openrouter", "fallbackModel": "minimax/minimax-m2.7", "fallbackAuthProfileId": "openrouter:fallback", "fallbackAuthProfileIdSource": "auto" }, "throttledProbe": null, "recoveredEntry": { "sessionId": "session-82544", "updatedAt": 70000 } }Observed result after fix: The persisted auto fallback produced a primary probe for openai/gpt-5.5, the immediate retry was throttled, and the recovered primary clear removed provider/model/auth fallback overrides from the session entry.
What was not tested: Live provider recovery against a real remote model backend.
Fixes #82544