Skip to content

customModeModelChangedEventHandler may activate wrong model when BYOK and native models share a name #261

@rsd-darshan

Description

@rsd-darshan

Summary

The customModeModelChangedEventHandler in ModelService resolves the model to activate by searching for the first map entry whose getModelName() matches the name extracted from the event payload (format: "<modelName> (<modelFamily>)").

If a BYOK model and a native Copilot model happen to share the same modelName, findModelKeyByName returns the first match regardless of provider, which can activate the wrong model.

Root cause

The custom-mode event protocol carries only a human-readable model name (plus family in parens). There is no provider or composite key in the payload, so a name-only lookup is inherently ambiguous when models share a name across providers.

Fix

Extend the custom-mode event protocol to carry the composite key (or at minimum the provider name alongside the model name), so customModeModelChangedEventHandler can do an unambiguous direct map lookup.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions