Skip to content

bug(platform): Model access repeats a model per provider without naming it; the rows check together and outlive a search #5178

Open

Description

@yannickmonney

Summary

When two or more providers offer the same model id, the Allowed models (or Blocked models) list of a Model access rule shows one row per provider. Each row shows the bare id and no provider. In the pilot's organization, three providers list openai/gpt-5.6-luna. OpenRouter's shipped catalog names that model this way (configs/platform/system/models/openrouter/models.yml:105), and OpenAI-compatible gateways commonly use the same vendor/model form. All the rows of one id share one value: checking one checks them all, and React reports duplicate keys. While a search is typed, rows from the earlier lists stay on screen beside No results found, and they stop showing the real selection. Behind the dialog, a rule stores bare ids and is enforced per id, so it cannot allow a model through one provider and not through another. This was reproduced locally; a pilot's screenshot shows the same state.

The report

The pilot's screenshot shows Regel bearbeiten (Edit rule) with scope Role › Member and Erlaubte Modelle (Allowed models). The chips read openai/gpt-5.6-sol, anthropic/claude-haiku-5.5 and openai/gpt-5.6-luna. The list, searched for luna 5.6, shows five checked rows — …-luna, …-sol, …-luna, …-sol, …-luna — above Keine Ergebnisse gefunden (No results found). The owner's note:

Some parts of the UI do not show the actual AI provider when selecting a model.

Reproduction (local; main at 49ce42fdd)

The setup: two OpenAI-compatible providers, "Gateway A" and "Gateway B", whose catalogs list the same four ids. In Settings › Governance › Models › Model access: the policy on, mode Allowlist, then Add rule.

  1. The list shows eight rows: each id twice, with no provider. Opening it logs four errors, one per id, of this form: "Encountered two children with the same key, openai/gpt-5.6-luna. … Non-unique keys may cause children to be duplicated and/or omitted".
  2. Checking the first openai/gpt-5.6-luna row checks the second one too. The field shows one chip.
  3. With luna, sol and haiku checked, luna 5.6 is typed one key at a time. The search is one substring of the label, so luna 5.6 does not match openai/gpt-5.6-luna, and No results found appears. Four rows stay on screen anyway: mock/skill-runner, plus openai/gpt-5.6-luna, openai/gpt-5.6-sol and anthropic/claude-haiku-5.5, all three checked. Which rows remain depends on the lists the search passed through. That is the state in the pilot's screenshot.
  4. Clicking the leftover openai/gpt-5.6-sol row removed that model from the selection (its chip went), while the row still read as checked.
  5. A rule saved with openai/gpt-5.6-luna picked from Gateway A's row is stored as the bare id (allowedModels: [openai/gpt-5.6-luna]). The chat's model picker then offers GPT 5.6 Luna from Gateway A and from Gateway B.

What the repository says (main at 49ce42fdd)

Paths that start with components/ or hooks/ are under services/platform/app/features/settings/governance/.

The options.

  • allModelOptions adds one option per provider and model, with value: model.id and label: model.displayName || model.id (components/model-access-editor.tsx:422-440).
  • The catalog hook sets displayName to the id (hooks/model-catalog.ts:65-69). It lists only providers with an active credential (:53-61).
  • The dialog hands {value, label} to MultiSelect (components/model-access-editor.tsx:206-208, :318-349).

The list. MultiSelect (packages/ui/src/components/forms/multi-select.tsx):

  • keys each row by value (:530-542);
  • finds each chip's option by value (:225-231);
  • shows the empty text when the filtered list is empty (:544-553);
  • by default, keeps an option when the query is a case-insensitive substring of its label or description (:147-153).

The details popover. The ⓘ on each row gets tags and capabilities keyed by the bare id (components/model-access-editor.tsx:337-343). useModelCapabilities reads every catalog, not only providers with a credential, and takes the first that lists the id (hooks/model-catalog.ts:86-101). So two rows of one id show the same details, which may be another provider's prices. The popover can show a provider (services/platform/app/features/shared/models/model-info-popover.tsx:54-64, :160-162), but this caller passes none.

The rules table. It names each model by the first option with that id (resolveModelNames, components/model-access-editor.tsx:704-715).

What a rule stores and enforces.

  • allowedModels and blockedModels are lists of strings (packages/shared/src/schemas/governance.ts:749-750).
  • isModelPermitted compares the bare id after stripping a provider: qualifier (services/platform/backend/core/governance/model_access_enforcement.ts:83-102), so a rule applies to that id from every provider.

The other governance pickers carry the provider.

  • Default models picks a provider first, then one of its models, and stores both (components/default-model-editor.tsx:225-247).
  • Standard agent, Image generation, Transcription and Vision offer provider::model pairs (components/model-id.ts:11-26) and store the provider and the model, for example Vision at components/vision-model-editor.tsx:134-146.

In passing: the client's conflict checks cut ids at the first colon.

  • Before saving, both editors compare the default-model rules against the access rules with stripQualifier, which drops everything up to the first : (components/model-id.ts:1-9; components/model-access-editor.tsx:101-103; components/default-model-editor.tsx:86-92). An OpenRouter id such as vendor/model:free becomes free, so two different :free models compare as equal.
  • The server's stripModelRefQualifier treats a prefix as a provider only when it is a slug (packages/shared/src/utils/model-ref.ts:27, :49-61), so it keeps these ids whole. Only the warnings are affected.

