Skip to content

v1.1.0

Choose a tag to compare

@okhsunrog okhsunrog released this 08 Apr 10:55
· 38 commits to main since this release

What's Changed

OAuth & Claude Code mimicry

  • Fix token refresh race condition — concurrent requests could trigger simultaneous refreshes, causing Anthropic's token rotation to invalidate the others and log the user out. Fixed with a per-process mutex and double-check pattern.
  • Correct User-Agent headers — inference requests now send claude-cli/2.1.92 (external, cli), admin/usage API calls send claude-code/2.1.92, matching Claude Code's two distinct functions.
  • Add X-Claude-Code-Session-Id header — stable UUID generated at startup, sent on every inference request.
  • Fix OAuth scopes — authorize now requests the full scope set including user:mcp_servers and user:file_upload; refresh explicitly sends CLAUDE_AI_OAUTH_SCOPES (without org:create_api_key), verified from the 2.1.92 binary.
  • Fix anthropic-beta header — adds context-management-2025-06-27, removes fine-grained-tool-streaming and adaptive-thinking (not base betas per binary analysis).
  • Fix usage/profile API headers — send only oauth-2025-04-20, not the full inference beta list.
  • Add 401 retry with force token refresh — on server-side token revocation, the proxy force-refreshes and retries once automatically.

Subscription usage caching & resilience

  • Cache usage API responses/oauth/usage caches for 5 minutes, invalidated when the 5-hour window resets. Prevents hitting Anthropic's rate-limited endpoint on every admin UI open.
  • Update window state from inference headers — every successful inference response updates 5h/7d utilization from anthropic-ratelimit-unified-* headers, so the admin UI stays accurate without dedicated polling.
  • Graceful 429 fallback — returns stale cache on rate limit; reconstructs from window state if cache is empty.

User-facing usage dashboard

  • New /admin/usage page — no admin session required, users authenticate with their sk-proxy-* key to view their own usage.
  • Cost/token charts over time, per-model breakdown, current 5h/7d/total window counts, period selector (24h / 7d / 30d).

Admin UI improvements

  • Replace vue-chrts with Chart.js — gzipped JS bundle reduced from ~772 KB to ~216 KB.
  • Upgrade Vite v7 → v8 (Rolldown bundler) with interactive chart legend filtering.
  • Migrate to Vite+ unified toolchain (vp CLI) — replaces ESLint, Prettier, Oxlint. CI now uses vp check.

Other

  • Extend admin session TTL to 30 days with sliding expiration (renewed per request, throttled to once/day).
  • Replace Swagger UI with --openapi CLI flag — dump spec without config or DB (cargo run -- --openapi).
  • Increase request body limit to 100 MB — supports file attachments.
  • Split monolithic admin.rs into per-feature modules.
  • Fix rand 0.10 API changes (RngRngExt), add 15 streaming transform tests.
  • Turso bump from 0.5.0-pre.14 to 0.6.0-pre.15.