Skip to content

Harden model/provider switching against non-canonical provider identities #21

Description

@OpenCodeEngineer

Problem

We shipped a regression because model/provider switching logic assumed provider identity was stable across all layers. In practice these are different identifiers:

  • config key, for example model_provider = "azure"
  • human-readable provider name, for example name = "Azure OpenAI"
  • upstream catalog/provider ID, for example azure in models.dev

That led to two concrete failures:

  1. Azure model discovery broke when the configured provider name was Azure OpenAI instead of matching the upstream azure catalog entry directly.
  2. Copilot model switching broke because config rebuild paths did not preserve the active profile during in-session provider switching.

Scope

Add process/test guardrails so this class of bug is harder to reintroduce.

Acceptance Criteria

  • Document that provider identity must be treated as three separate concepts: config key, provider display name, and upstream catalog/provider ID.
  • Require regression coverage for ModelsManager, aliasing, models.dev, or provider /models changes using a non-canonical provider name and a non-canonical host.
  • Explicit minimum regression case: name = "Azure OpenAI" must still resolve to the azure catalog entry even when the base URL is a proxy/localhost URL.
  • Require regression coverage that config rebuild, cwd/profile switching, and /model switching preserve active_profile, model_provider_id, and model unless intentionally reset.
  • Require provider-backed catalog tests to cover both picker population and post-selection execution, not just discovery.
  • Require diagnosis guidance to inspect effective config and persisted auth before blaming missing environment variables.

Notes

This is process hardening informed by the Azure/Copilot regression fixed in issue #12.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions