You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: models-dev user agent is evaluated at module load, leaking host OPENCODE_CLIENT into requests #47512
The models-dev catalog fetcher builds its User-Agent once at module load. Hosts that set OPENCODE_CLIENT before importing (desktop sets it to "desktop") silently send the wrong client identifier on every models.dev request, and the test suite asserting the "/cli" suffix fails on those hosts.
Steps to reproduce
OPENCODE_CLIENT=desktop bun test packages/core/test/models.test.ts
The user-agent assertion fails with "opencode/local/local/desktop" instead of "/cli"
Fix incoming in PR #47510 (lazy per-request evaluation + regression test); filing per the Issue First policy so the drive-by fix is referenceable.
In v2, the models.dev catalog request builds its User-Agent from app metadata passed in when the server starts, and packages/core no longer reads OPENCODE_CLIENT itself. Running the core models test with OPENCODE_CLIENT=desktop set therefore no longer changes the User-Agent it checks.
Activity
neriousy commentedon Oct 19, 2026
In v2, the models.dev catalog request builds its User-Agent from app metadata passed in when the server starts, and
packages/coreno longer readsOPENCODE_CLIENTitself. Running the core models test withOPENCODE_CLIENT=desktopset therefore no longer changes the User-Agent it checks.