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 empty scoped model alias target is silently ignored instead of erroring · Issue #411 · developing-today-forks/opencode

fix(schema): ModelAlias empty scoped model alias target is silently ignored instead of erroring #411

New issue
Copy link
New issue
Copy link
Closed
#413
Closed
fix(schema): ModelAlias empty scoped model alias target is silently ignored instead of erroring#411
#413
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

Summary

In ModelAlias.resolveRef (packages/schema/src/model-alias.ts), a scoped model alias whose target is the empty string is silently ignored: resolution proceeds exactly as if the alias did not exist, so a mistyped/emptied config entry silently does nothing instead of erroring like every other invalid alias target.

Evidence (verified on main d0ba1110fb, the #410 merge)

The two scoped-model lookups guard on truthiness, so an empty-string target never reaches any validation:

  • packages/schema/src/model-alias.ts — orig-provider scoped lookup: const origScopedAlias = aliases.models?.[origScopedKey]; if (origScopedAlias) { … }
  • packages/schema/src/model-alias.ts — resolved-provider scoped lookup: const scopedAlias = aliases.models?.[scopedKey]; if (scopedAlias) { … }

Probe (bun, importing packages/schema/src/model-alias.ts directly):

resolve({ models: { "openai/pro": "" } }, "openai/pro")
  => "openai/pro"            // alias silently dropped, input returned unchanged

resolve({ providers: { ds: "deepseek" }, models: { "ds/pro": "" } }, "ds/pro")
  => "deepseek/pro"          // provider alias applied, empty model alias silently dropped

Contrast with the sibling alias kinds, which were fixed to validate with an explicit undefined check:

  • Provider aliases use if (providerAlias !== undefined && …) and throw Invalid model reference for an empty target (fix(schema): ModelAlias provider alias target containing / silently reshapes the ref instead of erroring #407/fix(schema): validate provider and variant alias targets #410).
  • Variant alias targets that are empty throw (fix(schema): ModelAlias variant alias target is never validated — empty or #-containing target yields a malformed ref #406/fix(schema): validate provider and variant alias targets #410).
  • Even a global model alias with an empty target throws (indirectly, when the settled ref has no /), though its message names the input rather than the target.

Only the scoped model path swallows the empty target completely.

Why it matters

Alias config is user-authored. An entry like "openai/pro": "" (emptied while editing, a templating mistake, a generated config bug) currently fails silently: the model the user believes is remapped is not, and there is no error anywhere to chase. Every neighbouring alias kind treats the same mistake as an Invalid model reference error.

Acceptance criteria

  • resolve (and resolveRef) throws Invalid model reference: <input> when a scoped model alias that matches the input has an empty-string target — for both scoped lookups (original provider name and provider-alias-resolved name).
  • Existing behaviour for non-empty scoped targets is unchanged (packages/core/test/model-alias.test.ts tests 4, 5 and 13 still pass).
  • New tests in packages/core/test/model-alias.test.ts cover the empty scoped target under both the original and the resolved provider name.
  • Related nicety (optional): the global empty-target error message could name the alias target rather than only the input.

Single-repo: the ModelAlias resolver lives only in developing-today/opencode (packages/schema/src/model-alias.ts).

Activity

  1. dezren39
    closed this as completedin #413on 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 #413 — fix(schema): reject empty model 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.