Skip to content

bug(bootstrap): build_judge_provider skips judge_model fallback on provider lookup failure #4761

@bug-ops

Description

@bug-ops

Description

build_judge_provider in src/bootstrap/mod.rs:1296–1333 documents a three-level resolution order: judge_providerjudge_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

  1. Set skills.learning.detector_mode = "judge"
  2. Set skills.learning.judge_provider = "nonexistent-provider" (a name not in [[llm.providers]])
  3. Set skills.learning.judge_model = "gpt-4o-mini" (a valid model)
  4. Start the agent
  5. 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
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Research — medium-high complexitybugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions