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 alias path accepts invalid variants the no-alias parser rejects — empty variant dropped, second # kept · Issue #398 · developing-today-forks/opencode

fix(schema): ModelAlias alias path accepts invalid variants the no-alias parser rejects — empty variant dropped, second # kept #398

New issue
Copy link
New issue
Copy link
Closed
#403
Closed
fix(schema): ModelAlias alias path accepts invalid variants the no-alias parser rejects — empty variant dropped, second # kept#398
#403
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 24, 2026
Issue body actions

Problem

ModelAlias.resolve / resolveRef validates a model reference differently depending on whether any aliases are configured. With no aliases it uses parseRefString, which rejects an empty variant and a variant containing a second #. With aliases present it takes the loop path in resolveRef, which accepts both — silently dropping an empty variant and keeping a # inside the variant verbatim.

Evidence (verified 2026-10-24 on main 58dd3fb)

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

  • No-alias path delegates to parseRefString (line 53), whose check at line 233 throws when variant is empty or contains #.
  • Alias path (lines 57-169) records explicitVariant from the first # (lines 72-73) with no equivalent validation, and builds the final ref from it at line 169 onward.

Reproduction (Bun, importing packages/core/src/model-alias.ts, aliases = { models: { flash: "openai/gpt-4o" }, variants: { high: "xhigh" } }):

Input No aliases With aliases
openai/gpt-4o# THROWS Invalid model reference: openai/gpt-4o# returns "openai/gpt-4o" (empty variant silently dropped)
openai/gpt-4o#high#extra THROWS Invalid model reference: openai/gpt-4o#high#extra returns "openai/gpt-4o#high#extra" (second # kept in the variant)

Why it matters

The same malformed reference is an error for one user and silently accepted for another, purely because the second user configured an unrelated alias. The double-# form produces a ResolvedRef.variant of high#extra and a canonical ref no other parser in the repo accepts, so it will fail later — further from the cause — or be passed to a provider as a variant name that can never match. The empty-variant form hides a typo (model# for model#high).

Acceptance criteria

  • With aliases configured, openai/gpt-4o# throws the same invalid-reference error as the no-alias path.
  • With aliases configured, openai/gpt-4o#high#extra throws the same invalid-reference error as the no-alias path.
  • Validation also covers a variant that arrives via an alias target (e.g. a model alias expanding to provider/model# or provider/model#a#b), not only a variant typed in the original input.
  • New tests in packages/core/test/model-alias.test.ts cover both shapes on the alias path; all existing model-alias tests still pass.
  • Dedup checked 2026-10-24: no open or closed issue tracks this validation parity gap (fix(core): bare-alias variant is preserved by the session runner (PR #390) but dropped by ModelResolver (PR #382) #391 is about a bare-alias variant being dropped by ModelResolver, a different code path).

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

Activity

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

    docs: record the #397, #389 and #398/#399 completions in ROADMAP Done (…

    c45147f
  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 #403 — fix(schema): validate variants on the alias path and settle chains at the depth limit (merged 2026-10-24)

    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.