anomalyco / anomalyco/opencode

fix: models-dev user agent is evaluated at module load, leaking host OPENCODE_CLIENT into requests

Open
#47,512 0 comments 0 reactions 1 assignee View on GitHub

@nexxeln is already working on this.

Since Sep 5, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Description

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
  1. OPENCODE_CLIENT=desktop bun test packages/core/test/models.test.ts
  2. 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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.