anomalyco / anomalyco/opencode
fix: models-dev user agent is evaluated at module load, leaking host OPENCODE_CLIENT into requests
Open
@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
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.