Skip to content

fix: /provider switch uses provider type name as model fallback when entry.model is None #2151

@bug-ops

Description

@bug-ops

Summary

When switching provider via /provider <name> and the [[llm.providers]] entry has no explicit model field, the runtime model name is set to the provider type string (e.g. "ollama", "claude") instead of the actual default model.

Location

crates/zeph-core/src/agent/provider_cmd.rs:120-122

let model_name = entry.model.clone().unwrap_or_else(|| new_provider.name().to_owned());

Impact

  • /provider status shows wrong model name
  • Cost tracking and tracing spans report incorrect model
  • Affects all provider entries without an explicit model field in config

Fix

Use ProviderEntry::effective_model() or the provider type's default model constant instead of new_provider.name() as fallback.

Severity

Medium — incorrect display/tracking, not a crash or data loss.

Discovered during code review of PR #2150.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions