Commit Graph
1068 Commits
Author SHA1 Message Date
github-actions[bot] 25d213ad64 chore(release): 7.12.1-dev.1 [skip ci] 2026-01-01 19:40:59 +00:00
Kai (Tam Nhu) TranandGitHub 05d2934589 Merge pull request #244 from kaitranntt/fix/discover-accounts-kiro-ghcp
fix(cliproxy): add kiro/ghcp provider mappings to discoverExistingAccounts
2026-01-01 11:40:00 -08:00
kaitranntt 43f1a9890e test(cliproxy): add unit tests for discoverExistingAccounts
- Test kiro/ghcp provider type mapping
- Test email extraction from filename fallback
- Test multiple accounts per provider
- Test edge cases (invalid JSON, missing type, unknown provider)
2026-01-01 13:34:25 -05:00
kaitranntt 4386e9122d fix(cliproxy): add kiro/ghcp provider mappings to discoverExistingAccounts
- Replace hardcoded typeToProvider with dynamic lookup from PROVIDER_TYPE_VALUES
- Add email extraction from filename as fallback for empty data.email
- Fixes issue where Kiro/GHCP accounts were skipped during discovery

Closes #242
2026-01-01 13:20:59 -05:00
semantic-release-bot 0f33b7e34d chore(release): 7.12.1 [skip ci]
## [7.12.1](https://github.com/kaitranntt/ccs/compare/v7.12.0...v7.12.1) (2026-01-01)

### Bug Fixes

