Skip to content

Log which primary was benched (and why) on a proactive fallback swap#1279

Merged
atomantic merged 1 commit into
mainfrom
chore/log-benched-primary-on-fallback-swap
Jun 15, 2026
Merged

Log which primary was benched (and why) on a proactive fallback swap#1279
atomantic merged 1 commit into
mainfrom
chore/log-benched-primary-on-fallback-swap

Conversation

@atomantic

Copy link
Copy Markdown
Owner

Summary

Follow-up to #1278. When createRun finds the requested provider benched (runtime-unavailable) and proactively routes to a fallback, the log printed only the fallback — ⚡ Using fallback provider: Codex CLI (source: system) — which reads as an unexplained switch. It's confusing precisely because a provider's enabled toggle (what the AI Providers UI shows) is independent of its runtime availability state, which the bench sets after a failure like a MODEL_NOT_FOUND.

The line now names the skipped primary, its reason, and the recovery ETA:

⚡ Primary Claude Code CLI unavailable (model-not-found, recovers in 28m) — using fallback Codex CLI (source: system)

Uses providerStatusService.getStatus() / getTimeUntilRecovery() — already called two lines below on the no-fallback error path — so no new dependencies. The CoS agent fallback path (agentProviderResolution.js) already logs primaryProvider in its structured context.

Test plan

  • No behavior change — pure log-string enrichment. node --check passes; providerStatus and agentProviderResolution suites green (46 tests). The createRun proactive-swap path has no existing test harness and building one for a log string would be disproportionate; the helpers used are already exercised on the adjacent no-fallback error path.

The toolkit's createRun logged only the fallback it routed to
('Using fallback provider: Codex CLI (source: system)'), so a benched
primary looked like an unexplained switch — confusing because the
provider's 'enabled' toggle is independent of its runtime availability.
Name the skipped primary, its unavailability reason, and the recovery ETA
instead.
@atomantic atomantic merged commit 81fda81 into main Jun 15, 2026
@atomantic atomantic deleted the chore/log-benched-primary-on-fallback-swap branch June 15, 2026 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant