Commit Graph
1377 Commits
Author SHA1 Message Date
Tam Nhu Tran 5013d411a7 feat(cliproxy): self-pause exhausted quota accounts 2026-04-28 20:35:15 -04:00
Tam Nhu Tran 30f350a74f fix(usage): preserve pricing overrides and legacy merges 2026-04-28 16:51:06 -04:00
Tam Nhu Tran 42fc5281a1 fix(usage): clarify static pricing fallback 2026-04-28 16:26:27 -04:00
Tam Nhu Tran c7141b3d3a fix(usage): honor provider-aware pricing precedence 2026-04-28 16:11:07 -04:00
Tam Nhu Tran f736190196 fix(usage): avoid cross-provider pricing fallback 2026-04-28 15:55:35 -04:00
Tam Nhu Tran fc90b6f473 fix(usage): normalize provider aliases in aggregation 2026-04-28 15:43:13 -04:00
Tam Nhu Tran a538627933 fix(usage): harden models.dev analytics integration 2026-04-28 15:25:58 -04:00
Tam Nhu Tran a38c1a75ba feat: integrate models.dev pricing metadata 2026-04-28 14:50:26 -04:00
Tam Nhu Tran 73c82b3567 Merge remote-tracking branch 'origin/dev' into kai/fix/1118-ai-provider-model-rules 2026-04-28 14:27:53 -04:00
Tam Nhu Tran 9a28ca55d8 fix(cliproxy): tolerate plain AI provider model rules 2026-04-28 14:19:21 -04:00
Tam Nhu Tran aa7f155161 test(cliproxy): stabilize routing endpoint coverage 2026-04-28 14:07:15 -04:00
Tam Nhu Tran 8ef703024b fix(cliproxy): probe routing via management endpoint 2026-04-28 14:02:58 -04:00
Kai (Tam Nhu) TranandGitHub b6432f783e Merge pull request #1114 from yousiki/fix/claude-utilization-percent-unit
fix(cliproxy): use explicit utilization unit per Claude payload form
2026-04-28 13:41:31 -04:00
Kai (Tam Nhu) TranandGitHub a8e0d95bc8 Merge pull request #1117 from kaitranntt/kai/feat/1115-session-affinity
feat: add local CLIProxy session affinity controls
2026-04-28 13:37:37 -04:00
Tam Nhu Tran 5267c421ca fix(cliproxy): harden session affinity behavior 2026-04-28 13:27:05 -04:00
Kai (Tam Nhu) TranandGitHub f328cff870 Merge pull request #1113 from yousiki/fix/codex-additional-rate-limits
fix(cliproxy): parse Codex additional_rate_limits for Spark quota
2026-04-28 13:04:16 -04:00
Kai (Tam Nhu) TranandGitHub b0331e3b70 Merge pull request #1112 from fatjester/fix-azure-openai-proxy
fix(proxy): avoid settings override and nested reasoning for openai-compat
2026-04-28 12:41:17 -04:00
Tam Nhu Tran 148cf35560 fix(cliproxy): polish session affinity controls 2026-04-28 12:38:30 -04:00
Tam Nhu Tran c277955762 fix(cliproxy): tighten session affinity review issues 2026-04-28 12:33:12 -04:00
Tam Nhu Tran 20f3916d55 fix(cliproxy): tighten session affinity status handling 2026-04-28 12:26:42 -04:00
Tam Nhu Tran 4309db89c3 feat(cliproxy): add local session affinity controls 2026-04-28 12:17:26 -04:00
Tam Nhu Tran 328d53e383 style(proxy): format openai bridge launch settings 2026-04-28 12:10:06 -04:00
Tam Nhu Tran 47fbe8bb3a fix(proxy): clean up temp launch settings 2026-04-28 11:59:37 -04:00
Tam Nhu Tran 3dcf150978 fix(proxy): preserve settings-profile launches for openai bridge 2026-04-28 11:42:56 -04:00
Tam Nhu Tran 119aa3be98 fix: keep config dashboard alive when interface detection fails 2026-04-28 11:39:40 -04:00
Tam Nhu Tran b2e4be310d fix(ui): tighten analytics session and query contracts 2026-04-27 12:30:56 -04:00
yousiki a90aadd202 fix(cliproxy): tighten Codex window classification on incomplete metadata
Apply Copilot review feedback on PR #1113:
- getCodexWindowKind: require cadence alongside category; fall through
  to label sniffing when missing instead of silently defaulting to 5h.
- getCodexWindowDisplayLabel (CLI): for category 'additional', fall back
  through featureLabel -> window.label -> 'Additional' so partial cached
  windows preserve user-visible context.
