Skip to content

feat: add modelNameDisplay option to show model id instead of name #35

Description

@Rahulsharma0810

Problem

The plugin renders model.name in the OpenCode model picker (plugin.ts:789). When multiple OmniRoute providers serve the same base model, they all return the same name value — e.g. four providers all return name: "GPT-5.5" for their respective gpt-5.5 entry.

This leaves the user with a picker full of identical display names and no way to tell which provider they are selecting.

Proposed fix

Add a modelNameDisplay option to OmniRouteConfig:

Value Display name shown
"name" (default) name field from /v1/models — unchanged behaviour
"id" id field from /v1/models — always unique per entry

When set to "id", the picker shows "gh/gpt-5.5", "cx/gpt-5.5" etc., making all entries distinguishable regardless of the server-side name.

Usage

// opencode.js
import OmniRouteAuthPlugin from 'opencode-omniroute-auth';

export default {
  plugins: [OmniRouteAuthPlugin],
  provider: {
    omniroute: {
      options: {
        baseURL: 'http://localhost:20128/v1',
        modelNameDisplay: 'id',   // show "gh/gpt-5.5" instead of "GPT-5.5"
      },
    },
  },
};

Relationship to server-side fix

A complementary server-side fix (diegosouzapw/OmniRoute#4516 / diegosouzapw/OmniRoute#4517) qualifies ambiguous model names on the server. The client-side option is still useful for older OmniRoute versions or when the user prefers raw IDs unconditionally.

Related

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