fix(background-agent): skip unavailable fallback models#3402
Conversation
|
All contributors have signed the CLA. Thank you! ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
There was a problem hiding this comment.
1 issue found across 3 files
Confidence score: 3/5
- There is a concrete behavior risk in
src/features/background-agent/fallback-retry-handler.ts: availability resolution can ignore the connected preferred provider path, which may skip valid fallback providers when cache data is present. - Given the issue is medium severity (6/10) with high confidence (8/10) and affects fallback selection logic, this introduces a real chance of user-facing reliability regressions.
- Pay close attention to
src/features/background-agent/fallback-retry-handler.ts- ensure preferred-provider and cached-availability paths are reconciled so valid fallbacks are not skipped.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/features/background-agent/fallback-retry-handler.ts">
<violation number="1" location="src/features/background-agent/fallback-retry-handler.ts:90">
P2: Availability resolution ignores the connected preferred provider path, so valid fallbacks can be skipped when cache data exists.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
|
Triage note: rebase onto current To re-land:
Closes #3400 still applies once #3402 is rebased + verified. Leaving open. |
|
Closing as obsolete. Current
This achieves the same goal as this PR (skip unavailable fallback candidates instead of attempting them), so the diff would now be a no-op. Closing along with closing #3400 (the linked issue). |
|
Closing as obsolete; the reachability skip is already in HEAD's |
Summary
Changes
model-fallbackcandidate selection to prefer runtime-available fallback modelsTesting
bun test src/features/background-agent/fallback-retry-handler.test.ts src/features/background-agent/manager.polling.test.ts src/features/background-agent/session-idle-event-handler.test.ts bun run typecheck bun run buildManual validation:
Related Issues
Closes #3400
Summary by cubic
Skip fallback models that aren’t available at runtime to avoid wasted background-agent retries. Use the provider-model cache to pick the first available fallback and prefer the connected preferred provider when possible; fall back to the old provider-based logic when no cache is present.
Written for commit 77d86f2. Summary will update on new commits.