Description
build_judge_provider in src/bootstrap/mod.rs:1296–1333 documents a three-level resolution order: judge_provider → judge_model → primary provider. However, when judge_provider is non-empty but the named provider lookup fails (create_named_provider returns Err), the code logs a warning and immediately returns None — falling back to the primary provider and skipping the judge_model fallback entirely.
This means a user with a misconfigured judge_provider silently loses their judge_model fallback, and the implicit correction system uses the full primary provider for judging instead of the dedicated judge_model.
Reproduction Steps
- Set
skills.learning.detector_mode = "judge"
- Set
skills.learning.judge_provider = "nonexistent-provider" (a name not in [[llm.providers]])
- Set
skills.learning.judge_model = "gpt-4o-mini" (a valid model)
- Start the agent
- Observe: log shows
"failed to create judge provider: ..., using primary", judge_model is ignored
Expected Behavior
When judge_provider lookup fails, the code should fall through to the judge_model path (lines 1317–1332) before falling back to primary.
Actual Behavior
build_judge_provider returns None early (line 1313) on judge_provider lookup failure, bypassing the judge_model branch.
Environment
- Commit: 76bfce4
- File:
src/bootstrap/mod.rs:1296–1333
Fix
Change the early return in the Err arm of the judge_provider lookup to fall through to the judge_model block instead:
Err(e) => {
tracing::warn!(
provider = %learning.judge_provider,
"failed to create judge provider: {e:#}, falling back to judge_model"
);
// fall through — do NOT return None here
}
Description
build_judge_providerinsrc/bootstrap/mod.rs:1296–1333documents a three-level resolution order:judge_provider→judge_model→ primary provider. However, whenjudge_provideris non-empty but the named provider lookup fails (create_named_providerreturnsErr), the code logs a warning and immediately returnsNone— falling back to the primary provider and skipping thejudge_modelfallback entirely.This means a user with a misconfigured
judge_providersilently loses theirjudge_modelfallback, and the implicit correction system uses the full primary provider for judging instead of the dedicatedjudge_model.Reproduction Steps
skills.learning.detector_mode = "judge"skills.learning.judge_provider = "nonexistent-provider"(a name not in[[llm.providers]])skills.learning.judge_model = "gpt-4o-mini"(a valid model)"failed to create judge provider: ..., using primary",judge_modelis ignoredExpected Behavior
When
judge_providerlookup fails, the code should fall through to thejudge_modelpath (lines 1317–1332) before falling back to primary.Actual Behavior
build_judge_providerreturnsNoneearly (line 1313) onjudge_providerlookup failure, bypassing thejudge_modelbranch.Environment
src/bootstrap/mod.rs:1296–1333Fix
Change the early
returnin theErrarm of thejudge_providerlookup to fall through to thejudge_modelblock instead: