Commit Graph
1554 Commits
Author SHA1 Message Date
Kai (Tam Nhu) TranandGitHub 2c51a55db0 Merge pull request #395 from kaitranntt/kai/feat/codex-gemini-quota-display
feat(cliproxy): add multi-provider quota display for Codex and Gemini CLI
2026-01-29 15:05:24 -05:00
kaitranntt ad8327d17e test(cliproxy): add unit tests for quota fetchers and auth utilities
Add comprehensive unit tests for:
- buildCodexQuotaWindows(): window parsing, clamping, reset time calculation
- buildGeminiCliBuckets(): bucket grouping, model series, token types
- resolveGeminiCliProjectId(): project ID extraction from account field
- sanitizeEmail(): email to filename conversion
- isTokenExpired(): token expiry validation

Also removes unused 'preferred' field from GEMINI_CLI_GROUPS (YAGNI)

39 new tests covering edge cases:
- Percentage clamping (0-100, 0-1)
- Missing/null fields
- camelCase/snake_case API responses
- Empty inputs
- Invalid date strings

Addresses code review feedback on PR #395
2026-01-29 15:01:26 -05:00
kaitranntt 38ba6a9fea fix(cliproxy): resolve regex escape bug and complete DRY refactor
- Fix regex escape in auth-utils.ts: `\\.` not `\\\\.` (dot matcher)
- Refactor quota-fetcher.ts to import from auth-utils.ts (DRY)
- Remove unused UnifiedQuotaResult type (YAGNI)
- Add maintenance comment to Gemini model groups

Addresses code review feedback on PR #395
2026-01-29 14:55:07 -05:00
kaitranntt e31d00f0b9 refactor(cliproxy): extract shared auth utils and remove unused parameter
- Create auth-utils.ts with sanitizeEmail() and isTokenExpired()
- Remove duplicated functions from quota-fetcher-codex.ts
- Remove duplicated functions from quota-fetcher-gemini-cli.ts
- Remove unused _verbose parameter from displayAntigravityQuotaSection()
- Add descriptive comment to USER_AGENT constant

Addresses code review feedback on PR #395
2026-01-29 14:38:02 -05:00
kaitranntt 30e611fc28 feat(cliproxy): add multi-provider quota display for Codex and Gemini CLI
Add quota fetching for Codex (ChatGPT) and Gemini CLI providers with
unified CLI display. Extends `ccs cliproxy quota` with --provider flag.

New files:
- quota-types.ts: Shared type definitions for multi-provider quota
- quota-fetcher-codex.ts: Fetches from ChatGPT backend API
- quota-fetcher-gemini-cli.ts: Fetches from Google Cloud Code API

Features:
- Parallel quota fetching from all providers
- --provider flag to filter (agy|codex|gemini|all)
- Rate limit windows for Codex (primary/secondary/code review)
- Bucket grouping for Gemini CLI (Flash/Pro series)
- Reset time display with proper formatting

Edge case handling:
- 429 rate limit specific error messages
- Clamp percentages/fractions to valid ranges
- Null/negative reset time guards
- Empty --provider= value validation
2026-01-29 14:27:55 -05:00
github-actions[bot] 06154165f5 chore(release): 7.30.1-dev.1 [skip ci] 2026-01-29 18:35:28 +00:00
kaitranntt 643232f58e fix(config): add missing base-claude.settings.json
The claude provider was fully registered in the codebase (types,
OAuth config, auth port 54545, model catalog, CLI routes) but the
required base config file was missing, causing "Base config not
found for provider 'claude'" error when running `ccs claude --add`.
2026-01-29 13:33:37 -05:00
semantic-release-bot 2b1d000759 chore(release): 7.30.1 [skip ci]
## [7.30.1](https://github.com/kaitranntt/ccs/compare/v7.30.0...v7.30.1) (2026-01-29)

### Bug Fixes

* **cliproxy:** update Claude model catalog to latest CLIProxy models ([d238a5d](https://github.com/kaitranntt/ccs/commit/d238a5d43aa50e0629609349c6eb053170f2b586)), closes [#392](https://github.com/kaitranntt/ccs/issues/392)
* **copilot:** update fallback model ID to match catalog default ([2501843](https://github.com/kaitranntt/ccs/commit/25018431a50fae1a45121b28a0d16fa1731deace))
2026-01-29 06:34:31 +00:00
Kai (Tam Nhu) TranandGitHub 22d25c7715 Merge pull request #394 from kaitranntt/dev
fix: update Claude model catalog and copilot fallback
2026-01-29 01:33:23 -05:00
github-actions[bot] 91a990f024 chore(release): 7.30.0-dev.1 [skip ci] 2026-01-29 05:49:58 +00:00
Kai (Tam Nhu) TranandGitHub d912f89cb9 Merge pull request #393 from kaitranntt/fix/outdated-claude-model-catalog
fix(cliproxy): update Claude model catalog to latest CLIProxy models
2026-01-29 00:48:55 -05:00
kaitranntt 25018431a5 fix(copilot): update fallback model ID to match catalog default
Address code review feedback: update outdated fallback model ID
in copilot config form to use claude-sonnet-4-5-20250929
2026-01-29 00:45:49 -05:00
kaitranntt d238a5d43a fix(cliproxy): update Claude model catalog to latest CLIProxy models
- Updated claude-opus-4-5-20250220 → claude-opus-4-5-20251101
- Updated claude-sonnet-4-5-20250514 → claude-sonnet-4-5-20250929
- Updated claude-haiku-4-5-20250514 → claude-haiku-4-5-20251001
- Updated default model to claude-sonnet-4-5-20250929
- Updated all preset mappings to use new model IDs

Closes #392
2026-01-29 00:37:31 -05:00
semantic-release-bot a46ac1115e chore(release): 7.30.0 [skip ci]
## [7.30.0](https://github.com/kaitranntt/ccs/compare/v7.29.0...v7.30.0) (2026-01-28)

### Features

* **cliproxy:** add auto_sync config option ([fc23afd](https://github.com/kaitranntt/ccs/commit/fc23afdfc78a955fc0a1ce7f55d2e2bd098fc6c4))
* **cliproxy:** add granular account tier prioritization (ultra/pro/free) ([aeb9abc](https://github.com/kaitranntt/ccs/commit/aeb9abc998a5114007e34c478cf5c79213ea1fe7)), closes [#387](https://github.com/kaitranntt/ccs/issues/387)
* **cliproxy:** add local config sync module ([9de2682](https://github.com/kaitranntt/ccs/commit/9de26820629f5e95a487028a64c1a8a782674448))
* **cliproxy:** add Management API client for CLIProxy ([4cc89ea](https://github.com/kaitranntt/ccs/commit/4cc89eaf8745d67548f032408cd284fd23c3bd5e))
* **cliproxy:** add sync and alias CLI commands ([cb6c212](https://github.com/kaitranntt/ccs/commit/cb6c21216dcaf0536530f110af75dc20ee7c7738))
* **cliproxy:** add sync API routes ([56500fe](https://github.com/kaitranntt/ccs/commit/56500fee98042fb333bd723818d2a3881cd28481))
* **cliproxy:** auto-sync on profile create ([b2ba402](https://github.com/kaitranntt/ccs/commit/b2ba402d0fb4204457ae1f09016cb21bd9b5a6e2))
* **cliproxy:** enable auto_sync by default ([28b0e89](https://github.com/kaitranntt/ccs/commit/28b0e89b34787f42d63e2dd1a036b75a761bcf6b))
* **ui:** add CLIProxy sync components ([75a4e68](https://github.com/kaitranntt/ccs/commit/75a4e68f95ba5f8c7c8b647b8d5cf0d013dc425a))
* **ui:** add granular account tier types (pro/ultra/free) ([890fd14](https://github.com/kaitranntt/ccs/commit/890fd140f2ede728f212ed0bfc77bc8609b3a09b))
* **ui:** add tier badges to account cards ([31a91f6](https://github.com/kaitranntt/ccs/commit/31a91f609fad4af17f0e4bd3b0f0dbabe8bf2b77))
* **ui:** add toast feedback for sync actions ([f972a4e](https://github.com/kaitranntt/ccs/commit/f972a4ee80ebdec7b0a645d29eba4d65ca847caf))
* **ui:** allow custom model names in Quick Setup wizard ([ab9bbed](https://github.com/kaitranntt/ccs/commit/ab9bbedfa92555d0502b064145c0cfd5bf24065c))
* **ui:** mount SyncStatusCard to CLIProxy page ([afa3bda](https://github.com/kaitranntt/ccs/commit/afa3bdafceb1829e0fef2994bcb51c731797657f))

### Bug Fixes

* **cliproxy:** address edge cases in sync module ([9924b2f](https://github.com/kaitranntt/ccs/commit/9924b2fb25650803c34d26eae151c53a007fa0bb))
* **cliproxy:** address PR review feedback ([4967693](https://github.com/kaitranntt/ccs/commit/496769383979fb0b08bb03a57acd4ad2c10221c6))
* **cliproxy:** address sync review feedback ([e80d2d2](https://github.com/kaitranntt/ccs/commit/e80d2d2d05c00522cdaac03e6f55ecf10a938fc7))
* **cliproxy:** correct sync terminology and add unit tests ([c3f85bc](https://github.com/kaitranntt/ccs/commit/c3f85bc4a8c1351b09d463bd1687e17fa8a989d5))
* **cliproxy:** harden sync against edge cases ([bbad73b](https://github.com/kaitranntt/ccs/commit/bbad73b55450d04902b90a4fc4c006a8c7a3c5c1))
* **cliproxy:** improve sync robustness and consistency ([4124780](https://github.com/kaitranntt/ccs/commit/4124780ce07201f166971216fd48e5b072ec9dd5))
* **cliproxy:** preserve config comments during sync ([68a63a7](https://github.com/kaitranntt/ccs/commit/68a63a776812c7026a38f7dc7d5bb6996bc30190))
* **cliproxy:** use paidTier for account tier detection instead of allowedTiers ([de23029](https://github.com/kaitranntt/ccs/commit/de23029b572c9e1db1c8a004ec214ce5a465570a))
* **ui:** add scroll boundary for account list in Quick Setup ([85aa747](https://github.com/kaitranntt/ccs/commit/85aa747aebccbde21111730f6eb63e047ac0b91d))
* **ui:** fix account card layout overflow ([87cced8](https://github.com/kaitranntt/ccs/commit/87cced81952c168eaa4c6fd98059f089d765bcb3))
* **ui:** update sync card for local sync design ([e2b9c46](https://github.com/kaitranntt/ccs/commit/e2b9c465e4485c13086b82d282d9c67ae640dc77))

### Code Refactoring

* **cliproxy:** remove model alias functionality ([32dbd5e](https://github.com/kaitranntt/ccs/commit/32dbd5e174338d7627637667c63162ea4b9ffe7f))
* **ui:** merge sync into ProxyStatusWidget ([3761634](https://github.com/kaitranntt/ccs/commit/37616348f8e0edf934e68854faf6c783d4ff7aca))

### Tests

* **cliproxy:** add management-api-client unit tests ([6611142](https://github.com/kaitranntt/ccs/commit/6611142dcc60180dbaa4b987c3fb801ce753ffb1))
2026-01-28 22:01:02 +00:00
Kai (Tam Nhu) TranandGitHub 8a81e4ce15 Merge pull request #391 from kaitranntt/dev
feat(release): v7.29.0 - account tier prioritization & local sync
2026-01-28 16:59:56 -05:00
github-actions[bot] 2c649275d6 chore(release): 7.29.0-dev.2 [skip ci] 2026-01-28 21:54:57 +00:00
Kai (Tam Nhu) TranandGitHub c70014a5ba Merge pull request #390 from kaitranntt/feat/account-tier-prioritization
feat(cliproxy): account tier prioritization (ultra/pro/free)
2026-01-28 16:53:56 -05:00
kaitranntt 4967693839 fix(cliproxy): address PR review feedback
- align tier fallback to 'unknown' instead of 'pro' in quota-manager

- update stale comment referencing old allowedTiers approach
2026-01-28 16:41:27 -05:00
kaitranntt 31a91f609f feat(ui): add tier badges to account cards
- flow-viz: inline tier badge (ULTRA/PRO) with violet/yellow colors

- provider-editor: tier badge on avatar corner (U/P)

- subtle design with low opacity backgrounds
2026-01-28 16:31:16 -05:00
kaitranntt 890fd140f2 feat(ui): add granular account tier types (pro/ultra/free)
- update AccountTier from binary to granular

- add tier field to AccountRow and AccountData types

- pass tier through hooks data flow
2026-01-28 16:30:41 -05:00
kaitranntt de23029b57 fix(cliproxy): use paidTier for account tier detection instead of allowedTiers
- paidTier.id contains actual subscription: g1-ultra-tier or g1-pro-tier

- allowedTiers[isDefault] returns standard-tier for all accounts (not useful)

- mapTierString now correctly parses g1-ultra-tier and g1-pro-tier formats
2026-01-28 15:17:23 -05:00
kaitranntt 87cced8195 fix(ui): fix account card layout overflow
- add min-w-0 flex-1 to left content container for proper shrinking

- add gap-2 between content and dropdown menu

- add shrink-0 to dropdown button to prevent overflow
2026-01-28 15:11:17 -05:00
kaitranntt aeb9abc998 feat(cliproxy): add granular account tier prioritization (ultra/pro/free)
- change AccountTier from binary (free/paid) to granular (ultra/pro/free/unknown)

- update mapTierString() to parse API tier strings correctly

- remove faulty inferTierFromModels() fallback - tier comes only from API

- update default tier_priority config to ['ultra', 'pro', 'free']

- update model catalog tier types and display logic

Closes #387
2026-01-28 15:11:00 -05:00
github-actions[bot] e01a622c97 chore(release): 7.29.0-dev.1 [skip ci] 2026-01-28 19:30:53 +00:00
Kai (Tam Nhu) TranandGitHub 9ca73b93a3 Merge pull request #389 from kaitranntt/kai/feat/cliproxy-local-sync
feat(cliproxy): add local config sync with auto-sync watcher
2026-01-28 14:29:51 -05:00
kaitranntt 6611142dcc test(cliproxy): add management-api-client unit tests
- Add 31 unit tests for fetchLocalSyncStatus, fetchProfiles, and performLocalSync
- Cover success, error, timeout, and network failure scenarios
- Remove unused --force flag from sync handler (YAGNI)
2026-01-28 14:12:42 -05:00
kaitranntt bbad73b554 fix(cliproxy): harden sync against edge cases
Backend:
- Handle config file deletion race condition with try-catch
- Add null check for empty config files in yaml.load()
- Limit profile names to 64 chars, require alphanumeric content
- Add 5s timeout for watcher close() to prevent hangs

Frontend:
- Add 30s fetch timeout with AbortController for sync requests
2026-01-28 13:58:16 -05:00
kaitranntt 4124780ce0 fix(cliproxy): improve sync robustness and consistency
- Add timeout warning in restartAutoSyncWatcher when sync exceeds 10s
- Improve YAML key detection with regex pattern for safer parsing
- Replace --force help with --verbose (no confirmation prompt exists)
- Add force flag parsing for future use
2026-01-28 13:49:46 -05:00
kaitranntt e80d2d2d05 fix(cliproxy): address sync review feedback
- Fix auto_sync JSDoc to say (default: true) matching actual default
- Add unlink event handler for profile deletion sync
- Add debug logging for sync failures in api-command
2026-01-28 13:44:00 -05:00
kaitranntt c3f85bc4a8 fix(cliproxy): correct sync terminology and add unit tests
- Fix "Remote" → "Local" in sync-dialog.tsx and CLI help text
- Add resetWatcherState() export for test cleanup
- Add unit tests for profile-mapper, local-config-sync, auto-sync-watcher
- Remove unused ModelAlias and AliasesResponse types from hooks
2026-01-28 13:26:40 -05:00
kaitranntt ab9bbedfa9 feat(ui): allow custom model names in Quick Setup wizard
- Add "Custom model name..." option to model dropdown
- Show text input when custom selected
- Allow any CLIProxy-supported model name
- Toggle back to presets with link
2026-01-28 11:57:22 -05:00
kaitranntt 85aa747aeb fix(ui): add scroll boundary for account list in Quick Setup
- Add max-h-[320px] and overflow-y-auto to account grid
- Prevents overflow when many accounts exist
2026-01-28 11:57:22 -05:00
kaitranntt f972a4ee80 feat(ui): add toast feedback for sync actions
- Show success toast with synced profile count
- Show info toast when no profiles to sync
- Show error toast on sync failure
2026-01-28 11:57:22 -05:00
kaitranntt 68a63a7768 fix(cliproxy): preserve config comments during sync
- Use section-based replacement instead of full yaml.dump()
- Only update claude-api-key section, keep rest of file intact
- Preserves comments, formatting, and key ordering
2026-01-28 11:57:22 -05:00
kaitranntt 37616348f8 refactor(ui): merge sync into ProxyStatusWidget
- add sync icon button to widget header

- show inline sync status (Ready/No Config)

- remove separate SyncStatusCard from cliproxy page

- reduces vertical space, better UX
2026-01-28 11:57:22 -05:00
kaitranntt 32dbd5e174 refactor(cliproxy): remove model alias functionality
- delete model-alias-config.ts and cliproxy-alias-handler.ts

- simplify sync to use ANTHROPIC_MODEL directly

- remove alias routes, hooks, and UI components
2026-01-28 11:57:22 -05:00
kaitranntt afa3bdafce feat(ui): mount SyncStatusCard to CLIProxy page 2026-01-28 11:57:22 -05:00
kaitranntt e2b9c465e4 fix(ui): update sync card for local sync design
- rename Remote Sync to Profile Sync

- change status from Connected/Disconnected to Ready/No Config

- update icons and messaging for local config sync
2026-01-28 11:57:22 -05:00
kaitranntt b2ba402d0f feat(cliproxy): auto-sync on profile create 2026-01-28 11:57:22 -05:00
kaitranntt 28b0e89b34 feat(cliproxy): enable auto_sync by default 2026-01-28 11:57:22 -05:00
kaitranntt 9924b2fb25 fix(cliproxy): address edge cases in sync module
- Reset isSyncing flag in stopAutoSyncWatcher (prevents stale state)
- Validate empty profile names in mapProfileToClaudeKey
- Add whitespace validation in API routes (POST/DELETE /aliases)
- Add Number.isInteger check for port validation
- Wrap response.json() in try-catch for React hooks (handles non-JSON 502)
2026-01-28 11:57:22 -05:00
kaitranntt 75a4e68f95 feat(ui): add CLIProxy sync components
- add SyncStatusCard for sync status display
- add SyncDialog for sync preview and execution
- add useCliproxySync hook for API integration
2026-01-28 11:57:22 -05:00
kaitranntt fc23afdfc7 feat(cliproxy): add auto_sync config option
- export sync module from cliproxy barrel
- add auto_sync field to CLIProxyConfig interface
2026-01-28 11:57:22 -05:00
kaitranntt 56500fee98 feat(cliproxy): add sync API routes
- add /api/cliproxy/sync endpoints for local sync
- add /api/cliproxy/sync/aliases for model alias management
- add /api/cliproxy/sync/auto-sync for watcher toggle
- separate try-catch for config save vs watcher restart
2026-01-28 11:57:22 -05:00
kaitranntt cb6c21216d feat(cliproxy): add sync and alias CLI commands
- add `ccs cliproxy sync` command for manual sync
- add `ccs cliproxy alias` command for model alias management
- support --dry-run and --verbose flags
- integrate with cliproxy subcommand router
2026-01-28 11:57:22 -05:00
kaitranntt 9de2682062 feat(cliproxy): add local config sync module
- add profile mapper to transform CCS profiles to ClaudeKey format
- add model alias configuration with defaults for glm/kimi/qwen
- add local config sync to write claude-api-key section
- add auto-sync watcher with debouncing for profile changes
- include null config handling and temp file cleanup
2026-01-28 11:57:22 -05:00
kaitranntt 4cc89eaf87 feat(cliproxy): add Management API client for CLIProxy
- add types for ClaudeKey, ClaudeModel, HealthStatus
- add HTTP client for Management API endpoints
- support GET/PUT/PATCH/DELETE operations
2026-01-28 11:57:22 -05:00
semantic-release-bot ae11603de7 chore(release): 7.29.0 [skip ci]
## [7.29.0](https://github.com/kaitranntt/ccs/compare/v7.28.2...v7.29.0) (2026-01-28)

### Features

* **cliproxy:** add Claude (Anthropic) OAuth provider support ([28d8bd8](https://github.com/kaitranntt/ccs/commit/28d8bd84a5ac912b79416aeced95f74fd71876bb)), closes [#380](https://github.com/kaitranntt/ccs/issues/380)
* skip local OAuth when using remote proxy with auth token ([1f5d119](https://github.com/kaitranntt/ccs/commit/1f5d11930ee19c0f00b46d7994ea99c7be8e55c6))

### Bug Fixes

* add claude provider to statsProviderMap, UI types, and provider arrays ([4a2abc7](https://github.com/kaitranntt/ccs/commit/4a2abc74cac93e17ee12fab3fcf8fc0693552347))
* **cliproxy:** add Claude to all provider lists for sidebar display ([d212995](https://github.com/kaitranntt/ccs/commit/d2129957d7e954701be973725545f475711d0468))
* **cliproxy:** address PR review feedback ([2091a90](https://github.com/kaitranntt/ccs/commit/2091a90b7710e7cb0b565577a5e659473126a541)), closes [#D97757](https://github.com/kaitranntt/ccs/issues/D97757)
* **cliproxy:** improve skip-local-auth edge case handling ([21e819b](https://github.com/kaitranntt/ccs/commit/21e819b59062b77c2686ecc5f24e9c3436e42f84))
* **cliproxy:** use correct --claude-login flag for Claude OAuth ([8017ce8](https://github.com/kaitranntt/ccs/commit/8017ce8f8639ffc282203d6809091df83e0c8f18)), closes [#382](https://github.com/kaitranntt/ccs/issues/382)
* replace hardcoded provider validation arrays with CLIPROXY_PROFILES import ([9cd9c42](https://github.com/kaitranntt/ccs/commit/9cd9c423e929579c86da3f409d74927c3c7dedc1)), closes [#382](https://github.com/kaitranntt/ccs/issues/382)
* **test:** use correct provider name 'ghcp' instead of 'copilot' ([838cd1d](https://github.com/kaitranntt/ccs/commit/838cd1d460de68acb571bb44bc12f91bd0636ff7))
* **ui:** add iFlow to PROVIDER_ASSETS + sync validation test ([5c62e06](https://github.com/kaitranntt/ccs/commit/5c62e06d0236b5080ccfb3ca2ff55407cbb414e1)), closes [#384](https://github.com/kaitranntt/ccs/issues/384)
* **ui:** truncate long account emails in provider editor ([a9c5520](https://github.com/kaitranntt/ccs/commit/a9c5520b8b4b7d49d1afe0e63b4facab3142db1b))

### Code Refactoring

* **cliproxy:** reorder providers - Antigravity first, then Claude ([b385ab1](https://github.com/kaitranntt/ccs/commit/b385ab131d2b179c7b7bd014859f9118afd6ce5c))
* **cliproxy:** use CLIPROXY_PROFILES for provider arrays (DRY) ([9fd9395](https://github.com/kaitranntt/ccs/commit/9fd93955880fd1b90d15f45d9738d413d04769ca)), closes [#384](https://github.com/kaitranntt/ccs/issues/384)
* **oauth:** derive auth-code providers from OAUTH_FLOW_TYPES (DRY) ([c713d48](https://github.com/kaitranntt/ccs/commit/c713d48d08af5044cb0fab4505365fd98e31b9d6)), closes [#384](https://github.com/kaitranntt/ccs/issues/384)
* **ui:** centralize provider list in provider-config.ts (DRY) ([5a4c8e0](https://github.com/kaitranntt/ccs/commit/5a4c8e009ce1cc355d6fa2f05001cab6c9b684c4))
2026-01-28 03:28:46 +00:00
Kai (Tam Nhu) TranandGitHub 110e82756c Merge pull request #384 from kaitranntt/dev
feat(cliproxy): Claude OAuth provider + skip-local-auth improvements
2026-01-27 22:27:46 -05:00
github-actions[bot] 6e560b78c4 chore(release): 7.28.2-dev.5 [skip ci] 2026-01-28 03:26:46 +00:00