Questions

  1. Should a rule allow or block a model per id (as today: from every provider), or per provider and model? Per provider is what an admin needs to allow a model through an EU gateway but not through another provider (feat(platform): let admins restrict model calls to endpoints that process in the EU/EEA #5041).
  2. If per id: should the list show each id once, naming on the row the providers that offer it, as the automation llm step does (services/platform/app/features/automations/hooks/use-llm-model-options.ts:37-55)?
  3. Should MultiSelect guard against duplicate values itself (warn, dedupe, or key rows another way), since any caller can pass them?

Options (no preference stated)

  1. Keep rules per id. List each id once, with its providers as the description, and dedupe before the MultiSelect.
  2. Make rules per provider. Store the provider with the model, as the other governance pickers do, show the provider on rows and chips, and decide what a stored bare id means (for example, "every provider").
  3. Either way, make MultiSelect hold up against duplicate values.

Related

#5179 (where else the provider is missing), #5140 (provider in the chat model picker), #5041 (EU/EEA endpoints), #3655 (the usage ledger merged one id across providers; fixed), #3639 (model access rules without a target; fixed), #5044 (pilot findings).

Activity

  1. added
    priority: medium
    needs discussion
    bug
    service: platform
    on Oct 30, 2026
  2. yannickmonney commented on Nov 3, 2026

    @yannickmonney
    ContributorAuthor

    Second report, 2026-11-03: an admin editing rules again could not tell which provider a model in the Model access list comes from. The dialog was re-read on main at 039e421 and nothing has changed since this issue was filed: components/model-access-editor.tsx:422-440 still adds value: model.id / label: model.displayName || model.id per provider and model, with no provider; resolveModelNames (:704-715) still names a rule's models by the first option with that id; isModelPermitted (services/platform/backend/core/governance/model_access_enforcement.ts:83-102) still compares the bare id after stripping a qualifier. The Default models editor next to it does show a provider column, so the two governance editors disagree.

    One consequence worth adding to the case: because a rule is per id and not per (provider, model), an admin cannot use Model access to take one provider's models out of play for a user. That is the lever someone would reach for when one of two providers is unusable, for example out of credit, which came up in #5339 (Auto picked a model whose key had no credit left and the turn failed).

  3. yannickmonney commented on Nov 14, 2026

    @yannickmonney
    ContributorAuthor

    Decision

    Model access rules can name a provider and model, or a model from every provider. The stored format stays.

    • <provider>:<model-id> (for example gateway-a:openai/gpt-5.6-luna) allows or blocks that model only through that provider.
    • A bare <model-id> means that model from every provider. Every entry stored today is bare and keeps its meaning. Nothing is rewritten.
    • One shared matcher in packages/shared serves the server and the client checks. An entry equal to the whole model id always matches, so llama3:8b and vendor/model:free work. A qualified entry matches its exact pair, and a bare entry matches the id from any provider. @quant variants match their base model.
    • Enforcement takes {providerSlug, modelId} as a type and checks the pair that will actually be called: the chat turn, Auto, the composer's model list, title generation, the default-model pin and the model API.
    • The editor shows, for each model, an Every provider row and then one row per provider, with the provider named on each row. Chips and the rules table read "Model · Provider" or "Model · Every provider". An entry whose provider was removed reads "(provider removed)" and stays until an admin removes it.
    • MultiSelect protects itself. It drops duplicate values with a warning, and its search matches every word typed ("luna 5.6" finds openai/gpt-5.6-luna). Leftover rows never sit next to "No results found".

    Answers

    1. Per id or per provider and model? Both, chosen per entry. A provider row applies to that provider only. An Every provider row, like every rule stored today, applies to all providers.
    2. If per id, should the list show each id once? No. Each model gets an Every provider row and one row per provider.
    3. Should MultiSelect guard against duplicate values itself? Yes. It dedupes and warns, and its search becomes word-based.
    4. Can an admin take one provider out of play? Yes, model by model, through that provider's rows. There is no provider-wide wildcard. To take a whole provider out, deactivate its credential. Running out of credit is Bug: Auto can pick a provider that is out of credit, and the turn fails instead of using the other one #5339's reroute.

    Rationale

    Today picking Gateway A's row silently also covers Gateway B, so the stored policy does not match the admin's choice. Per-provider entries fix that and agree with every other governance picker. The editor still offers Every provider because blocking a model everywhere is the main use of a block list. With per-provider blocks only, a newly added provider serving the same model would quietly unblock it. The existing provider:model grammar needs no migration, and older backends fall back to per-id. That means the same allow behaviour as today and a stricter block. Fixing the shared MultiSelect protects every screen that uses it.

    Implementation units (all on main)

    1. fix(ui): keep MultiSelect sound when values repeat and match search by word (S). Dedupe with a warning, word-based filter, no leftover rows. Tested with the exact luna 5.6 sequence from the report.
    2. feat(platform): enforce model access per provider and model (L). Shared matcher and classifier, evaluator typed on the pair, every caller updated (including the model API door), a Model access section in the governance spec.md, the self-hosted file grammar documented. Tests: an entry for Gateway A denies Gateway B's copy, a bare entry covers both and any provider added later, a block wins over an allow, colon ids and @quant variants match correctly.
    3. fix(platform): name the provider on every Model access row, chip and rule (M; after 1 and 2). Every provider row plus one row per provider, provider-aware details, removed-provider entries kept and labelled, conflict and left-behind checks on the shared matcher with stripQualifier removed, en/de/fr strings, docs, a manual-test box.
  4. added
    agent-ready
    and removed
    needs discussion
    on Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readybugpriority: mediumservice: platform

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions