#15026·OmniRoute

bug(providers): Cannot hide models on provider page due to hardcoded modality: chat and UI selector mismatch

Author: fidelixCreated Sep 28, 2026Updated Sep 28, 2026

Bug: Cannot hide models on provider page (modality mismatch & UI selector bug)

Description

On provider details pages (e.g. /dashboard/providers/codex), clicking the "Hide" toggle on models appears to succeed (returns 200 OK), but the UI immediately shows the model as visible again, and the model is not properly hidden.

Root Cause Analysis

Tracing the execution flow in diegosouzapw/omniroute:next:

  1. Frontend hardcodes "modality": "chat": On /dashboard/providers/[id], the hide toggle handler handleToggleModelHidden issues:

    javascript
    PATCH /api/provider-models?provider=${provider}&modelId=${modelId}
    Body: { "isHidden": true, "modality": "chat" }
  2. Backend only sets hiddenModalities[modality], omitting isHidden: In the PATCH /api/provider-models handler (modelCompatOverrides updater):

    javascript
    if ("isHidden" in c) {
      let a = typeof c.modality === "string" && c.modality ? c.modality : null;
      if (a) {
        let b = { ...(f.hiddenModalities || {}) };
        null === c.isHidden ? delete b[a] : (b[a] = !!c.isHidden);
        f.hiddenModalities = b;
      } else {
        f.isHidden = !!c.isHidden;
      }
    }

    Because modality: "chat" is sent in the body, it only records f.hiddenModalities = { chat: true }. Top-level f.isHidden remains undefined (or unchanged).

  3. Frontend UI selector B(e) only reads e.isHidden: In module 27522, the helper that determines if a model is hidden:

    javascript
    function B(e) {
      if (e && Object.prototype.hasOwnProperty.call(e, "isHidden")) {
        return !!e.isHidden;
      }
    }

    B(e) never inspects e.hiddenModalities. Since e.isHidden is undefined, the UI immediately renders the model as visible/unhidden after the state refresh.

  4. Non-chat provider mismatch (e.g., Codex): Providers like Codex use apiFormat: "responses" rather than "chat". Marking hiddenModalities.chat = true does not hide a responses-based model from consumers targeting its native endpoint format.

Expected Behavior

  • Clicking "Hide" on a provider's model should set top-level isHidden = true when toggled from the provider model list, or the frontend should omit modality when hiding the model globally for that provider connection.
  • The UI selector B(e) should be consistent with how the backend determines model visibility.