Commit Graph
3862 Commits
Author SHA1 Message Date
Kai (Tam Nhu) TranandGitHub e8d664362b Merge pull request #1209 from kaitranntt/kai/feat/1206-oauth-callback-traceability
feat(cliproxy): OAuth callback traceability across profiles
2026-05-10 21:53:51 -04:00
Tam Nhu Tran 9d0690e1a8 test(ci): make routing mock complete and websearch trace path env-robust
Two pre-existing test bugs surfaced under CCS CI on the new claw self-
hosted runners but stayed hidden locally:

1. tests/unit/commands/cliproxy-routing-subcommand.test.ts mocks the
   routing-subcommand module with only 3 exports, but
   src/commands/cliproxy/index.ts statically imports 6. Bun resolves
   the static import graph against the mock and reports
     SyntaxError: Export named 'handleRoutingAffinitySet' not found
   for every test in the file. Add the missing 3 exports
   (handleRoutingAffinityStatus, handleRoutingAffinityHelp,
   handleRoutingAffinitySet) to the mock and document why the mock
   must mirror every named export of the target module.

2. tests/unit/hooks/websearch-transformer.test.ts builds the
   "disallowed" trace path from process.cwd() and from os.homedir().
   Both fall under the os.tmpdir() safe-prefix in two real
   environments: CI runners with cwd == /tmp/runner/work/... and Bun
   test isolation that re-roots HOME under tmpdir. The hook treats
   them as safe, writes the trace, and the assertion that the file
   does NOT exist fails. Anchor disallowedTracePath under /etc/...
   instead so it cannot satisfy the tmpdir, /var/log, or
   <CCS_HOME>/.ccs/logs prefixes in any host environment.

Both fixes are independent of the OAuth callback traceability change
that this branch otherwise carries, but ship together so the PR
clears CI on the new runner stack.
2026-05-10 20:23:02 -04:00
Tam Nhu Tran 43ece40c21 Revert "ci(ai-review): move PR-Agent jobs to ubuntu-latest"
This reverts the runs-on change for ai-review.yml. All CI/CD must
stay on home infra (claw, docker LXC, etc); GitHub-hosted runners
are forbidden. The qodo-ai/pr-agent docker action mount issue will
be addressed by either configuring the self-hosted runner image to
use path-identical bind mounts so nested-docker volume sources
resolve correctly, or by switching to native CLI invocation
(pip install pr-agent) instead of the docker action.

Tracked separately; not blocking PR #1209.
2026-05-10 18:30:05 -04:00
Tam Nhu Tran c02c66dcd1 ci(ai-review): move PR-Agent jobs to ubuntu-latest
The qodo-ai/pr-agent Docker action requires the GitHub event payload
at /github/workflow/event.json inside the action container. On
self-hosted runners that themselves run inside a Docker container
(e.g. myoung34/github-runner), the host docker daemon resolves the
volume mount /tmp/runner/work/_temp/_github_workflow:/github/workflow
against the host filesystem, where the runner's /tmp path does not
exist. The action container starts with an empty /github/workflow
mount and fails with FileNotFoundError on event.json.

AI review jobs do not need self-hosted runner access (no bun cache,
no internal infra). Switch both dispatch-review and pr-agent jobs
to ubuntu-latest so the volume mount resolves on the same host where
the action expects it.
2026-05-10 18:26:17 -04:00
Tam Nhu Tran 15e0e62bd8 ci: trigger fresh CI run after claw runner recovery 2026-05-10 18:22:17 -04:00
Tam Nhu Tran 641d492cd6 feat(cliproxy): add OAuth callback traceability across profiles
Introduces structured per-phase tracing for OAuth flows so users see
branch-specific error messages instead of a generic "token not found"
fallback.

- New oauth-trace/ module: recorder, redactor, three sinks
  (in-memory ring buffer, verbose stdout, opt-in JSONL file at
  ~/.ccs/logs/oauth-YYYYMMDD.log mode 0o600 via CCS_OAUTH_LOG_FILE=1)
- Branch-specific diagnostics for: URL-not-displayed,
  callback-not-observed, binary-error, token-exchange-error,
  session-expired, token-file-missing; UNKNOWN fallback preserves
  prior UX
- Trace recorder threaded through oauth-process.ts spawn/stdout/stderr/
  exit lifecycle; SIGINT/SIGTERM cleanup flushes recorder and records
  Cancelled
- Redactor strips code, state, access_token, refresh_token, id_token,
  client_secret, code_verifier, device_code, assertion, subject_token,
  plus Authorization: Bearer headers; covers URL fragments,
  URL-encoded keys, and arrays
- 68 new tests including adversarial regression cases for redactor
  bypass attempts

Phases for paste-callback path and cross-profile failure-matrix
deferred to follow-up #1207.

Closes #1206
2026-05-10 15:12:40 -04:00
github-actions[bot] 3af2cf68d4 chore(release): 7.77.1-dev.10 2026-05-09 14:23:46 -04:00
Kai (Tam Nhu) TranandGitHub 35346a981f fix(ui): keep profile dialog actions visible on small screens (#1204) 2026-05-09 14:20:06 -04:00
github-actions[bot] 2d382d5474 chore(release): 7.77.1-dev.9 2026-05-07 15:37:41 -04:00
Kai (Tam Nhu) TranandGitHub 74d73748ee feat: support Codex fast service-tier aliases
* feat: support Codex fast service-tier aliases

* fix: send Codex fast tier as priority
2026-05-07 15:34:05 -04:00
github-actions[bot] a8d412a0eb chore(release): 7.77.1-dev.8 2026-05-07 13:09:44 -04:00
Kai (Tam Nhu) TranandGitHub 19a50a8dd8 feat: deprecate GitHub Copilot compatibility surfaces (#1196) 2026-05-07 13:06:03 -04:00
github-actions[bot] e2974ede44 chore(release): 7.77.1-dev.7 2026-05-07 11:29:56 -04:00
Kai (Tam Nhu) TranandGitHub 8b681df455 fix: route Cursor auth through browser polling
Closes #1194
2026-05-07 11:25:17 -04:00
github-actions[bot] a95266e4cc chore(release): 7.77.1-dev.6 2026-05-07 11:10:09 -04:00
Kai (Tam Nhu) TranandGitHub 61390e5691 fix(cliproxy): diagnose Gemini Plus OAuth credentials
Closes #1131
2026-05-07 11:05:53 -04:00
github-actions[bot] 5e06010a4e chore(release): 7.77.1-dev.5 2026-05-07 06:17:52 -04:00
Kai (Tam Nhu) TranandGitHub 1b5376239f fix: preserve native Claude passthrough args
Closes #1189
2026-05-07 06:14:12 -04:00
github-actions[bot] 7e958784c4 chore(release): 7.77.1-dev.4 2026-05-06 17:39:30 -04:00
Kai (Tam Nhu) TranandGitHub ba18b68494 fix: count CLIProxy OAuth usage in dashboard stats (#1190)
* fix: count CLIProxy OAuth usage in dashboard stats

* fix: fill cliproxy oauth usage details from logs

* fix: keep mixed cliproxy oauth usage details

* fix: avoid aggregate usage enrichment inflation

* fix: cover oauth source prefixes and full log scans

* fix: preserve distinct oauth usage details

* fix: dedupe oauth log usage by auth identity

* fix: drain usage queue and preserve repeated oauth requests

* fix: guard usage queue drain against repeated full batches

* fix(cliproxy): harden oauth usage stats merging
2026-05-06 17:35:00 -04:00
github-actions[bot] a45b692c7a chore(release): 7.77.1-dev.3 2026-05-05 13:36:45 -04:00
Kai (Tam Nhu) TranandGitHub be9effcce3 feat: clarify account history sync route (#1187)
* feat: clarify account history sync route

* fix: clarify shared context command examples

* fix: report missing bare profile settings
2026-05-05 13:33:04 -04:00
github-actions[bot] 8df43585f4 chore(release): 7.77.1-dev.2 2026-05-05 11:55:33 -04:00
Kai (Tam Nhu) TranandGitHub 407a39c905 Merge pull request #1185 from kaitranntt/kai/fix/1183-openrouter-api-v1-path
fix: route OpenRouter profiles through v1 API
2026-05-05 11:52:01 -04:00
Kai (Tam Nhu) TranandGitHub b05bb30d44 fix(ui): surface Claude Opus 4.7 in Claude picker (#1184) 2026-05-05 11:49:53 -04:00
Tam Nhu Tran dc8bbd85e7 fix: route OpenRouter profiles through v1 API 2026-05-05 11:44:58 -04:00
Tam Nhu Tran 58af9cd501 fix(ui): surface Claude Opus 4.7 in Claude picker 2026-05-05 11:38:00 -04:00
github-actions[bot] fcfd2d279e chore(release): 7.77.1-dev.1 2026-05-04 20:26:33 -04:00
d6b705e6a9 fix(dispatcher): re-inject anthropic auth env for anthropic-compatible api profiles (#1181)
* fix(dispatcher): preserve anthropic auth env for settings profiles on non-proxy path

API profiles whose `ANTHROPIC_BASE_URL` is classified as `'anthropic'`
(anthropic.com, paths containing `/anthropic`, ollama.com) skip the
local OpenAI-compat proxy. The non-proxy launch path stripped
`ANTHROPIC_BASE_URL` / `ANTHROPIC_AUTH_TOKEN` / `ANTHROPIC_API_KEY`
from the subprocess env without re-injecting them, so Claude Code
launched with no routing/auth in `process.env` and failed with
`Not logged in - Please run /login`. The `--settings` env block does
not satisfy Claude Code's auth check.

Pre-existing for `anthropic.com` and `/anthropic` profiles. Newly
broken in v7.77.0 for Ollama Cloud profiles - PR #1175 reclassified
`ollama.com` from `generic-chat-completion-api` to `anthropic`,
moving it from the proxy path onto this broken non-proxy path.

Fix by extending `stripAnthropicRoutingEnv` with an optional
`preserveFrom` parameter. Routing keys present in `preserveFrom`
survive the strip (with values from `preserveFrom`). Settings-type
profiles pass their own `settings.env` as the preserve source so
routing they explicitly supplied is kept while routing leaked from
the parent shell or `global.env` is dropped.

Wired into both call sites:
- `headless-executor.ts` (the `-p` headless executor)
- `settings-flow.ts` (the interactive flow, which then calls
  `execClaude` - whose own `stripAnthropicRoutingEnv` pass on the
  merged env now also takes `envVars` as the preserve source so the
  caller-supplied routing is not stripped a second time before spawn)

Native Anthropic / Bedrock / Vertex profiles are unaffected (they
don't put routing keys in `settings.env`). The OpenAI-compat proxy
path is unaffected because `buildOpenAICompatProxyEnv` overrides
`BASE_URL` / `AUTH_TOKEN` with localhost values and explicitly deletes
`API_KEY` after this strip.

Replaces the Apr 21 defensive double-strip test (which was the
mechanism causing this regression on the interactive path) with a
test asserting the new contract: caller-supplied routing in `envVars`
survives, parent-process routing is still stripped.

* test: harden anthropic settings env preservation coverage

* fix: preserve explicit blank anthropic routing env

---------

Co-authored-by: Tam Nhu Tran <kaitran.ntt@gmail.com>
2026-05-04 20:22:13 -04:00
semantic-release-bot 95ad454ed5 chore(release): 7.77.1 [skip ci]
## [7.77.1](https://github.com/kaitranntt/ccs/compare/v7.77.0...v7.77.1) (2026-05-04)

### Bug Fixes

* harden cursor daemon model fallback ([5f05dea](https://github.com/kaitranntt/ccs/commit/5f05dea5acac9b07aa55b6d66215419cb26320e7))
* preserve arm64 compatibility for CLIProxy assets ([2274cef](https://github.com/kaitranntt/ccs/commit/2274cef6588b01e818b60e042481d31dc2f83dd1))
* preserve CLIProxy platform arch compatibility ([9a687fc](https://github.com/kaitranntt/ccs/commit/9a687fc03cf704a11e804780185ba24153766fd5))
* use aarch64 for CLIProxy arm assets ([190e820](https://github.com/kaitranntt/ccs/commit/190e820f99b100420f987c6669c2d89c0ce51d30))
* use aarch64 for CLIProxy arm assets ([70bf080](https://github.com/kaitranntt/ccs/commit/70bf0806f33bcf33e74dbe7a10b258879dc9f104))

### Styles

* apply prettier formatting ([4acc81c](https://github.com/kaitranntt/ccs/commit/4acc81c08221dbdff79319998ab1e290645ebb45))
2026-05-04 12:14:11 -04:00
Kai (Tam Nhu) TranandGitHub c371ba1044 Merge pull request #1180 from kaitranntt/dev
fix: promote CLIProxy ARM asset patch
2026-05-04 12:11:16 -04:00
github-actions[bot] 6089e1b178 chore(release): 7.77.0-dev.2 2026-05-04 11:59:13 -04:00
Tam Nhu Tran 5f05dea5ac fix: harden cursor daemon model fallback 2026-05-04 11:51:22 -04:00
Tam Nhu Tran 9a687fc03c fix: preserve CLIProxy platform arch compatibility 2026-05-04 11:39:47 -04:00
github-actions[bot] 4a0620d6c5 chore(release): 7.77.0-dev.1 2026-05-04 10:59:26 -04:00
Kai (Tam Nhu) TranandGitHub 190e820f99 fix: use aarch64 for CLIProxy arm assets
Preserve contributor commits and add maintainer compatibility coverage.
2026-05-04 10:55:52 -04:00
Tam Nhu Tran 2274cef658 fix: preserve arm64 compatibility for CLIProxy assets 2026-05-04 10:44:20 -04:00
juwain 4acc81c082 style: apply prettier formatting 2026-05-04 15:36:37 +03:00
juwain 70bf0806f3 fix: use aarch64 for CLIProxy arm assets 2026-05-04 14:59:14 +03:00
semantic-release-bot f1515961c4 chore(release): 7.77.0 [skip ci]
## [7.77.0](https://github.com/kaitranntt/ccs/compare/v7.76.0...v7.77.0) (2026-05-04)

### Features

* **cliproxy:** route plus dashboard to maintained fork ([#1173](https://github.com/kaitranntt/ccs/issues/1173)) ([923683b](https://github.com/kaitranntt/ccs/commit/923683bf303984959f8d5308bfd4c4294651d257))
* support ollama cloud anthropic compatible api ([#1175](https://github.com/kaitranntt/ccs/issues/1175)) ([4e2def6](https://github.com/kaitranntt/ccs/commit/4e2def6769ec71da2063588f867adaea7600df96))

### Bug Fixes

* **analytics:** cache native Codex usage scans ([11b12f1](https://github.com/kaitranntt/ccs/commit/11b12f146d65c32ef6b837b3daddc453d8bca11e))
* **cliproxy:** harden custom local port handling ([3862411](https://github.com/kaitranntt/ccs/commit/3862411bb7ac61fb52a13e53db95ae3b99d49c4b))
* **cliproxy:** refresh upstream model and quota surfaces ([#1158](https://github.com/kaitranntt/ccs/issues/1158)) ([50b0ffb](https://github.com/kaitranntt/ccs/commit/50b0ffba759b7de6fac525e31e5d02bde20b54f3))
* **cliproxy:** respect configured local port instead of hardcoding 8317 ([509bd5d](https://github.com/kaitranntt/ccs/commit/509bd5dbef008e1e0b5cf129744887cee99b9726))
* **config/loader:** break runtime cycle from normalizers to channels-runtime ([b6a49ee](https://github.com/kaitranntt/ccs/commit/b6a49eeab702906f8fb5e81d5022f1348fe4cd17)), closes [#1168](https://github.com/kaitranntt/ccs/issues/1168) [#1135](https://github.com/kaitranntt/ccs/issues/1135)

### Code Refactoring

* **cliproxy/executor:** extract arg-parser from index.ts ([19d2495](https://github.com/kaitranntt/ccs/commit/19d24954be62410b84f0a81f86f05716d5419da5)), closes [#1162](https://github.com/kaitranntt/ccs/issues/1162)
* **cliproxy/executor:** extract auth-coordinator from index.ts ([8b7e7f4](https://github.com/kaitranntt/ccs/commit/8b7e7f4847eec98b39cd1bac883cf4dd5aa30a2d)), closes [#1162](https://github.com/kaitranntt/ccs/issues/1162)
* **cliproxy/executor:** extract browser-setup and account-resolution ([bc48613](https://github.com/kaitranntt/ccs/commit/bc48613bbd06e8ca17d4b8acff466690d152f8ba)), closes [#1162](https://github.com/kaitranntt/ccs/issues/1162)
* **cliproxy/executor:** extract concerns from index.ts ([#1166](https://github.com/kaitranntt/ccs/issues/1166)) ([f7b8540](https://github.com/kaitranntt/ccs/commit/f7b854047e03cb3838fdd0dc4b1f4dc650e1c172)), closes [#1162](https://github.com/kaitranntt/ccs/issues/1162)
* **cliproxy/executor:** extract model-warnings + claude-launcher and polish orchestrator ([09268e7](https://github.com/kaitranntt/ccs/commit/09268e7e3307aea1508505692f83a2131e15f8a9)), closes [#1162](https://github.com/kaitranntt/ccs/issues/1162)
* **cliproxy/executor:** extract proxy-chain-builder from index.ts ([8b39d8a](https://github.com/kaitranntt/ccs/commit/8b39d8a25f3af8e6829b0164932e6a30c71ea20f)), closes [#1162](https://github.com/kaitranntt/ccs/issues/1162)
* **cliproxy/executor:** extract proxy-resolver from index.ts ([968681f](https://github.com/kaitranntt/ccs/commit/968681f261f6d0f00168347f4bdc203a151ef542)), closes [#1162](https://github.com/kaitranntt/ccs/issues/1162)
* **config/loader:** extract defaults-merger, config-getters, polish orchestrator ([f3e79fd](https://github.com/kaitranntt/ccs/commit/f3e79fd4e8c4986eea90fd37ffefac861e8e1598)), closes [#1164](https://github.com/kaitranntt/ccs/issues/1164)
* **config/loader:** extract io-locks, normalizers, yaml-serializer ([315ae19](https://github.com/kaitranntt/ccs/commit/315ae19387e90b55385fe631ca0b3187c8eeacc9)), closes [#1164](https://github.com/kaitranntt/ccs/issues/1164)
* **config/loader:** split unified-config-loader.ts ([#1168](https://github.com/kaitranntt/ccs/issues/1168)) ([2408987](https://github.com/kaitranntt/ccs/commit/240898785942194227b471486f4f05c88114478f)), closes [#1164](https://github.com/kaitranntt/ccs/issues/1164)
* **config:** adopt config-loader-facade across codebase ([#1169](https://github.com/kaitranntt/ccs/issues/1169)) ([df8efc9](https://github.com/kaitranntt/ccs/commit/df8efc985eb9b500b46baabf99a42c7e9aa71b6e)), closes [#1161](https://github.com/kaitranntt/ccs/issues/1161)
* **config:** adopt config-loader-facade across the codebase ([4f6e617](https://github.com/kaitranntt/ccs/commit/4f6e61739c13323484bcb036980e2553e6bb31bd)), closes [#1161](https://github.com/kaitranntt/ccs/issues/1161)
* **dispatcher:** extract bootstrap and pre-dispatch handlers from ccs.ts ([0cf4ad7](https://github.com/kaitranntt/ccs/commit/0cf4ad7b48b644c30d29dbce7fdfd78400320df4)), closes [#1165](https://github.com/kaitranntt/ccs/issues/1165)
* **dispatcher:** extract concerns from ccs.ts ([#1167](https://github.com/kaitranntt/ccs/issues/1167)) ([33de23c](https://github.com/kaitranntt/ccs/commit/33de23c6471b016bd669701bb3512ea900c14a7d)), closes [#1165](https://github.com/kaitranntt/ccs/issues/1165)
* **dispatcher:** extract per-profile flows from ccs.ts ([0910a75](https://github.com/kaitranntt/ccs/commit/0910a75850c149f29493d4a5db0c09486a8ac443)), closes [#1165](https://github.com/kaitranntt/ccs/issues/1165)
* **dispatcher:** extract profile and target detection from ccs.ts ([a807de6](https://github.com/kaitranntt/ccs/commit/a807de6f4cc3d328349075699b5fb27efd3e6e80)), closes [#1165](https://github.com/kaitranntt/ccs/issues/1165)
* **dispatcher:** scaffold src/dispatcher/ and extract pure helpers from ccs.ts ([f759cfe](https://github.com/kaitranntt/ccs/commit/f759cfeaaaef26591060a2746319cc5156287da8)), closes [#1165](https://github.com/kaitranntt/ccs/issues/1165)
* merge facade adoption from [#1169](https://github.com/kaitranntt/ccs/issues/1169) into ccs.ts dispatcher ([70b5dc2](https://github.com/kaitranntt/ccs/commit/70b5dc247f38af45b0cb622ed63dc3a05ae68ce1))
* merge facade adoption from [#1169](https://github.com/kaitranntt/ccs/issues/1169) into executor extraction ([05e1c35](https://github.com/kaitranntt/ccs/commit/05e1c352033afc1c141b60a64d88b6782124b621))
* structural maintainability batch ([#1171](https://github.com/kaitranntt/ccs/issues/1171)) ([b4d55d0](https://github.com/kaitranntt/ccs/commit/b4d55d0fda712f550510b3fc71bfc76b8f9fec40)), closes [#1135](https://github.com/kaitranntt/ccs/issues/1135)
2026-05-03 23:23:53 -04:00
Kai (Tam Nhu) TranandGitHub 0132b299a2 Merge pull request #1176 from kaitranntt/dev
feat: promote dev to main
2026-05-03 23:21:00 -04:00
github-actions[bot] adb1fff50c chore(release): 7.76.0-dev.6 2026-05-03 22:33:02 -04:00
4e2def6769 feat: support ollama cloud anthropic compatible api (#1175)
* feat(droid-provider): support ollama cloud anthropic compatible api

* fix(droid-provider): move ollama.com to anthropic block to prevent model inference override

* fix(droid-provider): move pathname-based generic checks before host-based anthropic check

* test(proxy): cover ollama cloud native routing boundaries

---------

Co-authored-by: Tam Nhu Tran <kaitran.ntt@gmail.com>
2026-05-03 22:28:38 -04:00
github-actions[bot] 0070f79b90 chore(release): 7.76.0-dev.5 2026-05-03 14:37:47 -04:00
Kai (Tam Nhu) TranandGitHub ea46dd0a54 Merge pull request #1170 from roeseth/fix/cliproxy-local-port-config
fix(cliproxy): respect configured local port instead of hardcoding 8317
2026-05-03 14:34:14 -04:00
Tam Nhu Tran 3862411bb7 fix(cliproxy): harden custom local port handling 2026-05-03 14:07:31 -04:00
Tam Nhu Tran a7c10be72e Merge origin/dev into fix/cliproxy-local-port-config
Resolve the dispatcher and dashboard conflicts from origin/dev while preserving the configured local CLIProxy port behavior. Also harden lifecycle port fallback and wait for the actual stopped port during binary installs.
2026-05-03 13:56:43 -04:00
github-actions[bot] 4aca635fbe chore(release): 7.76.0-dev.4 2026-05-03 13:04:37 -04:00
Kai (Tam Nhu) TranandGitHub 923683bf30 feat(cliproxy): route plus dashboard to maintained fork (#1173) 2026-05-03 13:01:04 -04:00
github-actions[bot] 0f36f7c845 chore(release): 7.76.0-dev.3 2026-05-03 12:28:26 -04:00