fix(agents): reroute recovered tasks through healthy fallback - #1556
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughSubagent fallback routing preserves the previewed Codex account, reruns fallback selection after encrypted task recovery, and rebuilds the route when the model changes. An integration test verifies routing from ChangesRecovery fallback routing
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant AgentTaskRecovery
participant ResponsesCore
participant FallbackRouter
participant xAIProvider
AgentTaskRecovery->>ResponsesCore: recover encrypted task payload
ResponsesCore->>FallbackRouter: reevaluate fallback with recovered payload
FallbackRouter-->>ResponsesCore: select xai/grok-4.6
ResponsesCore->>xAIProvider: route request to xai/grok-4.6
xAIProvider-->>ResponsesCore: return provider response
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
✅ Deterministic PR hygiene checks passed. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/server/responses/core.ts`:
- Around line 1743-1781: Update the recovery-path call to
applySubagentModelFallback so it only runs when route.codexAccountId ===
undefined, matching the initial fallback guard and preserving exact account
routing. Add a regression test covering a recovered account-qualified request
with an unavailable model, asserting that no global fallback is selected.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 7b0ab473-8ee7-43bd-be57-6d4904abcd7b
📒 Files selected for processing (2)
src/server/responses/core.tstests/agent-task-recovery-fallback.test.ts
Summary
routewhen recovery selects a different model so dispatch uses the healthy routed fallback instead of the unavailable primary.Root cause
The initial fallback pass intentionally sets
nativeFallbackOnlywhile the V2 task is still unreadable, so routed candidates are skipped. After recovery reparsed the now-readable request, fallback selection was not run again, leavingroutebound to the unavailable routed primary.Verification
TDD regression:
b5d8537), Cross-platform CItest 3/4failed exactly on the new regression: expectedgrok-4.6, receivedgrok-4.5.1f0d576), the same regression passes:agent task recovery fallback routing > routes a recovered task through the healthy routed fallback.test 3/4shard completed with 525 pass, 3 skip, 0 fail.gatesis green, including typecheck, GUI tests, privacy scan, release-helper syntax, and CLI help smoke.Refs #1540. Complements #1555.