Skip to content

feat: auto-sync version from npm registry#7

Open
0x7551 wants to merge 1 commit intomotiful:mainfrom
0x7551:feat/version-sync
Open

feat: auto-sync version from npm registry#7
0x7551 wants to merge 1 commit intomotiful:mainfrom
0x7551:feat/version-sync

Conversation

@0x7551
Copy link
Copy Markdown

@0x7551 0x7551 commented Apr 1, 2026

Summary

  • Fetch latest @anthropic-ai/claude-code version from npm on startup
  • Auto-refresh every hour via setInterval
  • Replace hardcoded 2.1.81 in billing header with dynamic config.env.version

Changes

  • src/version.ts: new module — fetches npm registry, updates config.env
  • src/index.ts: call initVersion(config) on startup
  • src/proxy.ts: billing header uses config.env.version instead of hardcoded string
  • src/config.ts: add upstream.proxy? field (used by version fetcher)

Test plan

  • Start gateway — verify version is fetched and logged
  • Check /_verify endpoint — billing header shows current npm version
  • Disconnect network — verify graceful fallback to config default

🤖 Generated with Claude Code

Fetch the latest @anthropic-ai/claude-code version from npm on startup
and refresh hourly, so the billing header always reports the current
release version instead of a hardcoded value.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant