Commit Graph
1425 Commits
Author SHA1 Message Date
kaitranntt 56dfb2429b feat(ui): add visible pause toggle button to account item cards
- add pause/play button left of user avatar

- paused accounts show play icon (green) and dimmed card

- active accounts show pause icon

- includes loading spinner and tooltip
2026-01-24 12:33:37 -05:00
kaitranntt 118ce46e72 refactor(ui): update cliproxy page for account control flow 2026-01-24 12:23:18 -05:00
kaitranntt 87226e05c4 feat(ui): add expandable provider cards with account controls
- add ExpandableAccountList for inline account management

- add expand/collapse to ProviderCard with smooth transitions

- wire pause/resume/solo mutations to auth-monitor index

- add paused field to AccountRow type for UI display
2026-01-24 12:23:12 -05:00
kaitranntt 1427d36f86 feat(ui): add bulk account controls to provider editor
- add BulkActionBar component for multi-select pause/resume

- add AccountItem with individual pause toggle and solo button

- fix solo button disabled logic for consistency

- add selection state and bulk operations to AccountsSection
2026-01-24 12:23:04 -05:00
kaitranntt 708661744f fix(hooks): add stats invalidation to account control mutations
- add cliproxy-stats query invalidation to pause/resume/solo mutations

- ensures UI shows fresh stats after account state changes
2026-01-24 12:22:56 -05:00
kaitranntt d1b579ad1b fix(api): add race condition prevention and input validation for account control
- add mutex pattern with providerLocks Map for solo mode

- convert soloAccount to async function

- extract VALID_PROVIDERS constant and isValidProvider helper (DRY)

- allow empty arrays in bulk endpoints (return early success)

- add accountIds string validation (non-empty strings only)
2026-01-24 12:22:49 -05:00
semantic-release-bot caba99c3b5 chore(release): 7.26.3 [skip ci]
## [7.26.3](https://github.com/kaitranntt/ccs/compare/v7.26.2...v7.26.3) (2026-01-24)

### Bug Fixes

* **cliproxy:** propagate backend parameter to version check functions ([2a0efbd](https://github.com/kaitranntt/ccs/commit/2a0efbd954d5126d29920e4992f2f9a6be74fce6))
* **tests:** address edge cases in mock infrastructure ([2b91c40](https://github.com/kaitranntt/ccs/commit/2b91c40e37d5b28420ba9fa45f5b7bcbde6e29d5))
* **tests:** remove undefined MockRoute export and unused imports ([aaa6feb](https://github.com/kaitranntt/ccs/commit/aaa6feb8db6a31e598204448d6f45520313140f3))

### Documentation

* clarify no-emoji rule applies only to CLI terminal output ([0902211](https://github.com/kaitranntt/ccs/commit/0902211d409712f00bc5582e50660f6d76ef4e4c))

### Performance Improvements

* **tests:** replace real network ops with mock infrastructure ([5c83429](https://github.com/kaitranntt/ccs/commit/5c83429a79e178283654ee5d401cd8814d7ed599))
2026-01-24 05:05:24 +00:00
Kai (Tam Nhu) TranandGitHub aada7a6833 Merge pull request #367 from kaitranntt/dev
feat(release): v7.27.0 - test performance and cliproxy fixes
2026-01-24 00:04:20 -05:00
github-actions[bot] 1e2eeb1946 chore(release): 7.26.2-dev.3 [skip ci] 2026-01-24 05:01:25 +00:00
kaitranntt 0902211d40 docs: clarify no-emoji rule applies only to CLI terminal output 2026-01-24 00:00:27 -05:00
github-actions[bot] 1fbf6b0cc7 chore(release): 7.26.2-dev.2 [skip ci] 2026-01-24 04:52:01 +00:00
Kai (Tam Nhu) TranandGitHub a3b7e8bfcb Merge pull request #366 from kaitranntt/kai/perf/test-mock-refactor
perf(tests): mock infrastructure for fast test execution
2026-01-23 23:50:57 -05:00
kaitranntt aaa6feb8db fix(tests): remove undefined MockRoute export and unused imports
- Remove MockRoute from index.ts (type was removed in previous commit)
- Remove unused UPLOAD_SUCCESS, UNAUTHORIZED imports from test file
2026-01-23 23:47:09 -05:00
kaitranntt 2b91c40e37 fix(tests): address edge cases in mock infrastructure
- Prevent spy leak on double mockFetch() call
- Differentiate body types (URLSearchParams, ArrayBuffer, Blob, ReadableStream)
- Fix route path parsing to preserve spaces
- Escape regex special chars before wildcard replacement
- Remove unused MockResponse.error and MockRoute interface
2026-01-23 23:41:49 -05:00
kaitranntt 5c83429a79 perf(tests): replace real network ops with mock infrastructure
- Add centralized mock infrastructure in tests/mocks/:
  - mock-fetch.ts: Bun native fetch interception
  - mock-http-server.ts: Fake server responses (no ports)
  - fixtures/responses.ts: Preset response constants
  - types.ts: Mock type definitions

- Refactor https-tunnel-proxy.test.ts:
  - Remove TEST_CERT constant (~50 lines)
  - Remove real HTTPS server creation
  - Use invalid hosts for error path testing
  - 26/26 tests pass in ~430ms

- Refactor remote-token-uploader.test.ts:
  - Replace 7 real HTTP servers with mockFetch
  - Reduce from 422 to 289 lines
  - 18/18 tests pass in ~120ms

- Add global test timeout (10s) in bunfig.toml

Test suite: 10+ min → 14 seconds
2026-01-23 23:35:17 -05:00
github-actions[bot] 23f3b6dcfd chore(release): 7.26.2-dev.1 [skip ci] 2026-01-24 04:11:02 +00:00
Kai (Tam Nhu) TranandGitHub 883ea5d77e Merge pull request #365 from kaitranntt/kai/fix/cliproxy-backend-propagation
fix(cliproxy): propagate backend parameter to version check functions
2026-01-23 23:10:02 -05:00
kaitranntt 2a0efbd954 fix(cliproxy): propagate backend parameter to version check functions
Root cause: fetchLatestCliproxyVersion() and checkCliproxyUpdate()
ignored the caller's backend selection, always re-computing from config.
This caused --update to report wrong version when config wasn't synced.

Changes:
- Add optional backend param to fetchLatestCliproxyVersion()
- Add optional backend param to checkCliproxyUpdate()
- Pass effectiveBackend in binary-service.ts calls
- Pass backend in cliproxy-stats-routes.ts web endpoints

Fixes inconsistent version reporting when switching between
CLIProxyAPI (original) and CLIProxyAPIPlus backends.
2026-01-23 22:56:27 -05:00
semantic-release-bot 9051ea05bf chore(release): 7.26.2 [skip ci]
## [7.26.2](https://github.com/kaitranntt/ccs/compare/v7.26.1...v7.26.2) (2026-01-23)

### Bug Fixes

* display correct project names in session stats ([8ee87c7](https://github.com/kaitranntt/ccs/commit/8ee87c7452d3b3f71d4dd15031350fdcb2c4a8dc)), closes [#348](https://github.com/kaitranntt/ccs/issues/348) [#103](https://github.com/kaitranntt/ccs/issues/103)
* **glmt:** respect user-configured model instead of hardcoding glm-4.6 ([bd343f3](https://github.com/kaitranntt/ccs/commit/bd343f3f028bf1c5b0648a7566291fa4b94a09c3)), closes [#358](https://github.com/kaitranntt/ccs/issues/358)
* resolve test import paths and vi.mock hoisting issues ([84ec434](https://github.com/kaitranntt/ccs/commit/84ec43430d666ffd26505431d76fd1a8d1d4aaae))
* **ui:** display correct project names in session stats ([01f9610](https://github.com/kaitranntt/ccs/commit/01f96104e65ae02f7a20bad44730922a61b21c02)), closes [#348](https://github.com/kaitranntt/ccs/issues/348) [#103](https://github.com/kaitranntt/ccs/issues/103)

### Tests

* add project name display tests ([c5911dd](https://github.com/kaitranntt/ccs/commit/c5911dde38fedea1eb231a85de96c92dd79aec4e)), closes [#348](https://github.com/kaitranntt/ccs/issues/348) [#103](https://github.com/kaitranntt/ccs/issues/103)
2026-01-23 23:16:50 +00:00
Kai (Tam Nhu) TranandGitHub 87c9f66571 Merge pull request #362 from kaitranntt/dev
fix: GLM model version mismatch and session stats display
2026-01-23 18:15:47 -05:00
github-actions[bot] ad46f3cb4d chore(release): 7.26.1-dev.2 [skip ci] 2026-01-23 23:11:21 +00:00
Kai (Tam Nhu) TranandGitHub e59f51fb8b Merge pull request #361 from kaitranntt/kai/fix/glm-version-mismatch
fix(glmt): respect user-configured model instead of hardcoding glm-4.6
2026-01-23 18:10:23 -05:00
kaitrannttandClaude bd343f3f02 fix(glmt): respect user-configured model instead of hardcoding glm-4.6
Root cause: execClaudeWithProxy() was ignoring ANTHROPIC_MODEL from
user settings and always using hardcoded 'glm-4.6'.

Changes:
- Read model from user's settings file in GLMT proxy flow
- Update default model to glm-4.7 in base configs (matches presets)
- Update fallback models in transformer/response-builder

Closes #358

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-23 17:08:08 -05:00
github-actions[bot] 7c0cd86183 chore(release): 7.26.1-dev.1 [skip ci] 2026-01-23 21:28:08 +00:00
Kai (Tam Nhu) TranandGitHub 1326ee9cc1 Merge pull request #352 from Mearman/fix/session-stats-display
fix: display correct project names in session stats
2026-01-23 16:27:04 -05:00
kaitranntt 84ec43430d fix: resolve test import paths and vi.mock hoisting issues
- Fix import paths (5 '../' → 4 '../' for src imports)
- Fix test-utils import path (2 '../' → 3 '../')
- Fix vi.mock hoisting by inlining mock function
- Fix mockData scope in Privacy Mode test
- Fix test assertions (getByRole → querySelector, getByText → getAllByText)
- Add barrel export for getProjectDisplayName utility
2026-01-23 16:17:23 -05:00
semantic-release-bot 5594ab503c chore(release): 7.26.1 [skip ci]
## [7.26.1](https://github.com/kaitranntt/ccs/compare/v7.26.0...v7.26.1) (2026-01-23)

### Bug Fixes

* **cliproxy:** complete backend param propagation per code review ([388ab69](https://github.com/kaitranntt/ccs/commit/388ab69a970e7bbd249948f34d7ab3e7ab5ddcb9))
* **cliproxy:** complete backend switching with proper binary extraction ([2794a54](https://github.com/kaitranntt/ccs/commit/2794a548a57c94002ab8c4f926bd47f04de3f8ff))
* **cliproxy:** make backend switching work with version pins and status ([628148c](https://github.com/kaitranntt/ccs/commit/628148c3590e09dcb04fb205bd41880c3f295e87))
* **cliproxy:** make version cache backend-specific for proper switching ([a41fd2a](https://github.com/kaitranntt/ccs/commit/a41fd2a093d207d9216cde2a58da8669c09c7c04))
* **cliproxy:** use backend-aware labels in error messages and API ([f0c845c](https://github.com/kaitranntt/ccs/commit/f0c845c32e7f389d8427941dd685898a3f894faa))
* **cliproxy:** use backend-specific GitHub repos for version fetching ([0a1cbcc](https://github.com/kaitranntt/ccs/commit/0a1cbcc612d81ec8dc837cdada7c943ffedd4483))
* **ui:** add backend fields to CliproxyUpdateCheckResult type ([c916356](https://github.com/kaitranntt/ccs/commit/c9163568391208c346a6ca0e04562d2931e8092a))
* **ui:** align alert icon vertically with text when using py-2 ([0511c5e](https://github.com/kaitranntt/ccs/commit/0511c5e2fd008d953b357861a7941c3176280ecd))
* **ui:** correct warning text to reference Instance Status section ([46e75e2](https://github.com/kaitranntt/ccs/commit/46e75e2a746ab46801d4d731a08405dc029fdf5a))
* **ui:** display dynamic backend label in dashboard ([dad4349](https://github.com/kaitranntt/ccs/commit/dad434999469b6ed6e87c186c690004b83676420))
* **ui:** integrate ProxyStatusWidget in Settings & block backend switch when running ([6458173](https://github.com/kaitranntt/ccs/commit/64581734c61f3ad31e52c3decc6de10a6f983050))
* **ui:** prevent race conditions during backend switch ([498175e](https://github.com/kaitranntt/ccs/commit/498175e9fbc70010aececc276749356e8f8a8070))
* **ui:** sync backend state across all CLIProxy UI components ([88560c7](https://github.com/kaitranntt/ccs/commit/88560c71194b66093410cd5189a84d1224b16b2a))
2026-01-23 20:54:50 +00:00
Kai (Tam Nhu) TranandGitHub 108c788d9e Merge pull request #360 from kaitranntt/dev
fix(cliproxy): complete backend switching implementation
2026-01-23 15:53:42 -05:00
github-actions[bot] f21cc1fed0 chore(release): 7.26.0-dev.1 [skip ci] 2026-01-23 20:47:43 +00:00
Kai (Tam Nhu) TranandGitHub 4d171e77f8 Merge pull request #359 from kaitranntt/kai/fix/cliproxy-backend-switching
fix(cliproxy): make backend switching work with version pins and status
2026-01-23 15:46:43 -05:00
kaitranntt c916356839 fix(ui): add backend fields to CliproxyUpdateCheckResult type
Sync UI type definition with server response that now includes
backend and backendLabel fields for dynamic backend display.
2026-01-23 15:44:04 -05:00
kaitranntt f0c845c32e fix(cliproxy): use backend-aware labels in error messages and API
- Use checkCliproxyUpdate() in checkLatestVersion() for correct repo
- Dynamic error messages based on backend in service-manager
- Dynamic error messages based on backend in cliproxy-executor
- Generic "CLIProxy" message in oauth-process (no backend context)
2026-01-23 15:37:40 -05:00
kaitranntt 2794a548a5 fix(cliproxy): complete backend switching with proper binary extraction
- Add backend field to BinaryManagerConfig type for installer context
- Thread backend parameter through tar/zip extractors to use correct names
- Delete existing binary before install to prevent mismatched binaries
- Track backend in session metadata for debugging/monitoring
- Validate and preserve backend field in config mergeWithDefaults
- Pass backend to registerSession for session tracking

The core issue was extractors calling getExecutableName() without the
backend parameter, causing it to default to 'plus' regardless of user
selection. This resulted in wrong binaries being extracted/renamed.
2026-01-23 15:17:32 -05:00
kaitranntt 0a1cbcc612 fix(cliproxy): use backend-specific GitHub repos for version fetching
Root cause: fetchLatestVersion and fetchAllVersions were hardcoded to
CLIProxyAPIPlus repo, ignoring backend selection.

Changes:
- Add getGitHubApiUrls(backend) helper to types.ts
- Make fetchLatestVersion and fetchAllVersions backend-aware
- Make version list cache backend-specific (bin/{backend}/.version-list-cache.json)
- Update /api/cliproxy/versions route to use configured backend
- Allow version management even when proxy not running (ProxyStatusWidget)
- Show settings button in all states for easier access
2026-01-23 14:55:51 -05:00
kaitranntt 498175e9fb fix(ui): prevent race conditions during backend switch
- Add mutation key to useUpdateBackend for tracking
- Detect backend switching with useIsMutating in ProxyStatusWidget
- Disable install/controls during backend switch (prevents wrong-backend install)
- Reduce useCliproxyVersions staleTime from 1h to 5min for faster refresh
- Enable refetchOnWindowFocus for versions query
2026-01-23 14:50:13 -05:00
kaitranntt a41fd2a093 fix(cliproxy): make version cache backend-specific for proper switching
- Add backend parameter to version cache functions (read/write/path)
- Store cache at bin/{backend}/.version-cache.json instead of shared location
- Pass backend through checkForUpdates() and BinaryManager
- Add refetchType: 'all' to force immediate query refetch on backend change
- Add cliproxy-server-config query invalidation for consistency
2026-01-23 14:40:40 -05:00
kaitranntt 0511c5e2fd fix(ui): align alert icon vertically with text when using py-2 2026-01-23 14:22:12 -05:00
kaitranntt 46e75e2a74 fix(ui): correct warning text to reference Instance Status section 2026-01-23 14:20:38 -05:00
kaitranntt 64581734c6 fix(ui): integrate ProxyStatusWidget in Settings & block backend switch when running
- Add ProxyStatusWidget to Settings/Proxy page for quick start/stop access
- Disable backend selection when proxy is running with clear warning
- Removes UX friction: no need to navigate to CLIProxy page to stop instance
- Shows amber alert explaining why backend switch is blocked

User can now:
1. See proxy status directly in Settings
2. Stop proxy from Settings page
3. Change backend only when proxy is stopped
2026-01-23 13:53:53 -05:00
kaitranntt 88560c7119 fix(ui): sync backend state across all CLIProxy UI components
- Add useUpdateBackend mutation hook that invalidates related queries
- Reduce update-check stale time from 1hr to 5min + enable refetchOnWindowFocus
- Settings proxy page now uses mutation hook for proper query invalidation
- Make all CLIProxy labels dynamic based on backendLabel from API:
  - cliproxy-header.tsx: page title
  - app-sidebar.tsx: nav item label
  - cliproxy-stats-overview.tsx: both offline and running descriptions
  - model-preferences-grid.tsx: card description
  - settings proxy section: descriptions for local/remote modes
- Fix API route to use DEFAULT_BACKEND constant instead of hardcoded 'plus'

Ensures backend switching in Settings immediately reflects in all CLIProxy pages.
2026-01-23 13:46:47 -05:00
kaitranntt dad4349994 fix(ui): display dynamic backend label in dashboard
- Add backend/backendLabel fields to CliproxyUpdateCheckResult
- Update proxy-status-widget to show backendLabel from API
- Update cliproxy page header to use backendLabel

Dashboard now shows "CLIProxy" or "CLIProxy Plus" based on configured
backend in config.yaml instead of hardcoded "CLIProxy Plus".
2026-01-23 13:25:24 -05:00
kaitranntt 388ab69a97 fix(cliproxy): complete backend param propagation per code review
- Add backend param to checkLatestVersion()
- Add backend param to isPinned(), getPinned(), clearPin() wrappers
- Use getBackendLabel() consistently in showStatus()

Addresses review feedback from PR #359.
2026-01-23 13:20:31 -05:00
kaitranntt 628148c359 fix(cliproxy): make backend switching work with version pins and status
- Add backend param to isCLIProxyInstalled(), getCLIProxyPath(),
  getInstalledCliproxyVersion(), installCliproxyVersion()
- Update getBinaryStatus() to pass backend to all helper functions
- Add getBackendLabel() helper for dynamic CLI messages
- Replace hardcoded "CLIProxy Plus" strings with dynamic labels
- Pass --backend flag through install/update command handlers
- Import CLIProxyBackend type from types.ts instead of redefining

Setting `cliproxy.backend: original` in config.yaml now correctly
uses the original backend for version pins and binary operations.
2026-01-23 10:52:01 -05:00
Joseph MearmanandGitHub cd4e13c2f3 Merge branch 'main' into fix/session-stats-display 2026-01-23 07:01:45 +00:00
semantic-release-bot e3e1be20fc chore(release): 7.26.0 [skip ci]
## [7.26.0](https://github.com/kaitranntt/ccs/compare/v7.25.0...v7.26.0) (2026-01-23)

### Features

* add Ollama provider support ([bd3be23](https://github.com/kaitranntt/ccs/commit/bd3be23355f48269d5ce74dbf2b5aaf0eda8cf22))
* **ui:** add Ollama logo and make API key optional ([2cb77f2](https://github.com/kaitranntt/ccs/commit/2cb77f2dfd8376905e76cdd951830d24f2d29bbf))
* **ui:** add Ollama provider presets to dashboard ([2b7d18c](https://github.com/kaitranntt/ccs/commit/2b7d18c4c6631cb949c82a3eecc83beb0c885319))
* **ui:** add provider logos for alternative API presets ([5074122](https://github.com/kaitranntt/ccs/commit/5074122d4af705933c60527d34f5ec9bc168990b))

### Bug Fixes

* **api:** skip API key prompt for local Ollama preset ([ef2c8bb](https://github.com/kaitranntt/ccs/commit/ef2c8bba12e9ab164fa5b4be4c8fbb60617a20a1))
* **api:** skip API key prompt for local Ollama using noApiKey flag ([dc6977d](https://github.com/kaitranntt/ccs/commit/dc6977d32e5511b24f6a403f609507e9cd19af19))
* **ollama:** align property naming and descriptions ([3ce698c](https://github.com/kaitranntt/ccs/commit/3ce698c5fe3bc013371b51f6c13d01f32611f9a3))
* **presets:** make requiresApiKey required boolean, add sentinel docs ([8e29c48](https://github.com/kaitranntt/ccs/commit/8e29c48c6dd689794adaf740634823914e609c9d))

### Documentation

* add Ollama to Built-in Providers table and usage examples ([c9604be](https://github.com/kaitranntt/ccs/commit/c9604be5e1089c38d10047f65ab531a25ea14fc5))
2026-01-23 03:34:06 +00:00
Kai (Tam Nhu) TranandGitHub 5f6094a487 Merge pull request #356 from kaitranntt/dev
feat(providers): add Ollama support and provider logos
2026-01-22 22:33:01 -05:00
github-actions[bot] 4fa519d8ae chore(release): 7.25.0-dev.2 [skip ci] 2026-01-22 21:45:26 +00:00
kaitranntt 5074122d4a feat(ui): add provider logos for alternative API presets
Add icons for GLM, GLMT (Z.AI), Kimi, Azure Foundry, Minimax, DeepSeek, and Qwen presets.
2026-01-22 16:29:30 -05:00
github-actions[bot] 49f3742f12 chore(release): 7.25.0-dev.1 [skip ci] 2026-01-22 20:22:12 +00:00
Kai (Tam Nhu) TranandGitHub 4dc6bbaf4c Merge pull request #354 from jellydn/feat/ollama-provider
feat: add Ollama provider support
2026-01-22 15:21:09 -05:00