GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(schema): ModelAlias provider alias target containing / silently reshapes the ref instead of erroring · Issue #407 · developing-today-forks/opencode

fix(schema): ModelAlias provider alias target containing / silently reshapes the ref instead of erroring #407

New issue
Copy link
New issue
Copy link
Closed
#410
Closed
fix(schema): ModelAlias provider alias target containing / silently reshapes the ref instead of erroring#407
#410
Copy link
Labels
app/schemaPackage: schema (pkgs/ or apps/ in this repo)kind/bugSomething isn't working (prefixed form of the classic bug label)

Description

@dezren39
dezren39
opened on Oct 25, 2026
Issue body actions

Problem

ModelAlias.resolveRef applies a provider alias target verbatim without validating it is a plausible provider ID. A provider alias whose target contains / (or #) does not error — it silently reshapes the reference, splitting the target at its first / so part of the supposed provider becomes part of the model ID.

Evidence (verified 2026-10-24 on main c45147f)

File: packages/schema/src/model-alias.ts

  • Rule 2 (lines 153-157): provider = providerAlias with no validation, then line 176 rebuilds current = \${provider}/${model}``.
  • On the next loop iteration the rebuilt string is re-split at the first /, so a target of a/b turns provider a, model b/<original model>.

Reproduction (Bun probe importing packages/schema/src/model-alias.ts, main c45147f):

Aliases Input Result
{ providers: { x: "a/b" } } x/model returns { providerID: "a", id: "b/model", ref: "a/b/model" } — no error; the alias target's second segment became part of the model ID

A provider ID containing / can never be a real provider: the reference grammar is provider/model[#variant], split at the first / (parseRefString, lines 236-252), so a/b as a provider is unrepresentable in the very format the resolver outputs. A # in a provider alias target fares no better — it is reinterpreted as a variant separator on the next iteration.

Why it matters

A malformed providers alias entry in user config (a stray a/b pasted where a provider ID belongs) is silently reinterpreted as a different provider and a different model instead of an error at resolution time. The request then goes to a provider/model the user never named, or fails downstream as "model unavailable" with no hint the alias config was the cause.

Acceptance criteria

  • A provider alias target containing / or # (or empty) throws an invalid-reference error at resolution time, naming the offending reference — it never silently reshapes provider/model.
  • Valid provider alias chains still resolve (existing test 13's p1 -> p2 -> final-provider chain passes unchanged).
  • New tests in packages/core/test/model-alias.test.ts cover the /-containing provider-alias target; all existing model-alias tests still pass.
  • Dedup checked 2026-10-24: no open or closed issue tracks provider-alias target validation (fix(schema): ModelAlias alias path accepts invalid variants the no-alias parser rejects — empty variant dropped, second # kept #398 covered input/model-alias variant shapes; fix(schema): ModelAlias variant alias target is never validated — empty or #-containing target yields a malformed ref #406 covers variant-alias targets — a different map and code spot).

Single-repo: ModelAlias lives only in this repo's schema/core packages.

Activity

  1. dezren39
    closed this as completedin #410on Oct 25, 2026
  2. dezren39
    added a commit that references this issue on Oct 25, 2026

    docs: record the #408, #406/#407 and #411 completions in ROADMAP Done (…

    8c26ef5
  3. developing-today-fleet commented on Nov 24, 2026

    @developing-today-fleet
    developing-today-fleetBot
    on Nov 24, 2026 – with developing.today fleet
    More actions

    AUDIT-7 Lane 2 slice 3 — closing evidence. Verified against the issue body and merged implementation PR(s):

    • PR #410 — fix(schema): validate provider and variant alias targets (merged 2026-10-25)

    The issue had zero comments in the fresh pre-action read; this comment records the missing close evidence.

  4. dezren39
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    app/schemaPackage: schema (pkgs/ or apps/ in this repo)
    on Nov 25, 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

    app/schemaPackage: schema (pkgs/ or apps/ in this repo)kind/bugSomething isn't working (prefixed form of the classic bug label)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.