Skip to content

fix(core): /provider switch shows provider type instead of configured name #2173

@bug-ops

Description

@bug-ops

Summary

After /provider <name> switch, the confirmation message and /provider status display the provider type (e.g. openai) instead of the configured name field (e.g. mini2).

Reproduction

[[llm.providers]]
name = "mini2"
type = "openai"
model = "gpt-4o-mini"
/provider mini2
→ Switched to provider: openai (model: gpt-4o-mini)   ← should say 'mini2'

/provider status
→ Name: openai   ← should say 'mini2'

Root Cause

handle_provider_switch and handle_provider_status use self.provider.name() which returns the provider type string (e.g. "openai"), not the configured name field from [[llm.providers]]. The list handler uses entry.effective_name() which correctly returns the configured name.

Fix

Store the configured name alongside the active provider instance (e.g. in self.runtime or a wrapper struct). Use that name in the switch confirmation and status output instead of self.provider.name().

Impact

MEDIUM — confusing UX when using named providers. Correct provider IS selected (routing and inference work correctly), only the display name is wrong.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions