Skip to content

test: add unit tests for /provider command handlers in provider_cmd.rs #2152

@bug-ops

Description

@bug-ops

Summary

crates/zeph-core/src/agent/provider_cmd.rs (203 lines) and build_provider_for_switch() have zero unit test coverage.

What to Test

  • /provider with multiple configured providers — list output, active highlighted
  • /provider <name> valid switch — state reset verified (cached_prompt_tokens, compaction, ACP override)
  • /provider <unknown> — clear error returned, no panic
  • /provider status — correct provider/model/cost output
  • ProviderConfigSnapshot construction from ProviderEntry

Pattern

Use MockProvider and MockChannel per existing test patterns in crates/zeph-core/src/agent/.

Discovered during tester review of PR #2150.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions