Commit Graph
1762 Commits
Author SHA1 Message Date
Tam Nhu Tran 44b3152d34 fix(env): address all PR review feedback
- Add settings profiles to zsh env completion (was proxy-only)
- Document intentional ANTHROPIC_MODEL omission in transformToOpenAI
- Use getCcsDir() in error hint instead of hardcoded ~/.ccs/
- Export parseFlag and add 5 unit tests for flag parsing
- Add fish and PowerShell single-quote escaping tests
2026-02-11 06:46:12 +07:00
Tam Nhu Tran 041e1c6cc2 chore: update lockfiles 2026-02-11 06:41:33 +07:00
Tam Nhu Tran 76457a567d fix(env): add key sanitization and shell completions
- Validate env var keys match ^[A-Za-z_][A-Za-z0-9_]*$ before output
  to prevent injection via crafted config files
- Add env command to all 4 shell completion scripts (bash, zsh, fish,
  PowerShell) with sub-completions for --format and --shell flags
2026-02-11 06:36:51 +07:00
Tam Nhu Tran a5dc15d174 fix(env): use single quotes to prevent shell injection via eval
Switch formatExportLine from double quotes to single quotes to prevent
shell metacharacter expansion ($(), backticks, etc.) when output is
consumed via eval. Also fix parseFlag to handle values containing =,
remove unused test imports, and add empty-output guard after format
transformation.
2026-02-11 06:26:52 +07:00
Tam Nhu Tran 2e85064b8a feat(env): add ccs env command for third-party tool integration
New `ccs env <profile>` command exports shell-evaluable environment
variables for OpenCode, Cursor, Continue, and other third-party tools.

Supports --format (openai|anthropic|raw) and --shell (auto|bash|fish|
powershell) flags. Auto-detects shell from $SHELL env var.

Closes #503
2026-02-11 02:38:29 +07:00
github-actions[bot] 72ee3122bd chore(release): 7.40.0-dev.2 [skip ci] 2026-02-10 18:34:20 +00:00
Kai (Tam Nhu) TranandGitHub ebc58778b4 Merge pull request #497 from kaitranntt/kai/fix/155-gemini-schema-compat
fix(cliproxy): strip Gemini-unsupported schema fields including "examples"
2026-02-11 01:32:42 +07:00
github-actions[bot] fa293b3d53 chore(release): 7.40.0-dev.1 [skip ci] 2026-02-10 15:46:34 +00:00
kaitranntt 8c6afe2e73 feat: update cliproxy, config loader, glmt transformer, and provider routes 2026-02-10 10:45:16 -05:00
kaitranntt 917f0bbef7 test(cliproxy): add edge case coverage for Gemini schema sanitizer
Add tests for: exclusiveMinimum/exclusiveMaximum/multipleOf stripping,
uniqueItems/contains/additionalItems stripping, writeOnly/definitions
stripping, example with array values, default with complex nested
objects, empty properties/anyOf edge cases.

Fix proxy log message to say "Gemini-unsupported" instead of
"non-standard".
2026-02-07 06:25:29 -05:00
kaitranntt 505d6d0f11 fix(cliproxy): strip Gemini-unsupported schema fields including "examples"
Replace permissive JSON Schema Draft-07 whitelist with strict
Gemini-compatible field set (22 fields). The "examples" field
in Claude Code tool schemas caused 400 errors from Gemini API.

Also strips other unsupported fields: $ref, $defs, oneOf, allOf,
additionalProperties, const, if/then/else, etc.

Safe change — sanitizer only runs for CLIProxy profiles (Gemini,
Codex, Antigravity), never for direct Anthropic API requests.

Closes #155
2026-02-07 06:17:26 -05:00
semantic-release-bot 7ceb019bb7 chore(release): 7.40.0 [skip ci]
## [7.40.0](https://github.com/kaitranntt/ccs/compare/v7.39.0...v7.40.0) (2026-02-07)

### Features

* **cliproxy:** add hybrid catalog sync with CLIProxyAPI ([#485](https://github.com/kaitranntt/ccs/issues/485)) ([c8a0995](https://github.com/kaitranntt/ccs/commit/c8a099509a878f24a211f01ee0000f01020c4d6b)), closes [#477](https://github.com/kaitranntt/ccs/issues/477)
* **cliproxy:** delegate kiro/ghcp token refresh to CLIProxyAPIPlus ([#488](https://github.com/kaitranntt/ccs/issues/488)) ([215c00e](https://github.com/kaitranntt/ccs/commit/215c00e9830e4a604231dd64c01154c91574ace9)), closes [#487](https://github.com/kaitranntt/ccs/issues/487)

### Bug Fixes

* **cliproxy:** disable 1M extended context for opus 4.6 (256k limit) ([#492](https://github.com/kaitranntt/ccs/issues/492)) ([43cd19a](https://github.com/kaitranntt/ccs/commit/43cd19a52b128363c7202590869fb4bd9349b859)), closes [#490](https://github.com/kaitranntt/ccs/issues/490)
* **cliproxy:** guard against empty upstream SSE responses in agy profile ([#489](https://github.com/kaitranntt/ccs/issues/489)) ([545c8b9](https://github.com/kaitranntt/ccs/commit/545c8b9515d5afeda17976f418e22037cc9acef9)), closes [#350](https://github.com/kaitranntt/ccs/issues/350)
* **hooks:** add image analysis env vars for settings-based profiles ([#484](https://github.com/kaitranntt/ccs/issues/484)) ([b0dff7a](https://github.com/kaitranntt/ccs/commit/b0dff7a148c795994c2e3f871db9f60dd1cc737a)), closes [#440](https://github.com/kaitranntt/ccs/issues/440)
* **teams:** propagate CLAUDE_CONFIG_DIR to tmux session for agent teammates ([db88290](https://github.com/kaitranntt/ccs/commit/db88290b9110ba78f484d707ae3e64521db4e622))

### Code Refactoring

* **cliproxy:** check lifecycle events in remaining SSE buffer ([42a3eb1](https://github.com/kaitranntt/ccs/commit/42a3eb150630b3a466b7ec9063a2256ecc38c60e))
* **cliproxy:** deduplicate message_delta/message_stop in synthetic SSE response ([152f543](https://github.com/kaitranntt/ccs/commit/152f5432ae26e42e07ea422b882298033ed66c7f)), closes [#491](https://github.com/kaitranntt/ccs/issues/491)
* **cliproxy:** extract SSE lifecycle tracker and add backpressure handling ([1b3440b](https://github.com/kaitranntt/ccs/commit/1b3440b93962e347797105b9bf92c2aaeb954a27))
* **teams:** use spawnSync array args instead of execSync string ([0f7d5f9](https://github.com/kaitranntt/ccs/commit/0f7d5f97576d68b9c73ea952a4ea5853b0993467))
2026-02-07 10:46:43 +00:00
Kai (Tam Nhu) TranandGitHub 57f6bab9e9 Merge pull request #496 from kaitranntt/dev
release: merge dev to main for v7.39.0 production release
2026-02-07 05:45:35 -05:00
github-actions[bot] cff5133e14 chore(release): 7.39.0-dev.5 [skip ci] 2026-02-07 10:41:42 +00:00
kaitranntt 1b3440b939 refactor(cliproxy): extract SSE lifecycle tracker and add backpressure handling
Consolidate 5 duplicate boolean tracking variables into a lifecycle
object with an update() method, reducing event detection from 4
locations to centralized calls. Add pause/drain/resume backpressure
to the passthrough path to prevent unbounded memory buffering with
slow clients.
2026-02-07 05:40:24 -05:00
github-actions[bot] 68f37efda9 chore(release): 7.39.0-dev.4 [skip ci] 2026-02-07 09:39:23 +00:00
Kai (Tam Nhu) TranandGitHub b92049c956 Merge pull request #493 from kaitranntt/kai/refactor/491-dedup-sse-events
refactor(cliproxy): deduplicate message_delta/message_stop in synthetic SSE response
2026-02-07 04:38:21 -05:00
kaitranntt 42a3eb1506 refactor(cliproxy): check lifecycle events in remaining SSE buffer
Add message_start/message_delta/message_stop detection to the
remaining-buffer block in the SSE processing path for defensive
completeness. Addresses code review feedback on PR #493.
2026-02-07 04:30:42 -05:00
kaitranntt 152f5432ae refactor(cliproxy): deduplicate message_delta/message_stop in synthetic SSE response
Track hasReceivedMessageDelta and hasReceivedMessageStop in both
streaming paths (pipe-through and SSE-processing). Conditionally
omit these events from buildSyntheticErrorResponse() when upstream
already sent them, preventing protocol violations.

Closes #491
2026-02-07 04:24:54 -05:00
github-actions[bot] 17029c0ca2 chore(release): 7.39.0-dev.3 [skip ci] 2026-02-07 09:20:42 +00:00
Kai (Tam Nhu) TranandGitHub 43cd19a52b fix(cliproxy): disable 1M extended context for opus 4.6 (256k limit) (#492)
* fix(cliproxy): disable 1M extended context for gemini-claude-opus-4-6-thinking

Antigravity backend only supports 256k context window for this model,
not 1M as previously declared. Set extendedContext: false with TODO
comment for easy re-enable when backend adds support.

Closes #490

* fix(cliproxy): strip [1m] suffix at runtime for models without extended context

Users with existing [1m] in saved agy.settings.json will now have it
automatically stripped at runtime when the model no longer supports
extended context. Prevents misleading context window claims.
2026-02-07 04:19:44 -05:00
github-actions[bot] 2599136876 chore(release): 7.39.0-dev.2 [skip ci] 2026-02-07 09:10:32 +00:00
Kai (Tam Nhu) TranandGitHub 545c8b9515 fix(cliproxy): guard against empty upstream SSE responses in agy profile (#489)
* fix(cliproxy): guard against empty upstream SSE responses in agy profile

When CLIProxyAPIPlus drops unsigned thinking blocks during sub-agent
execution, the response stream can contain no content_block_start or
message_delta events. This causes Claude Code CLI to crash with
"No assistant message found".

Add empty response detection in the tool sanitization proxy's streaming
handler. Both the pipe-through and SSE-processing paths now track
whether meaningful content was received. If upstream sent data but no
content blocks on a 200 OK, a synthetic minimal valid SSE response is
injected to prevent the client crash and surface a clear error message.

Closes #350

* fix(cliproxy): improve empty response detection and add tests

Address code review findings:
- Remove message_delta from content detection (lifecycle event, not
  content); only content_block_start indicates actual content
- Add try-catch in end handlers to handle client disconnects gracefully
- Add 3 integration tests: empty stream injection, normal stream
  passthrough, 4xx/5xx non-injection

* fix(cliproxy): avoid duplicate message_start in synthetic response

Track whether upstream already sent a message_start event. When
injecting the synthetic error response, omit message_start if upstream
already sent one, preventing duplicate events in the SSE stream.

Addresses PR review feedback from ccs-reviewer[bot].

* test(cliproxy): add SSE processing path and real failure mode tests

Address code review observations:
- Add test exercising SSE processing path (sanitized tool names) for
  empty response detection, ensuring both code paths are covered
- Add test mirroring real failure mode where upstream sends only
  message_start then ends abruptly (no message_delta/message_stop)
- Document duplicate message_start assumption with inline comment
2026-02-07 04:09:30 -05:00
github-actions[bot] 984e007468 chore(release): 7.39.0-dev.1 [skip ci] 2026-02-07 08:35:20 +00:00
Kai (Tam Nhu) TranandGitHub 215c00e983 feat(cliproxy): delegate kiro/ghcp token refresh to CLIProxyAPIPlus (#488)
CLIProxyAPIPlus already handles background token refresh for kiro (every
1 min via background_refresh.go) and other providers. CCS was incorrectly
returning "not implemented" errors for these providers, causing noisy
worker logs and preventing proper token expiry tracking.

Changes:
- Classify providers into CCS-managed (gemini), CLIProxy-delegated
  (codex, agy, kiro, ghcp, qwen, iflow), and not-implemented (claude)
- Delegated providers return success with delegated flag instead of error
- Skip refresh_token requirement for delegated providers in expiry checker
- Filter delegated providers from background worker refresh loop

Closes #487
2026-02-07 03:34:14 -05:00
github-actions[bot] 8172c65d1e chore(sync): merge main into dev after release [skip ci]
# Conflicts:
#	package.json
2026-02-07 05:06:12 +00:00
semantic-release-bot 5ed6fd9fa3 chore(release): 7.39.0 [skip ci]
## [7.39.0](https://github.com/kaitranntt/ccs/compare/v7.38.0...v7.39.0) (2026-02-07)

### Features

* hybrid CLIProxy catalog sync + agent teams env fix ([#486](https://github.com/kaitranntt/ccs/issues/486)) ([0b39493](https://github.com/kaitranntt/ccs/commit/0b394933aec723f77a552b7d951afaf065399a92)), closes [#485](https://github.com/kaitranntt/ccs/issues/485) [#477](https://github.com/kaitranntt/ccs/issues/477)
2026-02-07 05:05:37 +00:00
github-actions[bot] fe263707c7 chore(release): 7.38.0-dev.4 [skip ci] 2026-02-07 04:55:27 +00:00
kaitranntt ae482c58a5 Merge remote-tracking branch 'origin/main' into dev 2026-02-06 23:54:17 -05:00
Kai (Tam Nhu) TranGitHubCarlos Umanzorgithub-actions[bot] <github-actions[bot]@users.noreply.github.com>semantic-release-bot
0b394933ae feat: hybrid CLIProxy catalog sync + agent teams env fix (#486)
* fix(teams): propagate CLAUDE_CONFIG_DIR to tmux session for agent teammates

When CCS launches Claude with CLAUDE_CONFIG_DIR pointing to the isolated
instance path, agent team teammates spawned via tmux split-window don't
inherit it because tmux creates new panes from its own session environment.
This causes teammates to use ~/.claude/ instead of ~/.ccs/instances/{profile}/,
creating a split-brain in shared state (tasks, teams, mailbox).

Sets key CCS env vars in the tmux session environment via `tmux setenv` so
all new panes inherit the correct config directory.

* refactor(teams): use spawnSync array args instead of execSync string

Avoids shell interpretation of env values by passing args as array
to spawnSync instead of interpolating into a shell command string.

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

* feat(cliproxy): add hybrid catalog sync with CLIProxyAPI (#485)

* chore(release): 7.38.0 [skip ci]

## [7.38.0](https://github.com/kaitranntt/ccs/compare/v7.37.1...v7.38.0) (2026-02-07)

### Features

* **release:** v7.38.0 - Extended Context, Qwen Models, Bug Fixes ([#480](https://github.com/kaitranntt/ccs/issues/480)) ([b454834](https://github.com/kaitranntt/ccs/commit/b4548341750804339c87c48259dd8741425d2acf)), closes [#472](https://github.com/kaitranntt/ccs/issues/472) [#474](https://github.com/kaitranntt/ccs/issues/474) [#103](https://github.com/kaitranntt/ccs/issues/103) [#478](https://github.com/kaitranntt/ccs/issues/478) [#482](https://github.com/kaitranntt/ccs/issues/482)

* feat(cliproxy): add hybrid catalog sync with CLIProxyAPI

Add `ccs cliproxy catalog` command family for syncing model catalogs
from CLIProxyAPI's model-definitions endpoint. Cached locally with
24h TTL, merges remote models with static catalog preserving
broken/deprecated flags. Dashboard API endpoint at /api/cliproxy/catalog.

Closes #477

---------

Co-authored-by: semantic-release-bot <semantic-release-bot@martynus.net>

* chore(reviewer): upgrade review model from opus 4.5 to opus 4.6

- update default model in code-reviewer.ts
- update REVIEW_MODEL, ANTHROPIC_MODEL, ANTHROPIC_DEFAULT_OPUS_MODEL
  in ai-review.yml workflow
- aligns reviewer with AGY model catalog default

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

* fix(hooks): add image analysis env vars for settings-based profiles (#484)

* chore(release): 7.38.0 [skip ci]

## [7.38.0](https://github.com/kaitranntt/ccs/compare/v7.37.1...v7.38.0) (2026-02-07)

### Features

* **release:** v7.38.0 - Extended Context, Qwen Models, Bug Fixes ([#480](https://github.com/kaitranntt/ccs/issues/480)) ([b454834](https://github.com/kaitranntt/ccs/commit/b4548341750804339c87c48259dd8741425d2acf)), closes [#472](https://github.com/kaitranntt/ccs/issues/472) [#474](https://github.com/kaitranntt/ccs/issues/474) [#103](https://github.com/kaitranntt/ccs/issues/103) [#478](https://github.com/kaitranntt/ccs/issues/478) [#482](https://github.com/kaitranntt/ccs/issues/482)

* fix(hooks): add image analysis env vars for settings-based profiles

Image analysis hook was injected into settings files for API profiles
but the CCS_IMAGE_ANALYSIS_* env vars were never set, causing the hook
to skip. Add getImageAnalysisHookEnv() call to both settings-based and
GLMT proxy execution paths, matching CLIProxy profile behavior.

Closes #440

* fix(hooks): add hook env vars to copilot executor

Copilot profile had same gap as settings-based profiles: hooks installed
but webSearch/imageAnalysis env vars and CCS_PROFILE_TYPE never set.
Add missing env var injection matching other profile flows.

---------

Co-authored-by: semantic-release-bot <semantic-release-bot@martynus.net>

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

---------

Co-authored-by: Carlos Umanzor <cumanzor@gmail.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: semantic-release-bot <semantic-release-bot@martynus.net>
2026-02-06 23:54:03 -05:00
github-actions[bot] 6b7b20148d chore(release): 7.38.0-dev.3 [skip ci] 2026-02-07 04:40:28 +00:00
kaitranntt 6296691991 chore: resolve merge conflict in package.json (dev version) 2026-02-06 23:39:16 -05:00
b0dff7a148 fix(hooks): add image analysis env vars for settings-based profiles (#484)
* chore(release): 7.38.0 [skip ci]

## [7.38.0](https://github.com/kaitranntt/ccs/compare/v7.37.1...v7.38.0) (2026-02-07)

### Features

* **release:** v7.38.0 - Extended Context, Qwen Models, Bug Fixes ([#480](https://github.com/kaitranntt/ccs/issues/480)) ([b454834](https://github.com/kaitranntt/ccs/commit/b4548341750804339c87c48259dd8741425d2acf)), closes [#472](https://github.com/kaitranntt/ccs/issues/472) [#474](https://github.com/kaitranntt/ccs/issues/474) [#103](https://github.com/kaitranntt/ccs/issues/103) [#478](https://github.com/kaitranntt/ccs/issues/478) [#482](https://github.com/kaitranntt/ccs/issues/482)

* fix(hooks): add image analysis env vars for settings-based profiles

Image analysis hook was injected into settings files for API profiles
but the CCS_IMAGE_ANALYSIS_* env vars were never set, causing the hook
to skip. Add getImageAnalysisHookEnv() call to both settings-based and
GLMT proxy execution paths, matching CLIProxy profile behavior.

Closes #440

* fix(hooks): add hook env vars to copilot executor

Copilot profile had same gap as settings-based profiles: hooks installed
but webSearch/imageAnalysis env vars and CCS_PROFILE_TYPE never set.
Add missing env var injection matching other profile flows.

---------

Co-authored-by: semantic-release-bot <semantic-release-bot@martynus.net>
2026-02-06 23:33:12 -05:00
github-actions[bot] 02df67c12f chore(release): 7.38.0-dev.2 [skip ci] 2026-02-07 04:21:38 +00:00
kaitranntt 42d68dde11 chore(reviewer): upgrade review model from opus 4.5 to opus 4.6
- update default model in code-reviewer.ts
- update REVIEW_MODEL, ANTHROPIC_MODEL, ANTHROPIC_DEFAULT_OPUS_MODEL
  in ai-review.yml workflow
- aligns reviewer with AGY model catalog default
2026-02-06 23:20:32 -05:00
c8a099509a feat(cliproxy): add hybrid catalog sync with CLIProxyAPI (#485)
* chore(release): 7.38.0 [skip ci]

## [7.38.0](https://github.com/kaitranntt/ccs/compare/v7.37.1...v7.38.0) (2026-02-07)

### Features

* **release:** v7.38.0 - Extended Context, Qwen Models, Bug Fixes ([#480](https://github.com/kaitranntt/ccs/issues/480)) ([b454834](https://github.com/kaitranntt/ccs/commit/b4548341750804339c87c48259dd8741425d2acf)), closes [#472](https://github.com/kaitranntt/ccs/issues/472) [#474](https://github.com/kaitranntt/ccs/issues/474) [#103](https://github.com/kaitranntt/ccs/issues/103) [#478](https://github.com/kaitranntt/ccs/issues/478) [#482](https://github.com/kaitranntt/ccs/issues/482)

* feat(cliproxy): add hybrid catalog sync with CLIProxyAPI

Add `ccs cliproxy catalog` command family for syncing model catalogs
from CLIProxyAPI's model-definitions endpoint. Cached locally with
24h TTL, merges remote models with static catalog preserving
broken/deprecated flags. Dashboard API endpoint at /api/cliproxy/catalog.

Closes #477

---------

Co-authored-by: semantic-release-bot <semantic-release-bot@martynus.net>
2026-02-06 23:16:54 -05:00
github-actions[bot] 9e22018dee chore(release): 7.38.0-dev.1 [skip ci] 2026-02-07 02:15:26 +00:00
Kai (Tam Nhu) TranandGitHub 7be0676824 Merge pull request #483 from kaitranntt/fix/agent-teams-tmux-env
fix(teams): propagate CLAUDE_CONFIG_DIR to tmux session for agent teammates
2026-02-06 21:14:20 -05:00
kaitranntt 0f7d5f9757 refactor(teams): use spawnSync array args instead of execSync string
Avoids shell interpretation of env values by passing args as array
to spawnSync instead of interpolating into a shell command string.
2026-02-06 21:14:04 -05:00
Carlos Umanzorandkaitranntt db88290b91 fix(teams): propagate CLAUDE_CONFIG_DIR to tmux session for agent teammates
When CCS launches Claude with CLAUDE_CONFIG_DIR pointing to the isolated
instance path, agent team teammates spawned via tmux split-window don't
inherit it because tmux creates new panes from its own session environment.
This causes teammates to use ~/.claude/ instead of ~/.ccs/instances/{profile}/,
creating a split-brain in shared state (tasks, teams, mailbox).

Sets key CCS env vars in the tmux session environment via `tmux setenv` so
all new panes inherit the correct config directory.
2026-02-06 21:13:59 -05:00
semantic-release-bot e24d8d89e3 chore(release): 7.38.0 [skip ci]
## [7.38.0](https://github.com/kaitranntt/ccs/compare/v7.37.1...v7.38.0) (2026-02-07)

### Features

* **release:** v7.38.0 - Extended Context, Qwen Models, Bug Fixes ([#480](https://github.com/kaitranntt/ccs/issues/480)) ([b454834](https://github.com/kaitranntt/ccs/commit/b4548341750804339c87c48259dd8741425d2acf)), closes [#472](https://github.com/kaitranntt/ccs/issues/472) [#474](https://github.com/kaitranntt/ccs/issues/474) [#103](https://github.com/kaitranntt/ccs/issues/103) [#478](https://github.com/kaitranntt/ccs/issues/478) [#482](https://github.com/kaitranntt/ccs/issues/482)
2026-02-07 01:31:41 +00:00
Kai (Tam Nhu) TranGitHubgithub-actions[bot] <github-actions[bot]@users.noreply.github.com>
b454834175 feat(release): v7.38.0 - Extended Context, Qwen Models, Bug Fixes (#480)
* fix(version): show active config path instead of deprecated config.json

The version command was using deprecated getConfigPath() which always
returned config.json path. Now uses getActiveConfigPath() which shows
config.yaml in unified mode or config.json in legacy mode.

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

* fix(ui): use native dynamic import to fix Node 24 ESM/CJS interop

TypeScript compiles import() to require() when targeting CommonJS,
which breaks ESM packages like ora on Node 24. Use new Function()
to create native dynamic import at runtime, bypassing TS transform.

Closes #472

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

* fix(env): strip ANTHROPIC_* from account/default profiles

Account and default profiles inherit process.env which may contain
stale ANTHROPIC_BASE_URL from prior CLIProxy sessions. This causes
ConnectionRefused errors when Claude tries to hit an unavailable proxy.

Settings-based profiles already handle this by explicitly injecting
their own ANTHROPIC_* values. This fix applies the same protection
to account/default profiles by stripping ANTHROPIC_* before spawn.

Closes #474

* test(env): add unit tests for stripAnthropicEnv

Address code review feedback from PR #475. Tests cover:
- Removing all ANTHROPIC_* keys
- Preserving non-ANTHROPIC keys
- Empty object handling
- Undefined value preservation
- Case sensitivity (only uppercase ANTHROPIC_)
- All ANTHROPIC_ prefixed variants stripped

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

* feat(cliproxy): add extended context support for 1M token window

Add --1m and --no-1m flags to enable/disable 1M token context window.
Uses Claude Code's [1m] suffix mechanism.

Behavior:
- Gemini models: auto-enabled by default
- Claude models: opt-in with --1m flag
- New extendedContext field in model catalog

Also adds Claude Opus 4.6 to model catalog with extended context support.

Closes #103

* feat(ui): add extended context toggle in dashboard model config

- Add ExtendedContextToggle component for 1M token context window
- Add Claude Opus 4.6 (claude-opus-4-6-20260203) to model catalogs
- Mark Gemini and Claude models with extendedContext: true
- Toggle only appears when selected model supports extended context
- Auto-enabled info for native Gemini, opt-in info for Claude

Part of extended context feature implementation for issue #103.

* fix: address code review findings and CI failure

- Fix CI error: add missing 'provider' prop to ModelConfigSection
- Fix case sensitivity in applyExtendedContextSuffix
- Fix whitespace handling in stripModelSuffixes
- Handle --1m=value and --no-1m=value CLI patterns
- Add warning when --1m used on unsupported model
- Sync agy catalog: add extendedContext to gemini-3-pro-preview
- Extract isNativeGeminiModel to shared utility (DRY)
- Add 21 unit tests for extended-context-config

* fix(catalog): rename claude-opus-4-6-20260203 to claude-opus-4-6

* fix(ui): wire extended context toggle through component tree

- Add extendedContextEnabled and toggleExtendedContext to useProviderEditor hook
- Store setting as CCS_EXTENDED_CONTEXT env var in provider settings
- Pass props through provider-editor → model-config-tab → model-config-section
- Update UseProviderEditorReturn type with new properties

* fix(ui): apply [1m] suffix directly to model strings in settings

- Toggle now applies/strips [1m] suffix to all ANTHROPIC_*MODEL env vars
- Extended context detected by checking if any model has [1m] suffix
- Remove legacy CCS_EXTENDED_CONTEXT flag approach
- Add suffix utilities: applyExtendedContextSuffix, stripExtendedContextSuffix
- Raw Configuration now shows actual model values with [1m] suffix

* fix(qwen): update model catalog with correct context windows and tier mappings

- Update context window specs from official Alibaba docs:
  - Qwen3 Coder Plus: 1M context (was 32K)
  - Qwen3 Max: 256K context (flagship)
  - Qwen3 Coder Flash: fast code generation
- Fix preset mappings for Claude tier equivalence:
  - Opus → qwen3-max (flagship 256K)
  - Sonnet → qwen3-coder-plus (balanced 1M)
  - Haiku → qwen3-coder-flash (fast)
- Update provider descriptions to reflect 256K-1M context range
- Add all 7 Qwen models from CLIProxyAPI: qwen3-coder-plus, qwen3-max,
  qwen3-max-preview, qwen3-235b, qwen3-vl-plus, qwen3-coder-flash, qwen3-32b

Closes #478

* fix(ui): only apply [1m] suffix to ANTHROPIC_MODEL, fix toggle refresh

- Only ANTHROPIC_MODEL gets [1m] suffix, not tier mappings
- Strip [1m] when looking up model in catalog to prevent toggle disappearing
- Fix odd page refresh when toggling extended context

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

* fix(ui): remove duplicate import in use-provider-editor

* chore: address PR review feedback - sync comment and unused import

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

* feat(cliproxy): add Opus 4.6 to Antigravity model catalog (#482)

* feat(cliproxy): add Opus 4.6 to Antigravity model catalog

- Add gemini-claude-opus-4-6-thinking as new default agy model
- Update preset mappings to route opus tier to Opus 4.6
- Bump CLIProxy fallback versions to v6.8.2
- Keep Opus 4.5 as previous flagship option

* fix(cliproxy): include oauth-model-alias in config generation

Root cause: CLIProxy config.yaml was missing Opus 4.6 alias because:
1. CLIProxyPlus startup migration is disabled (intentional)
2. CCS config generator never wrote oauth-model-alias section
3. Existing users with outdated aliases got 502 on Opus 4.6

Fix:
- Add DEFAULT_ANTIGRAVITY_ALIASES to config generator
- Generate oauth-model-alias section in config.yaml template
- Preserve claude-api-key and custom aliases during regeneration
- Bump config version to v6 to trigger auto-regeneration
- Update model catalog tests for new model count

* fix(cliproxy): preserve YAML indentation in extractYamlSection

- Replace .trim() with regex to strip only leading/trailing newlines,
  preserving 2-space indent on claude-api-key children
- Skip standalone comments at col 0 in section boundary detection
- Update stale test description (4 → 5 models)

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

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-02-06 20:28:58 -05:00
semantic-release-bot 3e8957af8b chore(release): 7.37.1 [skip ci]
## [7.37.1](https://github.com/kaitranntt/ccs/compare/v7.37.0...v7.37.1) (2026-02-05)

### Bug Fixes

* **cliproxy:** fix discoverExistingAccounts test failures ([759f289](https://github.com/kaitranntt/ccs/commit/759f28911958689ff2b56f03409545b6fec81dec))
* **ui:** display device code for GitHub Copilot OAuth in Dashboard ([13f6c3f](https://github.com/kaitranntt/ccs/commit/13f6c3f14bd0d1c920e339b2486dcd6e37ce50f4)), closes [#460](https://github.com/kaitranntt/ccs/issues/460)

### Code Refactoring

* **cliproxy:** modularize top 4 giant files ([b149e25](https://github.com/kaitranntt/ccs/commit/b149e252ebe3fc355e3e47772de4820810b8000f))
* **ui:** address PR review feedback for device code auth ([a08d0cf](https://github.com/kaitranntt/ccs/commit/a08d0cfece85ebb8c5960ad66ee48131af6ded05))
2026-02-05 22:54:56 +00:00
Kai (Tam Nhu) TranandGitHub aea33ce50b Merge pull request #470 from kaitranntt/dev
feat(release): promote dev to main
2026-02-05 17:53:43 -05:00
github-actions[bot] d8375e7ab1 chore(release): 7.37.0-dev.2 [skip ci] 2026-02-05 20:52:32 +00:00
Kai (Tam Nhu) TranandGitHub 1b69e2f6ca Merge pull request #469 from kaitranntt/fix/460-ghcp-device-code-display
fix(ui): display device code for GitHub Copilot OAuth in Dashboard
2026-02-05 15:51:29 -05:00
kaitranntt a08d0cfece refactor(ui): address PR review feedback for device code auth
- Extract INITIAL_STATE constant to reduce code repetition (DRY)
- Remove duplicate success toast for device code flow
  (useDeviceCode already shows toast via deviceCodeCompleted WebSocket event)
- Replace 7 inline state reset objects with INITIAL_STATE reference
2026-02-05 15:37:18 -05:00
kaitranntt 13f6c3f14b fix(ui): display device code for GitHub Copilot OAuth in Dashboard
For Device Code OAuth providers (ghcp, qwen), switch from /start-url
to /start endpoint which spawns CLIProxyAPI binary and emits WebSocket
events with userCode. DeviceCodeDialog then displays the code properly.

Closes #460
2026-02-05 15:27:30 -05:00
github-actions[bot] 10b73542da chore(release): 7.37.0-dev.1 [skip ci] 2026-02-05 20:16:10 +00:00
Kai (Tam Nhu) TranandGitHub 95aa1d6ce3 Merge pull request #468 from kaitranntt/kai/refactor/top4-giant-files
refactor(cliproxy): modularize top 4 giant files
2026-02-05 15:15:03 -05:00