* **cliproxy:** add comprehensive port validation across proxy system ([e0a1f8f](https://github.com/kaitranntt/ccs/commit/e0a1f8f312c1eb7621b3ea2af2edb4df44a51f64))
* **cliproxy:** filter undefined config values to preserve defaults ([4c35e8a](https://github.com/kaitranntt/ccs/commit/4c35e8a39ed03ab026a1dff230e06f5d9449fbef))
2026-01-01 07:03:28 +00:00
Kai (Tam Nhu) TranandGitHub 50f40bb882 Merge pull request #241 from kaitranntt/dev
fix(cliproxy): resolve undefined port bug in CLIProxy executor
2025-12-31 23:02:26 -08:00
github-actions[bot] 00e8dd417e chore(release): 7.12.0-dev.1 [skip ci] 2026-01-01 07:01:43 +00:00
kaitranntt e0a1f8f312 fix(cliproxy): add comprehensive port validation across proxy system
- Export validatePort() from config-generator with full edge case handling
- Add YAML port validation in proxy-config-resolver before use
- Add final port validation in cliproxy-executor after config merge
- Add default port parameter and validation to proxy-detector
- Add 38 new tests covering all port validation edge cases

Fixes undefined port bug when upgrading from 7.11.1 to 7.12.0
2026-01-01 02:00:30 -05:00
kaitranntt 4c35e8a39e fix(cliproxy): filter undefined config values to preserve defaults
Object spread with {port: undefined} was overwriting DEFAULT_CONFIG.port,
causing "Using existing CLIProxy on port undefined" after upgrade.

Root cause: profileInfo.port is undefined for hardcoded CLIProxy profiles
(gemini, codex, agy, qwen). When passed to execClaudeWithCLIProxy(), the
undefined value replaced the default port 8317.

Fix: Filter out undefined values before merging with DEFAULT_CONFIG.
2026-01-01 01:38:19 -05:00
semantic-release-bot d28e926ed4 chore(release): 7.12.0 [skip ci]
## [7.12.0](https://github.com/kaitranntt/ccs/compare/v7.11.1...v7.12.0) (2026-01-01)

### Features

* **cliproxy:** add --allow-self-signed flag for HTTPS connections ([#227](https://github.com/kaitranntt/ccs/issues/227)) ([709976e](https://github.com/kaitranntt/ccs/commit/709976e897dfd71dbfb13dc1cfb2189076262db0))
* **delegation:** add Claude Code CLI flag passthrough ([6b74243](https://github.com/kaitranntt/ccs/commit/6b74243dc5b612168e7278e35768547358089f4a)), closes [#89](https://github.com/kaitranntt/ccs/issues/89)
* **release:** CLI flag passthrough, proxy fixes, and UI improvements ([#239](https://github.com/kaitranntt/ccs/issues/239)) ([b3ef76a](https://github.com/kaitranntt/ccs/commit/b3ef76a07b4f1e6d9852e851abff059bb7049a91)), closes [#228](https://github.com/kaitranntt/ccs/issues/228) [#89](https://github.com/kaitranntt/ccs/issues/89) [#234](https://github.com/kaitranntt/ccs/issues/234) [#227](https://github.com/kaitranntt/ccs/issues/227)

### Bug Fixes

* **cliproxy:** pass variant port to executor for isolation ([e58afd7](https://github.com/kaitranntt/ccs/commit/e58afd77905d40ce4526a85e4f59cea4fc33ff50)), closes [#228](https://github.com/kaitranntt/ccs/issues/228)
* **cliproxy:** propagate port in unified config and UI preset handlers ([2625389](https://github.com/kaitranntt/ccs/commit/26253891207d06c52530605f1f2246f366e70f7b))
* **cliproxy:** use correct default port (8317) for remote HTTP connections ([76aab09](https://github.com/kaitranntt/ccs/commit/76aab09616f2efbf186b2c3700cc84f4bb6c50f4))
* **prompt:** add stdin.pause() to prevent process hang after password input ([f30d0c1](https://github.com/kaitranntt/ccs/commit/f30d0c12396218bee61ee227d940a647123012ff))
* **ui:** enable cancel button during OAuth authentication ([86200eb](https://github.com/kaitranntt/ccs/commit/86200eb698565f4d0c86291bde4e9c221fa293e9)), closes [#234](https://github.com/kaitranntt/ccs/issues/234)

### Tests

* **delegation:** add comprehensive CLI flag passthrough tests ([d5e485b](https://github.com/kaitranntt/ccs/commit/d5e485b4099f65fe8b95bd03af8f05d2bb9abd05))
2026-01-01 03:14:22 +00:00
Kai (Tam Nhu) TranandGitHub a7bee90a29 Merge pull request #240 from kaitranntt/dev
feat(release): CLI flag passthrough, proxy fixes, and UI improvements
2025-12-31 19:13:17 -08:00
github-actions[bot] 9ed322f165 chore(release): 7.11.1-dev.7 [skip ci] 2026-01-01 03:12:40 +00:00
kaitranntt a0547183d8 Merge remote-tracking branch 'origin/main' into dev 2025-12-31 22:11:28 -05:00
Kai (Tam Nhu) TranGitHubgithub-actions[bot] <github-actions[bot]@users.noreply.github.com>Shun KakinokiClaude Opus 4.5
b3ef76a07b feat(release): CLI flag passthrough, proxy fixes, and UI improvements (#239)
* fix(cliproxy): pass variant port to executor for isolation

Variants configured with dedicated ports (8318-8417) were not using
their assigned port. The executor always defaulted to 8317.

Changes:
- Add port field to ProfileDetectionResult interface
- Pass variant.port from profile-detector to ccs.ts
- Forward port to execClaudeWithCLIProxy options
- Update executor priority: CLI flags > variant port > config.yaml > default

Closes #228

* fix(cliproxy): propagate port in unified config and UI preset handlers

Edge case fixes identified in codebase review:
- Unified config variant detection: add settingsPath and port fields
- Provider editor: use variant port in handleApplyPreset/handleCustomPresetApply
- preset-utils: add optional port parameter to applyDefaultPreset()

* chore(release): 7.11.1-dev.1 [skip ci]

* fix(cliproxy): use correct default port (8317) for remote HTTP connections

Root cause: Inconsistent default port logic across code paths.
- Test Connection used 8317 (correct)
- Actual API calls used 80 (wrong)

Changes:
- Add centralized getRemoteDefaultPort() helper in config-generator.ts
- Fix proxy-target-resolver.ts to use shared helper
- Fix rewriteLocalhostUrls() and getRemoteEnvVars() in config-generator.ts
- Update remote-proxy-client.ts to use shared helper (DRY)

Fixes all 3 reported issues:
1. Port empty → now correctly uses :8317 instead of :80
2. BASEURL construction → now includes correct port
3. CLIProxy Plus auth → now fetches from remote on correct port

* chore(release): 7.11.1-dev.2 [skip ci]

* feat(delegation): add Claude Code CLI flag passthrough

Add explicit passthrough support for key Claude Code CLI flags:
- --max-turns: Limit agentic turns (prevents infinite loops)
- --fallback-model: Auto-fallback when model overloaded
- --agents: Dynamic subagent JSON injection
- --betas: Enable experimental features

Maintain extraArgs catch-all for future Claude Code flags.
Update help command with new "Delegation Flags" section.

Closes #89

* test(delegation): add comprehensive CLI flag passthrough tests

Add 45 test cases covering all edge cases for CLI flag passthrough:
- DelegationHandler: timeout/max-turns/fallback-model/agents/betas validation
- HeadlessExecutor: duplicate flag filtering, undefined vs truthy checks

* chore(release): 7.11.1-dev.3 [skip ci]

* fix(ui): enable cancel button during OAuth authentication

Resolves #234 - Cancel button was disabled during authentication flow,
preventing users from canceling the OAuth process.

Changes:
- Add auth-session-manager.ts for tracking active OAuth sessions
- Add POST /cliproxy/auth/:provider/cancel endpoint to abort sessions
- Kill spawned CLIProxy auth process when cancel is triggered
- Enable Cancel button in AddAccountDialog during authentication
- Add cancel support to QuickSetupWizard auth step
- Update useCancelAuth hook to call backend cancel endpoint

* chore(release): 7.11.1-dev.4 [skip ci]

* fix(prompt): add stdin.pause() to prevent process hang after password input

Fixes #236. The password() method called resume() on stdin but never
paused it in cleanup, keeping the event loop alive indefinitely.

* chore(release): 7.11.1-dev.5 [skip ci]

* feat(cliproxy): add --allow-self-signed flag for HTTPS connections (#227)

Previously, allowSelfSigned was hardcoded to true for all HTTPS protocol
connections, forcing use of the native https module which has issues with
Cloudflare-proxied connections causing timeouts.

This change:
- Adds --allow-self-signed CLI flag (default: false)
- Adds CCS_ALLOW_SELF_SIGNED environment variable
- Uses standard fetch API by default for HTTPS (works with valid certs)
- Only uses native https module when --allow-self-signed is specified

Usage:
- For production HTTPS proxies with valid certs: no flag needed
- For dev proxies with self-signed certs: use --allow-self-signed

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>

* chore(release): 7.11.1-dev.6 [skip ci]

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Shun Kakinoki <39187513+shunkakinoki@users.noreply.github.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 16:36:18 -08:00
github-actions[bot] 9cbad743fa chore(release): 7.11.1-dev.6 [skip ci] 2026-01-01 00:34:01 +00:00
709976e897 feat(cliproxy): add --allow-self-signed flag for HTTPS connections (#227)
Previously, allowSelfSigned was hardcoded to true for all HTTPS protocol
connections, forcing use of the native https module which has issues with
Cloudflare-proxied connections causing timeouts.

This change:
- Adds --allow-self-signed CLI flag (default: false)
- Adds CCS_ALLOW_SELF_SIGNED environment variable
- Uses standard fetch API by default for HTTPS (works with valid certs)
- Only uses native https module when --allow-self-signed is specified

Usage:
- For production HTTPS proxies with valid certs: no flag needed
- For dev proxies with self-signed certs: use --allow-self-signed

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 16:33:02 -08:00
github-actions[bot] f21fb0391e chore(release): 7.11.1-dev.5 [skip ci] 2026-01-01 00:20:26 +00:00
Kai (Tam Nhu) TranandGitHub b6e7000694 Merge pull request #238 from kaitranntt/fix/api-create-exit-hang
fix(prompt): stdin.pause() to prevent process hang after password input
2025-12-31 16:19:29 -08:00
kaitranntt f30d0c1239 fix(prompt): add stdin.pause() to prevent process hang after password input
Fixes #236. The password() method called resume() on stdin but never
paused it in cleanup, keeping the event loop alive indefinitely.
2025-12-31 19:12:55 -05:00
github-actions[bot] f614b6f8ea chore(release): 7.11.1-dev.4 [skip ci] 2025-12-31 23:44:43 +00:00
Kai (Tam Nhu) TranandGitHub 768eb70e88 Merge pull request #237 from kaitranntt/fix/cancel-button-auth-modal
fix(ui): enable cancel button during OAuth authentication
2025-12-31 15:43:44 -08:00
kaitranntt 86200eb698 fix(ui): enable cancel button during OAuth authentication
Resolves #234 - Cancel button was disabled during authentication flow,
preventing users from canceling the OAuth process.

Changes:
- Add auth-session-manager.ts for tracking active OAuth sessions
- Add POST /cliproxy/auth/:provider/cancel endpoint to abort sessions
- Kill spawned CLIProxy auth process when cancel is triggered
- Enable Cancel button in AddAccountDialog during authentication
- Add cancel support to QuickSetupWizard auth step
- Update useCancelAuth hook to call backend cancel endpoint
2025-12-31 18:29:04 -05:00
github-actions[bot] badcecfc45 chore(release): 7.11.1-dev.3 [skip ci] 2025-12-31 22:59:12 +00:00
Kai (Tam Nhu) TranandGitHub 7d173bf16f Merge pull request #235 from kaitranntt/feat/cli-flag-passthrough
feat(delegation): add Claude Code CLI flag passthrough
2025-12-31 14:58:15 -08:00
kaitranntt d5e485b409 test(delegation): add comprehensive CLI flag passthrough tests
Add 45 test cases covering all edge cases for CLI flag passthrough:
- DelegationHandler: timeout/max-turns/fallback-model/agents/betas validation
- HeadlessExecutor: duplicate flag filtering, undefined vs truthy checks
2025-12-31 17:36:52 -05:00
kaitranntt 6b74243dc5 feat(delegation): add Claude Code CLI flag passthrough
Add explicit passthrough support for key Claude Code CLI flags:
- --max-turns: Limit agentic turns (prevents infinite loops)
- --fallback-model: Auto-fallback when model overloaded
- --agents: Dynamic subagent JSON injection
- --betas: Enable experimental features

Maintain extraArgs catch-all for future Claude Code flags.
Update help command with new "Delegation Flags" section.

Closes #89
2025-12-31 15:53:10 -05:00
github-actions[bot] a24ae6ab3b chore(release): 7.11.1-dev.2 [skip ci] 2025-12-30 21:05:27 +00:00
Kai (Tam Nhu) TranandGitHub 5cb4209762 Merge pull request #230 from kaitranntt/kai/fix/remote-proxy-default-port
fix(cliproxy): use correct default port for remote HTTP connections
2025-12-30 13:04:33 -08:00
kaitranntt 76aab09616 fix(cliproxy): use correct default port (8317) for remote HTTP connections
Root cause: Inconsistent default port logic across code paths.
- Test Connection used 8317 (correct)
- Actual API calls used 80 (wrong)

Changes:
- Add centralized getRemoteDefaultPort() helper in config-generator.ts
- Fix proxy-target-resolver.ts to use shared helper
- Fix rewriteLocalhostUrls() and getRemoteEnvVars() in config-generator.ts
- Update remote-proxy-client.ts to use shared helper (DRY)

Fixes all 3 reported issues:
1. Port empty → now correctly uses :8317 instead of :80
2. BASEURL construction → now includes correct port
3. CLIProxy Plus auth → now fetches from remote on correct port
2025-12-30 16:03:09 -05:00
github-actions[bot] 59928c106b chore(release): 7.11.1-dev.1 [skip ci] 2025-12-30 18:42:08 +00:00
Kai (Tam Nhu) TranandGitHub ae40e4c42f Merge pull request #229 from kaitranntt/fix/228-variant-port-not-passed
fix(cliproxy): pass variant port to executor for isolation
2025-12-30 10:41:14 -08:00
kaitranntt 2625389120 fix(cliproxy): propagate port in unified config and UI preset handlers
Edge case fixes identified in codebase review:
- Unified config variant detection: add settingsPath and port fields
- Provider editor: use variant port in handleApplyPreset/handleCustomPresetApply
- preset-utils: add optional port parameter to applyDefaultPreset()
2025-12-30 13:12:54 -05:00
kaitranntt e58afd7790 fix(cliproxy): pass variant port to executor for isolation
Variants configured with dedicated ports (8318-8417) were not using
their assigned port. The executor always defaulted to 8317.

Changes:
- Add port field to ProfileDetectionResult interface
- Pass variant.port from profile-detector to ccs.ts
- Forward port to execClaudeWithCLIProxy options
- Update executor priority: CLI flags > variant port > config.yaml > default

Closes #228
2025-12-30 12:42:54 -05:00
semantic-release-bot cf83425bcf chore(release): 7.11.1 [skip ci]
## [7.11.1](https://github.com/kaitranntt/ccs/compare/v7.11.0...v7.11.1) (2025-12-29)

### Bug Fixes

* validate required config fields before save ([#225](https://github.com/kaitranntt/ccs/issues/225)) ([388428b](https://github.com/kaitranntt/ccs/commit/388428bba935393f7619b9c682cf43c3dfb966af)), closes [#224](https://github.com/kaitranntt/ccs/issues/224) [#224](https://github.com/kaitranntt/ccs/issues/224)
2025-12-29 22:17:03 +00:00
Kai (Tam Nhu) TranandGitHub 6bdcc00d92 Merge pull request #226 from kaitranntt/dev
feat(release): promote dev to main
2025-12-29 14:15:58 -08:00
github-actions[bot] 98a1d0898d chore(release): 7.11.0-dev.1 [skip ci] 2025-12-29 22:10:21 +00:00
Kai (Tam Nhu) TranandGitHub 388428bba9 fix: validate required config fields before save (#225)
* fix(ui): validate BASE_URL and AUTH_TOKEN before save

- Add validation in use-provider-editor to block save when required
  env vars (ANTHROPIC_BASE_URL, ANTHROPIC_AUTH_TOKEN) are missing
- Show warning banner in raw editor when required fields are absent
- Always apply default preset on account add (not just first account)

This implements defense-in-depth: validation UI prevents confusion,
save-time validation prevents broken configs, auto-preset ensures
new providers start with working configuration.

Fixes #224

* fix: add validation to remaining settings routes and UI hooks

Backend:
- settings-routes.ts: Validate ANTHROPIC_BASE_URL and AUTH_TOKEN on PUT
- profile-routes.ts: Validate baseUrl/apiKey not empty on update
- variant-routes.ts: Require model field for variant creation

Frontend:
- use-profile-editor.ts: Add required field validation + error handling
- use-copilot-config-form.ts: Add required field validation + error handling

Both hooks now expose missingRequiredFields for UI warnings.

Ref #224

* feat(ux): auto-fill missing BASE_URL/AUTH_TOKEN from defaults at runtime

Instead of blocking saves when required env vars are missing, the system now:
- Runtime fills missing values from getClaudeEnvVars() defaults
- Backend returns warning in response (not 400 error)
- UI shows informational toast instead of blocking error
- Yellow warning banner still shown for user awareness

This provides better UX for CLIProxy users - saves always work, and
missing fields automatically use sensible defaults (local proxy URL
and global API key).

* fix(api): validate settings object before write to prevent undefined file content

Add validation to PUT /api/settings/:profile to return 400 if settings
object is undefined/null. Previously JSON.stringify(undefined) would
write literal "undefined" string to settings file.

* fix: add port validation and pre-save warning UI

- Add validatePort() helper (1-65535 range) to config-generator.ts
- Add missing field warning banner to copilot/config-form UI
- Add missing field warning banner to profiles/editor UI
- Wire missingRequiredFields prop through components
2025-12-29 14:09:27 -08:00
semantic-release-bot 68835aee8e chore(release): 7.11.0 [skip ci]
## [7.11.0](https://github.com/kaitranntt/ccs/compare/v7.10.0...v7.11.0) (2025-12-29)

### Features

* **cliproxy:** add --proxy-timeout CLI option ([#220](https://github.com/kaitranntt/ccs/issues/220)) ([4cd9bec](https://github.com/kaitranntt/ccs/commit/4cd9bec9e1b88ebd6b83c6faf9c01399865c639b))
2025-12-29 20:59:21 +00:00
Shun KakinokiandGitHub 4cd9bec9e1 feat(cliproxy): add --proxy-timeout CLI option (#220)
Add configurable timeout for remote proxy connection checks.

- Add --proxy-timeout <ms> CLI flag (100-60000ms range)
- Add CCS_PROXY_TIMEOUT environment variable support
- Update help documentation for new option
- Default remains 2000ms for backward compatibility
2025-12-29 12:58:19 -08:00
semantic-release-bot 14df54b60b chore(release): 7.10.0 [skip ci]
## [7.10.0](https://github.com/kaitranntt/ccs/compare/v7.9.0...v7.10.0) (2025-12-29)

### Features

* **cliproxy:** add account quota display for Antigravity provider ([205b5ab](https://github.com/kaitranntt/ccs/commit/205b5ab71fe560cdc8eed046ae133d40343df156))
* **error-logs:** extract model and quota reset info from error logs ([e3a71fc](https://github.com/kaitranntt/ccs/commit/e3a71fc89372e81af3c425c5bf8e42630b4c1b6b))
* **quota:** add OAuth token refresh for independent quota fetching ([4be8e92](https://github.com/kaitranntt/ccs/commit/4be8e927a08bbdcca02d000a9780e8466f0fc1f0))
* **quota:** implement proactive token refresh (5-min lead time) ([00597b3](https://github.com/kaitranntt/ccs/commit/00597b335887b9280b22d78d522146ee65e7037e))
* **ui:** replace misleading token expiry with runtime-based status ([6ccf6c5](https://github.com/kaitranntt/ccs/commit/6ccf6c5e138f6fdc847d47ef885dde39bc7aeeb1))

### Bug Fixes

* **cliproxy:** resolve merge conflicts and add edge case fixes ([7861b63](https://github.com/kaitranntt/ccs/commit/7861b63a5d977921bb0d726e7954b5c10cf74c1f))
* **error-logs:** fix endpoint regex for v1/messages URL format ([19550b2](https://github.com/kaitranntt/ccs/commit/19550b28f0087ec81925076d10205ce333c37799))
* **quota,error-logs:** match CLIProxyAPI headers and enhance error log display ([ac6f382](https://github.com/kaitranntt/ccs/commit/ac6f382f6a6cd64aa3fa0727d11bcf498aae28fc))
* **quota:** add unprovisioned account detection with actionable message ([ecfdcde](https://github.com/kaitranntt/ccs/commit/ecfdcdef782c429e2e125598d11ef7d974e68ae2))
* **quota:** remove misleading token expiration check in quota fetcher ([739270a](https://github.com/kaitranntt/ccs/commit/739270aac40f23239bd85a07dab30c20a3fab80a))
* **ui:** remove duplicate provider prop in ModelConfigTab ([3531991](https://github.com/kaitranntt/ccs/commit/3531991b5ddeb9678927c140383c1588a3898d16))
* **ui:** replace misleading 'Expires' with 'Last used' in credential health ([4233415](https://github.com/kaitranntt/ccs/commit/4233415095d7a56ebd98cb0f76a95e37ce25ddea))
2025-12-29 20:53:13 +00:00
Kai (Tam Nhu) TranandGitHub b09d8fbe9f Merge pull request #223 from kaitranntt/dev
feat(cliproxy): account quota integration with enhanced error log display
2025-12-29 12:52:10 -08:00
github-actions[bot] d7bac2391b chore(release): 7.9.0-dev.1 [skip ci] 2025-12-29 20:51:35 +00:00
Kai (Tam Nhu) TranandGitHub 5be0d9bf22 Merge pull request #222 from kaitranntt/feat/account-quota-integration
feat(cliproxy): add account quota display for Antigravity provider
2025-12-29 12:50:38 -08:00
kaitranntt ac6f382f6a fix(quota,error-logs): match CLIProxyAPI headers and enhance error log display
Quota fetcher:
- loadCodeAssist headers now match antigravity.go exactly
- fetchAvailableModels uses empty body {} and correct User-Agent
- Prevents accounts being flagged for anomalous requests

Error logs:
- Extract status code from end of log (RESPONSE section)
- Display full model names instead of abbreviated
- Show status badges (500/429/4xx) with color coding
- Add provider icons with white background
2025-12-29 15:48:37 -05:00
kaitranntt 00597b3358 feat(quota): implement proactive token refresh (5-min lead time)
- Refresh token 5 minutes before expiry (matches CLIProxyAPIPlus)
- Only refresh when: expired, no expiry info, or expiring within 5 min
- Reduces unnecessary OAuth API calls when token is still valid
2025-12-29 13:57:21 -05:00
kaitranntt 19550b28f0 fix(error-logs): fix endpoint regex for v1/messages URL format 2025-12-29 13:53:24 -05:00
kaitranntt ecfdcdef78 fix(quota): add unprovisioned account detection with actionable message
- Add isUnprovisioned flag to QuotaResult interface
- Detect when account is authenticated but lacks project ID
- Show actionable message: "Sign in to Antigravity app to activate quota."
- Refactor getProjectId retry logic for cleaner error propagation
2025-12-29 13:48:56 -05:00
kaitranntt e3a71fc893 feat(error-logs): extract model and quota reset info from error logs
- Add model, quotaResetDelay, quotaResetTimestamp fields to ParsedErrorLog
- Extract model from requestBody JSON
- Parse quota reset delay/timestamp from 429 response bodies
- Display model prominently in Overview tab with violet highlight
- Show quota reset countdown for rate limit errors
- Improve actionable suggestions with color-coded error types
2025-12-29 13:40:17 -05:00
kaitranntt 4be8e927a0 feat(quota): add OAuth token refresh for independent quota fetching
CCS can now fetch quota independently of CLIProxyAPI by refreshing
access tokens using the refresh_token stored in auth files.

- Add refreshAccessToken() using Google OAuth token endpoint
- Use public Antigravity OAuth credentials (from CLIProxyAPIPlus)
- Proactively refresh token before API calls to avoid stale tokens
- Fallback retry on auth errors

This fixes quota showing "Access token expired" for accounts whose
file-based access_token is stale (CLIProxyAPI refreshes at runtime
but doesn't persist to disk).
2025-12-29 13:25:14 -05:00
kaitranntt 739270aac4 fix(quota): remove misleading token expiration check in quota fetcher
Backend was returning 'Token expired' error based on stale file state
without attempting API call. CLIProxyAPIPlus refreshes tokens at runtime
but intentionally doesn't persist to disk, making file-based expiration
checks always misleading.

Now quota fetcher attempts API call regardless of file expiration state.
If token is truly invalid, API returns 401 which is handled properly.
2025-12-29 13:18:02 -05:00