2026-04-27 16:57:28 +09:00
2c82c81342 Update src/cliproxy/quota-fetcher-claude-normalizer.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-04-27 16:36:41 +09:00
yousiki 942a8ce12d fix(cliproxy): parse Codex additional_rate_limits for Spark quota
The Codex wham/usage API moved GPT-5.3 Codex Spark quota out of
code_review_rate_limit (now null) into a new additional_rate_limits[]
array. Parse the new field and surface it as Spark windows in the quota
view. Adds explicit category/cadence/featureLabel metadata on
CodexQuotaWindow so display logic does not depend on label sniffing.
The legacy label-sniffing path is preserved as a fallback so cached
windows from older versions still render correctly.
2026-04-27 15:07:44 +09:00
yousiki 9808ebfe36 fix(cliproxy): use explicit utilization unit per Claude payload form
Anthropic OAuth usage returns utilization as a percent (0-100) while the
older policy-limits restrictions payload returns a 0-1 ratio. The shared
heuristic "value <= 1 means ratio" misinterpreted percent values like
1.0, rendering 1% Sonnet usage as 100% used. Pass the unit explicitly
from each payload branch so the same boundary value is interpreted
correctly in either format.
2026-04-27 15:06:04 +09:00
Tam Nhu Tran e95b354297 fix(analytics): avoid bridge double counting in native collectors 2026-04-26 18:19:41 -04:00
Tam Nhu Tran fe7cc6f9ba fix(analytics): add native codex and droid collectors 2026-04-26 18:13:33 -04:00
Chris Weller 1c91c46326 fix(proxy): avoid settings override and nested reasoning for openai-compat 2026-04-26 14:53:25 -06:00
Tam Nhu Tran 01fcd77573 fix(cli-proxy): preserve historical analytics across syncs 2026-04-26 16:52:12 -04:00
Tam Nhu Tran 69b75c0449 fix(cli-proxy): durable analytics history persistence and dedupe migration 2026-04-26 16:44:39 -04:00
Tam Nhu Tran 286b5781a7 fix: address analytics review follow-ups 2026-04-26 15:31:32 -04:00
Tam Nhu Tran e2f1363708 fix(analytics): correct token accounting and usage aggregation
Align snapshot handling and UI contracts with the current analytics payloads.
2026-04-26 15:21:52 -04:00
Tam Nhu Tran cd941195d1 fix(codex): resolve ccsxp argv alias as codex 2026-04-26 13:19:58 -04:00
Tam Nhu Tran 82c92aa940 feat(codex): align ccsxp with native cliproxy shortcut 2026-04-26 11:09:54 -04:00
Kai (Tam Nhu) TranandGitHub db3becfbe0 Merge pull request #1104 from sgaluza/sgaluza/fix-test-mock-contamination
test(cliproxy): replace process-wide mock.module with DI seams
2026-04-26 10:17:45 -04:00
Sergey Galuza a7871283d4 test(cliproxy): replace process-wide mock.module with DI seams
Bun's `mock.module()` is process-wide and is NOT undone by `mock.restore()`.
Two test files used module-level mocks that leaked across test runs,
silently breaking unrelated suites that imported the mocked modules
transitively:

- tests/unit/cliproxy/version-checker-stale-cache.test.ts mocked
  binary/version-checker, contaminating cliproxy-stats-routes-install
  and cliproxy-stats-routes-model-update suites that import a route
  module which transitively imports version-checker.
- tests/unit/cliproxy/service-manager-startup.test.ts mocked 8 modules
  at top level (binary-manager, stats-fetcher, etc.), contaminating any
  later file that imports them.

CI happens to be green because file ordering on the GitHub runner places
victim files BEFORE contaminators in `bun test`. On Linux locally the
order is reversed, producing 6 reproducible test failures on every
`bun run test:fast` run. A change in OS, bun version, or new test files
that import the mocked modules could silently flip the CI runner's
order and surface these failures unexpectedly.

Replaced module-level mocks with explicit dependency-injection seams in
production code, following the existing pattern in version-checker.ts
and version-cache.ts (`fetchJsonFn?`, `fetchLatestVersionFn?`):

- src/cliproxy/types.ts: `BinaryManagerConfig.checkForUpdatesFn` (optional)
- src/cliproxy/binary/lifecycle.ts: route through new fn with default
- src/cliproxy/service-manager.ts: `ensureCliproxyService(deps?)` with
  optional `ensureBinaryFn`, `detectRunningProxyFn`,
  `configNeedsRegenerationFn`, `withStartupLockFn`

All deps fields are optional with real-implementation defaults, so
production callers are unchanged. Tests now inject deterministic stubs
through call-site parameters instead of module-level mocks.

Verified locally: \`bun run validate\` is now 2540 pass / 0 fail
(previously 2534 pass / 6 fail at the same upstream/main HEAD).

Built [OnSteroids](https://onsteroids.ai)
2026-04-26 09:43:09 +02:00
Kai (Tam Nhu) TranandGitHub 5dd5878bb4 Merge pull request #1086 from BlackJulySnow/main
feat: add extra models support for API profiles
2026-04-25 12:07:01 -04:00
Tam Nhu Tran b1a0d1a175 fix(cliproxy/sync): dedup ANTHROPIC_EXTRA_MODELS entries against primary model 2026-04-25 11:30:33 -04:00
Tam Nhu Tran a28d544abb docs(api): document --extra-models flag in ccs api --help 2026-04-25 11:30:22 -04:00
Tam Nhu Tran f01210fbf2 style: apply prettier formatting to extra-models changes 2026-04-25 11:30:11 -04:00
Tam Nhu Tran 8ffda0268d fix(codex): align ccsxp history with native codex 2026-04-24 15:24:12 -04:00
B1GGersnow 2915ab0c40 feat: add extra models support for API profiles
Add ANTHROPIC_EXTRA_MODELS env var to allow each API profile to
configure additional models alongside the primary ANTHROPIC_MODEL.
These are synced to CLIProxy config.yaml during ccs cliproxy sync.

- profile-mapper.ts: parse ANTHROPIC_EXTRA_MODELS on sync
- profile-writer.ts: write extra models to settings.json
- shared.ts + create-command.ts: --extra-models CLI flag
- profile-routes.ts + route-helpers.ts: REST API support
- profile-dialog.tsx + api-client.ts: frontend input
2026-04-25 03:20:29 +08:00
Tam Nhu Tran 4efd61ee34 feat: add gpt-5.5 to codex model catalogs 2026-04-24 10:30:59 -04:00
Tam Nhu Tran 7dd9aba810 chore: merge main hotfixes into dev 2026-04-23 23:49:18 -04:00
Tam Nhu Tran 7a9e67e6dc fix: route codex remote https through local proxy chain 2026-04-23 23:00:59 -04:00