@chroxy/server 0.11.0 → 0.11.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (317) hide show
  1. package/CONFIG.md +204 -18
  2. package/README.md +2 -2
  3. package/hooks/claude-native-route-check.mjs +17 -0
  4. package/hooks/permission-hook.sh +166 -11
  5. package/package.json +16 -12
  6. package/sidecar/Dockerfile +1 -1
  7. package/sidecar/PROTOCOL.md +9 -1
  8. package/sidecar/agent.js +102 -10
  9. package/sidecar/package-lock.json +3 -3
  10. package/src/acp-config.js +206 -0
  11. package/src/acp-session.js +954 -0
  12. package/src/activity-registry.js +110 -5
  13. package/src/agent-connections.js +293 -0
  14. package/src/agent-control/client.js +1616 -0
  15. package/src/agent-control/events.js +547 -0
  16. package/src/agent-control/local-connection.js +275 -0
  17. package/src/agent-control/mcp-server.js +545 -0
  18. package/src/anthropic-compatible-config.js +29 -4
  19. package/src/anthropic-compatible-session.js +15 -6
  20. package/src/anthropic-openai-shim.js +0 -1
  21. package/src/archive-continuation.js +164 -0
  22. package/src/assistant-response.js +24 -0
  23. package/src/auth-probes.js +120 -13
  24. package/src/background-shell-tracker.js +27 -0
  25. package/src/base-session.js +1203 -36
  26. package/src/bearer-recheck.js +49 -0
  27. package/src/billing-budget.js +19 -0
  28. package/src/billing-class.js +40 -7
  29. package/src/binary-provenance-trust.js +11 -5
  30. package/src/bound-client-policy.js +279 -0
  31. package/src/built-in-tools/bash-exec.js +46 -7
  32. package/src/built-in-tools/file-ops.js +69 -5
  33. package/src/built-in-tools/tool-transforms.js +1113 -13
  34. package/src/byok-compose-state.js +6 -9
  35. package/src/byok-credentials.js +2 -3
  36. package/src/byok-mcp-client.js +92 -7
  37. package/src/byok-mcp-config.js +628 -121
  38. package/src/byok-mcp-fleet.js +49 -7
  39. package/src/byok-mcp-oauth-store.js +18 -16
  40. package/src/byok-mcp-trust.js +3 -3
  41. package/src/byok-session.js +650 -175
  42. package/src/byok-tool-executor.js +2662 -26
  43. package/src/byok-tools.js +9 -2
  44. package/src/channels/chroxy-channel-server.js +2 -3
  45. package/src/checkpoint-manager.js +64 -46
  46. package/src/claude-channel-session.js +16 -10
  47. package/src/claude-model-catalog.js +131 -16
  48. package/src/claude-model-refresh.js +385 -0
  49. package/src/claude-model-request.js +103 -0
  50. package/src/claude-stream-parser.js +53 -3
  51. package/src/claude-tui/diagnostic-tail.js +83 -0
  52. package/src/claude-tui/form-driver.js +44 -7
  53. package/src/claude-tui/model-error.js +41 -0
  54. package/src/claude-tui/pty-driver.js +211 -88
  55. package/src/claude-tui/sanitize-question-payload.js +109 -0
  56. package/src/claude-tui/usage-limit.js +239 -0
  57. package/src/claude-tui-session.js +3513 -287
  58. package/src/claude-tui-tool-response.js +300 -0
  59. package/src/cli/agent-control-cmd.js +65 -0
  60. package/src/cli/config-cmd.js +4 -4
  61. package/src/cli/config-dir-cmd.js +234 -0
  62. package/src/cli/deploy-cmd.js +45 -10
  63. package/src/cli/doctor-cmd.js +7 -3
  64. package/src/cli/init-cmd.js +15 -16
  65. package/src/cli/providers-cmd.js +3 -3
  66. package/src/cli/schedule-cmd.js +68 -39
  67. package/src/cli/server-cmd.js +48 -1
  68. package/src/cli/service-cmd.js +33 -10
  69. package/src/cli/session-cmd.js +227 -74
  70. package/src/cli/shared.js +162 -11
  71. package/src/cli/tokens-cmd.js +4 -5
  72. package/src/cli/tunnel-cmd.js +255 -24
  73. package/src/cli/worktree-gc-cmd.js +2 -2
  74. package/src/cli-session.js +1066 -121
  75. package/src/cli.js +4 -0
  76. package/src/codex-app-server-client.js +36 -3
  77. package/src/codex-app-server-session.js +1454 -79
  78. package/src/codex-bundled-client.js +66 -0
  79. package/src/codex-model-catalog.js +548 -0
  80. package/src/codex-model-rejections.js +87 -0
  81. package/src/codex-native-resume.js +104 -0
  82. package/src/codex-protocol-capabilities.js +188 -0
  83. package/src/codex-session.js +450 -27
  84. package/src/config-dir-migration.js +444 -0
  85. package/src/config-dir.js +108 -0
  86. package/src/config.js +286 -26
  87. package/src/connection-authority.js +48 -0
  88. package/src/connection-info.js +5 -9
  89. package/src/connection-locality.js +60 -0
  90. package/src/container-liveness-monitor.js +189 -0
  91. package/src/continuation-metadata-worker.js +17 -0
  92. package/src/continuations.js +114 -0
  93. package/src/control-room/host-prune.js +5 -0
  94. package/src/control-room/integrations.js +7 -20
  95. package/src/control-room/skills-inventory.js +2 -2
  96. package/src/conversation-scanner.js +40 -18
  97. package/src/conversation-scope.js +59 -39
  98. package/src/conversation-search.js +24 -22
  99. package/src/credential-store.js +23 -19
  100. package/src/daemon-commit.js +92 -0
  101. package/src/daemon-idle-state.js +171 -0
  102. package/src/daemon-update-status.js +314 -0
  103. package/src/dashboard-build.js +70 -0
  104. package/src/declared-status.js +90 -0
  105. package/src/deepseek-credentials.js +2 -3
  106. package/src/dev-preview.js +169 -182
  107. package/src/device-preferences.js +2 -2
  108. package/src/diff-parser.js +87 -0
  109. package/src/discord-credentials.js +2 -3
  110. package/src/docker-byok-pool.js +3 -1
  111. package/src/docker-byok-session.js +678 -78
  112. package/src/docker-image-allowlist.js +23 -1
  113. package/src/docker-sdk-session.js +172 -3
  114. package/src/docker-session.js +284 -10
  115. package/src/doctor.js +767 -61
  116. package/src/edited-input.js +264 -0
  117. package/src/environment-manager.js +175 -36
  118. package/src/environments/authority.js +95 -0
  119. package/src/environments/backends/container-claude-spawn.js +94 -0
  120. package/src/environments/backends/docker.js +31 -10
  121. package/src/environments/backends/k8s.js +49 -24
  122. package/src/environments/destroy-with-sessions.js +142 -0
  123. package/src/event-ingest.js +118 -13
  124. package/src/event-normalizer.js +151 -233
  125. package/src/gemini-session.js +81 -5
  126. package/src/handler-utils.js +535 -68
  127. package/src/handlers/checkpoint-handlers.js +39 -4
  128. package/src/handlers/control-room-handlers.js +51 -11
  129. package/src/handlers/conversation-handlers.js +469 -56
  130. package/src/handlers/daemon-update-handlers.js +81 -0
  131. package/src/handlers/evaluator-handlers.js +14 -1
  132. package/src/handlers/feature-handlers.js +186 -69
  133. package/src/handlers/file-handlers.js +57 -13
  134. package/src/handlers/input-handlers.js +685 -48
  135. package/src/handlers/orchestration-handlers.js +3 -3
  136. package/src/handlers/scheduler-handlers.js +88 -14
  137. package/src/handlers/session-handlers.js +542 -20
  138. package/src/handlers/session-pr-status-handlers.js +283 -0
  139. package/src/handlers/session-pr-threads-handlers.js +247 -0
  140. package/src/handlers/settings-handlers.js +330 -42
  141. package/src/handlers/skills-handlers.js +13 -4
  142. package/src/handlers/summarize-handlers.js +32 -1
  143. package/src/handlers/survey-throttle.js +380 -0
  144. package/src/health-proof.js +40 -0
  145. package/src/history-page.js +104 -0
  146. package/src/http-routes.js +127 -8
  147. package/src/ide/search.js +24 -6
  148. package/src/ide/symbols.js +20 -6
  149. package/src/input-context.js +117 -0
  150. package/src/instruction-policy-compiler.js +229 -0
  151. package/src/instruction-policy.js +250 -0
  152. package/src/jsonl-reader.js +289 -82
  153. package/src/jsonl-subprocess-session.js +92 -8
  154. package/src/keychain.js +1 -1
  155. package/src/logger.js +63 -17
  156. package/src/mailbox-route.js +11 -22
  157. package/src/message-wire.js +386 -0
  158. package/src/model-discovery.js +43 -3
  159. package/src/models.js +1276 -174
  160. package/src/notification-prefs.js +12 -4
  161. package/src/notifications/discord-billing-sink.js +22 -5
  162. package/src/notifications/discord-ci-sink.js +243 -0
  163. package/src/notifications/discord-webhook-client.js +71 -0
  164. package/src/notifications/discord-webhook-sink.js +64 -23
  165. package/src/notifications/expo-push-sink.js +85 -6
  166. package/src/notifications/ready-body.js +16 -5
  167. package/src/ollama-session.js +34 -2
  168. package/src/orchestration/build-manager.js +9 -2
  169. package/src/orchestration/git-ops.js +41 -7
  170. package/src/orchestration/orchestration-manager.js +80 -33
  171. package/src/orchestration/permission-gate.js +13 -1
  172. package/src/orchestration/run-model.js +2 -1
  173. package/src/orchestration/turn-driver.js +44 -20
  174. package/src/orphan-reaper.js +413 -0
  175. package/src/outgoing-policy.js +183 -0
  176. package/src/pairing.js +92 -13
  177. package/src/path-hash-trust-ledger.js +642 -25
  178. package/src/permission-deadlines.js +82 -0
  179. package/src/permission-floor.js +1357 -42
  180. package/src/permission-hook.js +180 -69
  181. package/src/permission-manager.js +712 -83
  182. package/src/permission-mode-support.js +35 -0
  183. package/src/permission-resolver.js +122 -8
  184. package/src/permission-scope.js +43 -0
  185. package/src/platform.js +159 -43
  186. package/src/preview-ingress.js +54 -0
  187. package/src/preview-target.js +213 -0
  188. package/src/prompt-evaluator.js +34 -4
  189. package/src/provider-customization.js +180 -0
  190. package/src/providers.js +207 -4
  191. package/src/push.js +30 -4
  192. package/src/question-route-map.js +130 -0
  193. package/src/redaction.js +360 -8
  194. package/src/roster-broadcast.js +186 -0
  195. package/src/scheduled-task-store.js +318 -26
  196. package/src/scheduler.js +73 -3
  197. package/src/sdk-session.js +2060 -187
  198. package/src/server-cli/preview-shutdown.js +22 -0
  199. package/src/server-cli/push-notification-handler.js +11 -2
  200. package/src/server-cli/server-orchestrator.js +28 -5
  201. package/src/server-cli-child.js +33 -18
  202. package/src/server-cli.js +524 -38
  203. package/src/server-identity.js +15 -11
  204. package/src/service.js +396 -25
  205. package/src/session-archive-limits.js +15 -0
  206. package/src/session-archive.js +1029 -0
  207. package/src/session-busy-state.js +72 -0
  208. package/src/session-ci-watcher.js +926 -0
  209. package/src/session-context.js +7 -2
  210. package/src/session-manager.js +3491 -312
  211. package/src/session-message-history.js +722 -16
  212. package/src/session-pr-status.js +654 -0
  213. package/src/session-pr-threads.js +271 -0
  214. package/src/session-preset-trust.js +3 -3
  215. package/src/session-preset.js +10 -5
  216. package/src/session-state-persistence.js +94 -17
  217. package/src/session-timeout-manager.js +20 -0
  218. package/src/session-token-store.js +17 -8
  219. package/src/session-wake.js +240 -0
  220. package/src/shell-approval-info.js +2 -2
  221. package/src/shell-approval-store.js +3 -1
  222. package/src/skills-loader.js +7 -4
  223. package/src/skills-manager.js +2 -2
  224. package/src/skills-trust.js +95 -13
  225. package/src/skills-usage.js +2 -3
  226. package/src/snapshots-store.js +2 -3
  227. package/src/statusline.js +23 -11
  228. package/src/summarize-session.js +51 -4
  229. package/src/supervisor.js +22 -11
  230. package/src/sweep-stale-provider-dirs.js +95 -0
  231. package/src/thinking-level-wire.js +39 -0
  232. package/src/thinking-stream.js +179 -0
  233. package/src/tool-result.js +61 -0
  234. package/src/transcript-sources.js +109 -0
  235. package/src/transcript-tasks.js +372 -25
  236. package/src/trusted-file-read.js +302 -0
  237. package/src/tunnel/base.js +0 -8
  238. package/src/tunnel/cloudflare.js +34 -31
  239. package/src/tunnel/index.js +9 -0
  240. package/src/tunnel/preview.js +64 -0
  241. package/src/turn-outcome.js +137 -0
  242. package/src/usage-normalize.js +9 -5
  243. package/src/user-shell-session.js +59 -5
  244. package/src/utils/agent-sdk-version.js +107 -0
  245. package/src/utils/argv-safety.js +741 -0
  246. package/src/utils/auth-cause.js +60 -0
  247. package/src/utils/binary-package-manifest.js +597 -0
  248. package/src/utils/binary-version.js +224 -0
  249. package/src/utils/bounded-regex-worker.js +25 -0
  250. package/src/utils/bounded-regex.js +153 -0
  251. package/src/utils/claude-binary.js +43 -0
  252. package/src/utils/claude-config-dir.js +245 -0
  253. package/src/utils/claude-login-command.js +16 -0
  254. package/src/utils/claude-native-route.js +81 -0
  255. package/src/utils/componentwise-resolver.js +133 -37
  256. package/src/utils/deploy-control-files.js +87 -0
  257. package/src/utils/exec-failure-reason.js +21 -0
  258. package/src/utils/git-repo.js +42 -0
  259. package/src/utils/is-entry-point.js +137 -0
  260. package/src/utils/node-pty-probe.js +95 -0
  261. package/src/utils/node-pty-support.js +118 -0
  262. package/src/utils/opened-file-path.js +167 -0
  263. package/src/utils/path-containment.js +165 -0
  264. package/src/utils/permission-mode-sidecar.js +51 -0
  265. package/src/utils/preflight.js +360 -16
  266. package/src/utils/read-limiter.js +217 -0
  267. package/src/utils/regular-file.js +375 -0
  268. package/src/utils/safe-regex.js +113 -0
  269. package/src/utils/small-file.js +129 -0
  270. package/src/utils/spawn-env.js +189 -4
  271. package/src/utils/stale-session-dirs.js +182 -0
  272. package/src/utils/stat-identity.js +43 -0
  273. package/src/utils/verify-provenance.js +406 -13
  274. package/src/web-task-manager.js +256 -16
  275. package/src/worktree-gc.js +7 -2
  276. package/src/ws-auth.js +69 -21
  277. package/src/ws-broadcaster.js +14 -2
  278. package/src/ws-client-manager.js +16 -1
  279. package/src/ws-client-sender.js +7 -0
  280. package/src/ws-file-ops/browser.js +331 -58
  281. package/src/ws-file-ops/common.js +320 -14
  282. package/src/ws-file-ops/git.js +395 -42
  283. package/src/ws-file-ops/index.js +2 -0
  284. package/src/ws-file-ops/memory.js +137 -35
  285. package/src/ws-file-ops/open-nofollow.js +354 -0
  286. package/src/ws-file-ops/reader.js +571 -113
  287. package/src/ws-forwarding.js +329 -39
  288. package/src/ws-handler-context.js +70 -2
  289. package/src/ws-history.js +940 -172
  290. package/src/ws-message-handlers.js +17 -1
  291. package/src/ws-permissions.js +307 -37
  292. package/src/ws-schemas.js +5 -0
  293. package/src/ws-server.js +643 -96
  294. package/sidecar/node_modules/.package-lock.json +0 -29
  295. package/sidecar/node_modules/ws/LICENSE +0 -20
  296. package/sidecar/node_modules/ws/README.md +0 -548
  297. package/sidecar/node_modules/ws/browser.js +0 -8
  298. package/sidecar/node_modules/ws/index.js +0 -22
  299. package/sidecar/node_modules/ws/lib/buffer-util.js +0 -131
  300. package/sidecar/node_modules/ws/lib/constants.js +0 -19
  301. package/sidecar/node_modules/ws/lib/event-target.js +0 -292
  302. package/sidecar/node_modules/ws/lib/extension.js +0 -203
  303. package/sidecar/node_modules/ws/lib/limiter.js +0 -55
  304. package/sidecar/node_modules/ws/lib/permessage-deflate.js +0 -528
  305. package/sidecar/node_modules/ws/lib/receiver.js +0 -706
  306. package/sidecar/node_modules/ws/lib/sender.js +0 -602
  307. package/sidecar/node_modules/ws/lib/stream.js +0 -161
  308. package/sidecar/node_modules/ws/lib/subprotocol.js +0 -62
  309. package/sidecar/node_modules/ws/lib/validation.js +0 -152
  310. package/sidecar/node_modules/ws/lib/websocket-server.js +0 -554
  311. package/sidecar/node_modules/ws/lib/websocket.js +0 -1393
  312. package/sidecar/node_modules/ws/package.json +0 -70
  313. package/sidecar/node_modules/ws/wrapper.mjs +0 -21
  314. package/src/dashboard-next/dist/assets/index-C2ipeGlq.js +0 -111
  315. package/src/dashboard-next/dist/assets/index-DM-_dISG.css +0 -1
  316. package/src/dashboard-next/dist/index.html +0 -13
  317. package/src/dashboard-next/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
package/CONFIG.md CHANGED
@@ -11,6 +11,67 @@ Configuration values are resolved in the following order (highest priority first
11
11
  3. **Config file** - `~/.chroxy/config.json` (created with `npx chroxy init`)
12
12
  4. **Defaults** - Built-in default values
13
13
 
14
+ ## The config root (`CHROXY_CONFIG_DIR`)
15
+
16
+ `~/.chroxy` is the **default** config/state root, not a fixed one.
17
+ `CHROXY_CONFIG_DIR` relocates the **entire** root, so **every `~/.chroxy/…` path
18
+ in this document — and in every other doc — means `$CHROXY_CONFIG_DIR/…` when the
19
+ variable is set.** That covers `config.json`, `credentials.json`, the daemon
20
+ identity key, `session-state.json`, `logs/`, `pages/`, `worktrees/`,
21
+ `snapshots/`, and the trust ledgers.
22
+
23
+ ```bash
24
+ CHROXY_CONFIG_DIR=/mnt/state npx chroxy start # reads /mnt/state/config.json
25
+ ```
26
+
27
+ Three properties are worth knowing before you set it:
28
+
29
+ - **It must be an absolute path.** A relative value is **refused**, not resolved:
30
+ the daemon warns and falls back to `~/.chroxy`. Because the root is read per
31
+ filesystem call, resolving a relative value would scatter `credentials.json`,
32
+ the identity key and the trust ledgers into whatever directory the daemon
33
+ happened to be launched from — a git working tree, if you ran `chroxy start`
34
+ from a repo. Absoluteness is Node's `path.isAbsolute()`, which on **Windows**
35
+ also accepts a root-relative `\data` or `/data` (no drive letter needed); the
36
+ desktop app matches that rule deliberately rather than using Rust's stricter
37
+ one, since the two disagreeing is itself a split-brain (#7241).
38
+ - **It is env-only, and read directly** rather than through the merge layer
39
+ (see [Environment variable names](#environment-variable-names)). It cannot be a
40
+ `config.json` key, because it is what locates `config.json` in the first place.
41
+ - **Relocating an existing install does not move your state.** The daemon warns
42
+ at startup, `chroxy doctor` reports it, and the copy is opt-in:
43
+
44
+ ```bash
45
+ chroxy config-dir status # resolved root + anything stranded at ~/.chroxy
46
+ chroxy config-dir migrate --yes # copy the stranded state forward (never overwrites)
47
+ ```
48
+
49
+ The copy is deliberately opt-in: the daemon cannot tell "just relocated, wants
50
+ their state" from "deliberately clean root", and copying an identity key into a
51
+ possibly shared, synced or bind-mounted volume is the operator's call (#7240).
52
+
53
+ If the second root is deliberate (an isolated preview daemon beside your real
54
+ `~/.chroxy`), `chroxy config-dir ack` records the entries currently left there
55
+ in `config-dir-ack.json` inside the relocated root, and the startup warning and
56
+ `chroxy doctor` stay quiet about exactly those. It is a snapshot, not a flag:
57
+ an entry whose name was not acknowledged warns again (re-running `ack`
58
+ replaces the snapshot), and an unreadable or malformed file counts as no
59
+ acknowledgement (#7244). Run it with `CHROXY_CONFIG_DIR` set to the relocated
60
+ root; the warning prints the exact command.
61
+
62
+ Internally the root has exactly one resolver — `configDir()` / `configPath()` in
63
+ [`src/config-dir.js`](src/config-dir.js) — and both read the environment **per
64
+ call**, because a module-scope `const` freezes at import and silently ignores the
65
+ override. That is not hypothetical: it relocated only half the daemon's state for
66
+ as long as the copies existed (#7052). A CI lint
67
+ (`scripts/lint-config-dir.mjs`) keeps it to one resolver.
68
+
69
+ Two live resolvers sit outside that lint's walk by design, and both honour the
70
+ variable: [`packages/protocol/src/project.ts`](../protocol/src/project.ts) (the
71
+ worktrees root) and [`scripts/docker-entrypoint.sh`](../../scripts/docker-entrypoint.sh).
72
+ `packages/claude-hooks` is zero-runtime-dependency and cannot import the server's
73
+ accessor, so it carries one reviewed copy of the same `||` fallback.
74
+
14
75
  ## Configuration Keys
15
76
 
16
77
  Every key below is a real entry in `CONFIG_SCHEMA`
@@ -81,9 +142,10 @@ of `~/.chroxy/config.json` regardless of which group it appears in.
81
142
 
82
143
  | Key | Type | CLI Flag | Environment Variable | Description |
83
144
  |-----|------|----------|---------------------|-------------|
84
- | `provider` | string | `--provider <name>` | `CHROXY_PROVIDER` | Default session backend. Allowed values: `claude-tui` (default, #5819), `claude-sdk`, `claude-cli`, `claude-channel` (research preview), `gemini`, `codex`, plus `docker-sdk` / `docker-cli` when Docker environments are enabled. The `claude-channel` provider is a research-preview scaffold whose `start()` currently throws — selectable for `chroxy doctor` / registry inspection but not yet runnable (bridge lands in #3954). See [../../docs/providers.md](../../docs/providers.md) for per-provider setup, env vars (`ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `GEMINI_API_KEY`, …), and the capability matrix. |
145
+ | `provider` | string | `--provider <name>` | `CHROXY_PROVIDER` | Default session backend. Allowed values: `claude-sdk` (default, #8266), `claude-tui`, `claude-cli`, `claude-channel` (research preview), `gemini`, `codex`, plus `docker-sdk` / `docker-cli` when Docker environments are enabled. The `claude-channel` provider is a research-preview scaffold whose `start()` currently throws — selectable for `chroxy doctor` / registry inspection but not yet runnable (bridge lands in #3954). See [../../docs/providers.md](../../docs/providers.md) for per-provider setup, env vars (`ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `GEMINI_API_KEY`, …), and the capability matrix. |
85
146
  | `model` | string | `--model <name>` | `CHROXY_MODEL` | Model to use. Provider-specific — e.g. `claude-sonnet-4`/`haiku` for Claude, `gemini-2.5-pro` for Gemini, `gpt-5.4` for Codex. |
86
- | `providers` | array \| object | - | `CHROXY_PROVIDERS` | Two forms. **Array** (legacy, written by `chroxy init`): informational list of provider ids the user opted into. **Object** (#5419): `providers.anthropicCompatible` is an array of config-driven Anthropic-compatible endpoint entries (Z.ai GLM, Moonshot Kimi, MiniMax, LM Studio, llama.cpp, vLLM, OpenRouter, custom) — each entry `{ id, label?, baseUrl, apiKeyEnv?, credentialsKey?, defaultModel, models?, pricing?, contextWindow? }` registers a first-class provider at startup, selectable via `provider` / `--provider <id>`. API keys are **never** inlined: `apiKeyEnv` names an env var, `credentialsKey` names a `~/.chroxy/credentials.json` field (mode `0600`); entries carrying literal secrets are rejected. Invalid entries are warned about and skipped; valid siblings still register. The object form carries two more sub-blocks: `providers.openaiCompatible` — the identical entry shape for endpoints that speak the **OpenAI Chat Completions** API instead (OpenAI, OpenRouter, LM Studio, vLLM, llama.cpp, Together, Groq, DeepInfra, custom), where `baseUrl` is an OpenAI API base typically ending in `/v1` — and `providers.allowAnyModel`, see [Unrestricted provider models](#unrestricted-provider-models-providersallowanymodel). See [Anthropic-compatible endpoints](../../docs/providers.md#anthropic-compatible-endpoints-config-driven) and [OpenAI-compatible endpoints](../../docs/providers.md#openai-compatible-endpoints-config-driven). |
147
+ | `providers` | array \| object | - | `CHROXY_PROVIDERS` | Two forms. **Array** (legacy, written by `chroxy init`): informational list of provider ids the user opted into. **Object** (#5419): `providers.anthropicCompatible` is an array of config-driven Anthropic-compatible endpoint entries (Z.ai GLM, Moonshot Kimi, MiniMax, LM Studio, llama.cpp, vLLM, OpenRouter, custom) — each entry `{ id, label?, baseUrl, apiKeyEnv?, credentialsKey?, defaultModel, models?, pricing?, contextWindow?, modelDiscovery? }` registers a first-class provider at startup, selectable via `provider` / `--provider <id>`. An entry opts into live model-catalog discovery with `modelDiscovery: { "url": "https://…", "format": "openrouter" }` (`"openai"` for a bare `/v1/models` id list, e.g. LM Studio or vLLM): the discovered catalog feeds the model picker and replaces the static model allowlist for validation — see [Model discovery](../../docs/providers.md#model-discovery). API keys are **never** inlined: `apiKeyEnv` names an env var, `credentialsKey` names a `~/.chroxy/credentials.json` field (mode `0600`); entries carrying literal secrets are rejected. Invalid entries are warned about and skipped; valid siblings still register. The object form carries three more sub-blocks: `providers.openaiCompatible` — the identical entry shape for endpoints that speak the **OpenAI Chat Completions** API instead (OpenAI, OpenRouter, LM Studio, vLLM, llama.cpp, Together, Groq, DeepInfra, custom), where `baseUrl` is an OpenAI API base typically ending in `/v1`; `providers.acp` (#7319) — an array of config-driven **Agent Client Protocol** agents, each entry `{ id, label?, command, args?, env? }` spawning an arbitrary ACP-speaking agent over stdio, permissions **denied by default** (no bridge yet — #7320); and `providers.allowAnyModel`, see [Unrestricted provider models](#unrestricted-provider-models-providersallowanymodel). See [Anthropic-compatible endpoints](../../docs/providers.md#anthropic-compatible-endpoints-config-driven), [OpenAI-compatible endpoints](../../docs/providers.md#openai-compatible-endpoints-config-driven), and [ACP agents](../../docs/providers.md#acp-agents-config-driven). |
148
+ | `agentConnections` | array | - | *(unmapped — see [note](#environment-variable-names))* | Explicit, non-secret agent routes shown in the existing session-creation provider picker. Each entry is `{ id, label, provider?, runtime, authRoute, accountRef?, credentialKey?, inferenceLocation? }`; see [Agent connections](#agent-connections). |
87
149
  | `legacyCli` | boolean | `--legacy-cli` | `CHROXY_LEGACY_CLI` | Legacy shorthand that maps to `provider: "claude-cli"` when no explicit `provider` is set. Prefer setting `provider` directly; an explicit `provider` always wins. |
88
150
 
89
151
  ### Permissions and security gates
@@ -93,9 +155,9 @@ of `~/.chroxy/config.json` regardless of which group it appears in.
93
155
  | `allowedTools` | array | `--allowed-tools <list>` | `CHROXY_ALLOWED_TOOLS` | Auto-approved tools (CLI mode) |
94
156
  | `dangerouslySkipPermissions` | boolean | `--dangerously-skip-permissions` | `CHROXY_DANGEROUSLY_SKIP_PERMISSIONS` | Server-wide default for the per-session skip-permissions flag (#4246, #4384). Honoured only by the `claude-tui` provider — spawns claude with `--dangerously-skip-permissions` and elides chroxy's permission hook. Off by default. Legacy alias `skipPermissions` (config key) and `CHROXY_SKIP_PERMISSIONS` (env var) are still honoured for one deprecation window and emit a warning at boot — rename to the canonical key. See [Skip permissions (TUI provider)](#skip-permissions-tui-provider) below. |
95
157
  | `skipPermissions` | boolean | - | `CHROXY_SKIP_PERMISSIONS` | **Deprecated** alias for `dangerouslySkipPermissions`, kept in the schema so an existing config file still validates cleanly. Setting it emits a rename warning at boot even when the canonical key is also present. See [Skip permissions (TUI provider)](#skip-permissions-tui-provider). |
96
- | `allowAutoPermissionMode` | boolean | - | *(unmapped — see [note](#environment-variable-names))* | Gates the `auto` permission mode (bypass every permission check). Off by default so fresh installs are secure-by-default: a client that tries to flip to `auto` is rejected with `AUTO_MODE_DISABLED_BY_CONFIG`. Opting in is a deliberate edit on the dev machine — physical access stands in for real user confirmation. |
158
+ | `allowAutoPermissionMode` | boolean | - | *(unmapped — see [note](#environment-variable-names))* | Gates the `auto` permission mode (bypass every permission check short of the protected-path / secret-read floor) on every provider that offers it — Claude and, since #8619, Codex app-server. Off by default so fresh installs are secure-by-default: a client that tries to flip to `auto` is rejected with `AUTO_MODE_DISABLED_BY_CONFIG`, and the daemon advertises the gate as `auth_ok.capabilities.autoPermissionMode` so clients disable Auto with that reason. Opting in is a deliberate edit on the dev machine — physical access stands in for real user confirmation. |
97
159
  | `userShell` | object | - | *(unmapped — see [note](#environment-variable-names))* | Gate for the embedded user-shell terminal, which spawns the operator's `$SHELL` (arbitrary code execution on the dev machine, reachable through the tunnel). `{ enabled?: boolean, requireApproval?: boolean }`, both **off by default** — creating a `user-shell` session is rejected with `USER_SHELL_DISABLED` until `enabled` is literally `true`. `requireApproval: true` additionally demands host-local approval per spawn (#6277). See [Nested config blocks](#nested-config-blocks-at-a-glance). |
98
- | `workspaceRoots` | array | - | *(unmapped — see [note](#environment-variable-names))* | Allowlist of absolute directory paths a session may use as its working directory. When set and non-empty, a session `cwd` must resolve (via `realpath`) inside one of these roots or creation is rejected. When unset/empty, the legacy "must be inside `$HOME`" check applies instead. The credential-directory deny-list is defence-in-depth and stays active in **both** modes. |
160
+ | `workspaceRoots` | array | - | *(unmapped — see [note](#environment-variable-names))* | Allowlist of absolute directory paths a session may use as its working directory. When set and non-empty, a session `cwd` must resolve (via `realpath`) inside one of these roots or creation is rejected. When unset/empty, the legacy "must be inside `$HOME`" check applies instead. Paths are compared in the spelling the filesystem reports, so a root typed in another letter case still matches on a case-insensitive volume. The credential-directory deny-list is defence-in-depth and stays active in **both** modes. It recognises a protected directory (the credential entries under `$HOME` and the config directory) by the filesystem object, not by its spelling, so another spelling, a symlink (for example `~/.ssh -> ~/dotfiles/ssh`), or a second mount path that passes through the protected directory itself is covered; a second path to a subdirectory of one (for example a bind mount of `~/.config/gcloud` elsewhere) is not. An entry that is missing or dangling is skipped. An entry or config directory that exists but cannot be checked (and likewise a parent directory of the working directory that cannot be stat'd) makes every session start refuse, whatever its working directory, with a message naming it, until it is fixed or removed. |
99
161
  | `allowedDockerImages` | array | - | *(unmapped — see [note](#environment-variable-names))* | Allowlist of Docker image patterns `create_environment` may use. Each entry is an exact image name or a prefix pattern such as `mcr.microsoft.com/devcontainers/*`. When set, a client-supplied image must match at least one entry or the request is rejected with `DOCKER_IMAGE_NOT_ALLOWED`. When unset, a built-in default list of common base images applies. |
100
162
  | `binaryProvenance` | object | - | `CHROXY_BINARY_PROVENANCE`, `CHROXY_BINARY_SIGNATURE_GATE` | Opt-in provenance verification for spawned provider binaries (`claude`, `codex`, `gemini`, `cloudflared`). `mode` (`off`/`warn`/`block`) drives a cross-platform SHA-256 pin ledger; `signatureGate` (boolean) toggles a macOS `spctl` notarization gate. Both OFF by default. See [Binary provenance verification](#binary-provenance-verification) below. |
101
163
 
@@ -114,6 +176,9 @@ of `~/.chroxy/config.json` regardless of which group it appears in.
114
176
  |-----|------|----------|---------------------|-------------|
115
177
  | `environments` | object | `--environments`, `--environment-backend <backend>` | *(unmapped — see [note](#environment-variable-names))* | Container / cluster isolation backends. `enabled` (boolean) turns the feature on; `backend` selects `docker` (default), `k8s`, or `rancher`; `docker`, `k8s`, and `rancher` carry the per-backend connection blocks. An unrecognised `backend` warns and falls back to Docker rather than failing startup. The `--environments` / `--environment-backend` flags layer over a file-configured block rather than replacing it. See the [Kubernetes](#kubernetes-workspace-pvc-environmentsk8sworkspace) sections below and [Nested config blocks](#nested-config-blocks-at-a-glance). |
116
178
  | `worktreeGc` | object | - | *(unmapped — see [note](#environment-variable-names))* | Garbage collection for orphaned agent worktrees (#5158). `{ autoReap?: boolean, reapIntervalMs?: number, maxLockAgeMs?: number }`. `autoReap` is **off by default**; when on, the daemon reclaims dead-pid-locked worktrees on startup and then every `reapIntervalMs` (default `1800000` / 30 min), clean trees only, never `--force`. `maxLockAgeMs` is an absolute-age fallback for the PID-liveness check — `0` (the default) disables it. The `chroxy worktree gc` CLI is always available for manual / dry-run use regardless of this block. |
179
+ | `orphanReap` | object | - | *(unmapped — see [note](#environment-variable-names))* | Orphaned-child reaper (#7606). `{ enabled?: boolean, sweepIntervalMs?: number, minAgeMs?: number }`. `enabled` is **on by default**: the daemon periodically `SIGKILL`s processes that are reparented to pid 1, owned by the daemon's uid, older than `minAgeMs` (default `600000` / 10 min) and whose working directory is inside chroxy's own session-worktree root — work a dead session left running (the kill sites already reap a session's process tree; this is the backstop for a daemon crash or a child that outlived a force-exit). Sweeps every `sweepIntervalMs` (default `300000` / 5 min). POSIX only; a no-op on Windows. |
180
+ | `sessionArchive` | object | - | *(unmapped — see [note](#environment-variable-names))* | Provider-neutral session archive. `{ enabled?: boolean, maxEntries?: number, maxAgeDays?: number, maxMegabytes?: number }`. When a session leaves the live set (closed, idle-timed-out, stale at boot, or a dismissed / expired failed restore) the history chroxy itself holds is kept as a gzip record under `archive/` next to the session-state file (directory `0700`, files `0600`), so a Codex / Gemini / BYOK session — which cannot be resumed — stays **readable** (paged, read-only) from Control Room. It resumes nothing. `enabled` is **on by default**; turning it off stops new records only and retention still deletes old ones. Retention deletes the oldest records first: older than `maxAgeDays` (default `30`), beyond `maxEntries` (default `100`, at most `1000` — a larger value warns and is clamped), then until the total is within `maxMegabytes` (default `256`). An invalid value warns and falls back to the default. At boot a session last active more than 24 hours ago is not restored: it leaves the live list, archived unless archiving is off. A session with **no history** (for example the startup `Default`) has nothing to archive, so it is restored at any age instead, like a recent session (#8870). The same four values are editable from dashboard **Settings → Session archive** (primary client only): a change is validated like this block (a `maxEntries` above `1000` is rejected there, not clamped), saved to this file and applied **without a restart** — retention re-runs at once — and turning archiving off can also delete every existing archive (#8869). |
181
+ | `sessionCi` | object | - | *(unmapped — see [note](#environment-variable-names))* | CI-completion watching for the pull request a session opened (#7424). `{ watch?: boolean, wakeAgent?: boolean, intervalMs?: number, discoveryIntervalMs?: number, maxSurveysPerTick?: number }`. `watch` is **on by default**: one sweep (never a timer per session) surveys each session's PR through your own `gh` every `intervalMs` (default `60000`) while a run is in flight, and every `discoveryIntervalMs` (default `300000`) otherwise. When a run settles — `pending === 0`, not merely "green" — it fires a `ci_complete` notification and, unless `wakeAgent` is `false`, types one line into that session's prompt if it is an idle claude-tui session. Set `watch: false` for a host that must make no background GitHub calls. A run that starts and finishes between two sweeps is missed rather than reported late. `maxSurveysPerTick` (default `4`, clamped to an integer ≥ 1) caps how many sessions one sweep pass surveys — the escape hatch for sweep contention on a many-session daemon (#7436). |
117
182
 
118
183
  ### Control Room
119
184
 
@@ -138,7 +203,9 @@ of `~/.chroxy/config.json` regardless of which group it appears in.
138
203
 
139
204
  | Key | Type | CLI Flag | Environment Variable | Description |
140
205
  |-----|------|----------|---------------------|-------------|
206
+ | _(env-only)_ | string | - | `CHROXY_CONFIG_DIR` | Absolute path to the config/state root, replacing the `~/.chroxy` default for **all** daemon state — see [The config root](#the-config-root-chroxy_config_dir). Cannot be a `config.json` key: it is what locates `config.json`. A **relative** value is refused with a warning and falls back to the default, rather than being resolved against the daemon's cwd. Relocating an existing install leaves state behind at `~/.chroxy`; `chroxy config-dir status` reports it and `chroxy config-dir migrate --yes` copies it forward. |
141
207
  | _(env-only)_ | number | - | `CHROXY_DIAGNOSTICS_RATE_LIMIT` | Per-source-IP request cap on `GET /diagnostics` over a 60 s sliding window (#3737). The endpoint reads the on-disk log tail and iterates every session per call, so it is rate-limited to protect against a stolen-token tight loop. Default `12` requests/min with a 4-request burst. Set the env var to an **integer ≥ 1** to raise or lower that per-window cap (the rate limiter's own `maxMessages` option — unrelated to the `maxMessages` config key above); the burst auto-derives as `max(1, floor(N/3))`. Invalid values (non-integer, < 1, NaN) silently fall through to the default — including sub-integer values like `0.5`, which are rejected outright (truncating to `0` would otherwise raise the limit via RateLimiter's `\|\|` fallback). No `config.json` key is exposed; this setting is intentionally env-only. Overshoot returns `429` with a `Retry-After` header and a JSON body `{ "error": "rate limited", "retryAfterMs": <ms> }`. |
208
+ | _(env-only)_ | boolean | - | `CHROXY_DISABLE_UPDATE_CHECK` | Skips the non-blocking background check of `registry.npmjs.org` for the latest published version that `WsServer` otherwise fires once on construction (#7265). Set it to the literal `1` to disable. Primarily a test-harness switch — `packages/server/tests/_setup.mjs` sets it for the whole suite so tests never make that outbound request — but it is a legitimate operator escape hatch too, e.g. on an egress-restricted or offline host. No `config.json` key is exposed. |
142
209
 
143
210
  ### Environment variable names
144
211
 
@@ -161,6 +228,11 @@ helper that consumes them, bypassing the merge layer entirely:
161
228
  `summarize` object), and `CHROXY_BINARY_PROVENANCE` /
162
229
  `CHROXY_BINARY_SIGNATURE_GATE` (`binaryProvenance`).
163
230
 
231
+ `CHROXY_CONFIG_DIR` is a direct read too, and necessarily so — the merge layer
232
+ reads `config.json`, and this variable is what decides which `config.json` that
233
+ is. It is read **per filesystem call** rather than once at import, for the reason
234
+ given in [The config root](#the-config-root-chroxy_config_dir).
235
+
164
236
  **The naive fallback.** 16 schema keys have no explicit `envKeyForConfig` entry,
165
237
  so their *merge-layer* lookup falls back to a bare `key.toUpperCase()` — which
166
238
  drops the `CHROXY_` prefix and all word separators: `features` → `FEATURES`,
@@ -192,18 +264,21 @@ rather than being silently dropped.
192
264
  |-------|---------------------|
193
265
  | `billing` | `creditTier`, `monthlyCreditBudgetUsd`, `budgetWarningPercent`, `egressCheck`, `datacenterPrefixes` |
194
266
  | `worktreeGc` | `autoReap`, `reapIntervalMs`, `maxLockAgeMs` |
267
+ | `orphanReap` | `enabled`, `sweepIntervalMs`, `minAgeMs` |
268
+ | `sessionArchive` | `enabled`, `maxEntries`, `maxAgeDays`, `maxMegabytes` |
269
+ | `sessionCi` | `watch`, `wakeAgent`, `intervalMs`, `discoveryIntervalMs`, `maxSurveysPerTick` |
195
270
  | `userShell` | `enabled`, `requireApproval` |
196
271
  | `environments.k8s` | `namespace`, `inCluster`, `kubeconfigPath`, `sidecarImage`, `imagePullPolicy`, `connectMode`, `namespaceQuota`, `namespaceLimitRange`, `workspace` |
197
272
  | `environments.rancher` | `rancherUrl`, `clusterId`, `token`, `tokenEnv`, `tokenFile`, `caData`, `skipTLSVerify`, `defaultProjectId` |
198
- | `notifications.discord` | `botName`, `billingAlerts`, `colors`, `defaultColor`, `permissionColor`, `errorColor`, `updateThrottleMs`, `heartbeatIntervalMs`, `pruneAfterMs`, `staleAfterMs`, `offlineAfterMs`, `statePath`, `billingStatePath` |
199
- | `providers` *(object form)* | `anthropicCompatible`, `openaiCompatible`, `allowAnyModel` |
273
+ | `notifications.discord` | `botName`, `billingAlerts`, `ciAlerts`, `colors`, `defaultColor`, `permissionColor`, `errorColor`, `updateThrottleMs`, `heartbeatIntervalMs`, `pruneAfterMs`, `staleAfterMs`, `offlineAfterMs`, `statePath`, `billingStatePath` |
274
+ | `providers` *(object form)* | `anthropicCompatible`, `openaiCompatible`, `acp`, `allowAnyModel` |
200
275
 
201
276
  `summarize`, `features`, and `orchestration` have no unknown-key check today, so
202
277
  a typo in one of those is silently ignored rather than warned about.
203
278
 
204
279
  ### Unrestricted provider models (`providers.allowAnyModel`)
205
280
 
206
- The static-allowlist subprocess providers (e.g. `gemini`, `codex`, `deepseek`)
281
+ The static-allowlist subprocess providers (currently `gemini` and `deepseek`)
207
282
  hard-reject a model id that is not in their built-in list, even when the upstream
208
283
  API already serves it — which otherwise forces a chroxy release just to add one.
209
284
  `providers.allowAnyModel` is an array of provider ids that opt out of that check
@@ -212,11 +287,29 @@ API already serves it — which otherwise forces a chroxy release just to add on
212
287
  ```json
213
288
  {
214
289
  "providers": {
215
- "allowAnyModel": ["codex", "gemini"]
290
+ "allowAnyModel": ["gemini"]
216
291
  }
217
292
  }
218
293
  ```
219
294
 
295
+ `codex` is no longer in that bucket (#7727): its allowlist is the installed
296
+ binary's own `model/list` answer, and it accepts any id while it has not been
297
+ able to ask. Listing `codex` here still works — the opt-out is checked ahead of
298
+ the catalog and is deliberately kept for a catalog that is wrong or unreachable
299
+ — but it is no longer needed to serve a model the OpenAI API already exposes,
300
+ and leaving it set makes a catalog that never arrived indistinguishable from one
301
+ that did.
302
+
303
+ That tri-state is worth naming, because "unrestricted" and "restricted to six
304
+ ids" are both wrong descriptions of codex today. **Catalog in hand** → its ids
305
+ are authoritative at both gates (`set_model` and session creation). **No catalog**
306
+ (cold daemon, an unresolved or failed probe, a binary below the `model/list`
307
+ floor) → unrestricted; any id is passed through to the binary. The two are
308
+ different facts and are never collapsed, so a probe that wedged does not silently
309
+ empty the picker. Where the catalog comes from, and what it does and does not
310
+ carry — notably **no context window** — is documented in
311
+ [Where the model list comes from](../../docs/providers.md#where-the-model-list-comes-from-modellist).
312
+
220
313
  An opted-in provider passes the model id through verbatim and lets the upstream
221
314
  API be the validator. Default is **off** for every provider, so the
222
315
  misconfiguration-catching strictness is preserved unless you explicitly opt in.
@@ -247,7 +340,7 @@ phrase list. The pattern is OR-ed with the default; setting it cannot
247
340
  the source fails to compile (unbalanced brackets, etc.) the server logs a
248
341
  warning and falls back to the default pattern only.
249
342
 
250
- This config is consumed by the auto-evaluator hook (see `shouldSkipEvaluator`
343
+ This config is consumed by the auto-evaluator hook (see `shouldSkipEvaluatorAsync`
251
344
  in `packages/server/src/prompt-evaluator.js`); the on-demand "Evaluate"
252
345
  button in the dashboard always evaluates, regardless of this setting.
253
346
 
@@ -500,16 +593,104 @@ The `provider` key picks which AI CLI backs a session by default:
500
593
 
501
594
  | Value | Backing binary / SDK | Required env |
502
595
  |-------|----------------------|--------------|
503
- | `claude-tui` (default) | drives the interactive `claude` TUI under a PTY (#5819) | Claude Code subscription login |
504
- | `claude-sdk` | `@anthropic-ai/claude-agent-sdk` | Claude Code login or `ANTHROPIC_API_KEY` |
596
+ | `claude-sdk` (default, #8266) | `@anthropic-ai/claude-agent-sdk` | Claude Code login or `ANTHROPIC_API_KEY` |
597
+ | `claude-tui` | drives the interactive `claude` TUI under a PTY (the default from #5819 until #8266) | Claude Code subscription login |
505
598
  | `claude-cli` | `claude -p` (Claude Code CLI) | Claude Code login (CLI intentionally strips `ANTHROPIC_API_KEY` from its environment) |
506
599
  | `claude-channel` *(research preview)* | `claude --channels` (Claude Code CLI, MCP channel transport) | Claude Code subscription login (rejects `ANTHROPIC_API_KEY`). Requires `claude` ≥ 2.1.80 |
507
- | `gemini` | `gemini -p` CLI | `GEMINI_API_KEY` |
600
+ | `gemini` | `gemini --prompt=<text>` CLI | `GEMINI_API_KEY` |
508
601
  | `codex` | `codex exec` CLI | `OPENAI_API_KEY` |
509
602
  | `docker-sdk` / `docker-cli` | Claude SDK/CLI inside a Docker container | Requires `environments.enabled=true` + Docker |
510
603
 
511
604
  Clients can override the default per-session by passing `provider` in a `create_session` WebSocket message. See [../../docs/providers.md](../../docs/providers.md) for capability differences (plan mode, permission handling, resume, attachments) and troubleshooting.
512
605
 
606
+ ### Agent connections
607
+
608
+ `agentConnections` assigns stable host-local names to explicit authentication
609
+ routes. A current client shows these entries under their runtime before creating
610
+ a session and sends the selected `connectionId`. The daemon persists the selected
611
+ descriptor with the session. Restore requires the same descriptor version, stable
612
+ connection id, runtime id, and requested authentication route; if any member of
613
+ that identity tuple changes or the connection is removed, restore is refused.
614
+
615
+ ```json
616
+ {
617
+ "agentConnections": [
618
+ {
619
+ "id": "codex-subscription",
620
+ "label": "Codex subscription",
621
+ "provider": "openai",
622
+ "runtime": "codex",
623
+ "authRoute": "native"
624
+ },
625
+ {
626
+ "id": "codex-api",
627
+ "label": "Codex API",
628
+ "provider": "openai",
629
+ "runtime": "codex",
630
+ "authRoute": "api",
631
+ "credentialKey": "OPENAI_API_KEY"
632
+ },
633
+ {
634
+ "id": "local-ollama",
635
+ "label": "Local Ollama",
636
+ "provider": "local",
637
+ "runtime": "ollama",
638
+ "authRoute": "local",
639
+ "inferenceLocation": "local"
640
+ }
641
+ ]
642
+ }
643
+ ```
644
+
645
+ Supported built-in route/runtime pairs are `claude-tui` + `native`, `codex` +
646
+ `native` or `api`, `claude-byok` + `api`, and `ollama` + `local`. Other pairs,
647
+ including imported ACP authentication, appear as unsupported and cannot create a
648
+ session. Native credentials remain in the vendor CLI's own store. API entries
649
+ refer to the runtime's existing Chroxy credential-store slot or environment
650
+ variable by name (`OPENAI_API_KEY` for Codex and `ANTHROPIC_API_KEY` for Claude
651
+ BYOK); unsupported references cannot create a session. Literal `apiKey`,
652
+ `token`, `credential`, or `secret` fields are rejected.
653
+ Connection descriptors never contain credential values.
654
+
655
+ For Codex, a native selection removes OpenAI API environment settings from that
656
+ child process; an API selection supplies only the selected Chroxy credential.
657
+ Both explicit routes start Codex with per-process configuration that selects the
658
+ built-in `openai` provider and pins its API and ChatGPT service base URLs to the
659
+ vendor endpoints. Before `thread/start`, the daemon verifies the effective
660
+ provider with `config/read` and the requested credential class with
661
+ `account/read`; it then requires `thread/start` to report the built-in provider
662
+ before marking the connection ready. The daemon never switches between routes
663
+ automatically. Native login establishes the subscription billing route, while
664
+ account identity and entitlement eligibility remain `unknown` until Codex offers
665
+ an authoritative source.
666
+
667
+ For Claude, an explicit native selection removes API-key, bearer-token, custom
668
+ endpoint, and third-party cloud-provider route settings from the child process.
669
+ Session startup pins the generated settings to Anthropic's first-party endpoint
670
+ while retaining the normal Claude Code settings sources. It reruns the configured
671
+ binary health, quarantine, signature, and provenance checks immediately before both
672
+ `claude auth status --json` and the TUI spawn, using the exact binary, resolved
673
+ project directory, child environment, and generated settings file. The auth
674
+ probe must report `claude.ai` authentication through its first-party API provider
675
+ with no API-key source. A shell-free `SessionStart` hook then observes the
676
+ settings environment applied inside the real TUI process; a fresh session-private
677
+ nonce must confirm the exact Anthropic endpoint and the absence of API-key,
678
+ bearer-token, gateway, and third-party cloud selectors before Chroxy marks the
679
+ session ready. Missing, stale, custom, or unverifiable routes stop that TUI.
680
+ Every respawn repeats the full sequence. User, project, local, and managed
681
+ Claude Code settings, instructions, skills, hooks, and plugins continue to load;
682
+ if any effective setting changes the observed authentication or endpoint route,
683
+ the startup check fails closed. Chroxy runtime skills injected with
684
+ `--append-system-prompt` and Chroxy's permission hook/rules also continue to
685
+ apply. This proves the route at each startup, but it cannot prove that an
686
+ administrator will not refresh managed settings later in
687
+ the lifetime of an already-running vendor process. Discovery remains process-free
688
+ and reports readiness as unknown until startup. Legacy provider-only
689
+ `claude-tui` sessions keep their existing environment and settings behavior.
690
+ The native route is subscription billed; account identity and entitlement
691
+ eligibility remain `unknown` because the status command does not establish
692
+ either one.
693
+
513
694
  ### `claude-channel` (research preview)
514
695
 
515
696
  `claude-channel` drives Claude through Anthropic's first-party **channels MCP
@@ -808,7 +989,8 @@ The non-secret knobs live under `notifications.discord` in `config.json`:
808
989
  "updateThrottleMs": 15000,
809
990
  "heartbeatIntervalMs": 300000,
810
991
  "pruneAfterMs": 86400000,
811
- "billingAlerts": true
992
+ "billingAlerts": true,
993
+ "ciAlerts": true
812
994
  }
813
995
  }
814
996
  }
@@ -825,6 +1007,11 @@ The non-secret knobs live under `notifications.discord` in `config.json`:
825
1007
  | `heartbeatIntervalMs` | number | Elapsed-time footer refresh interval for live embeds — offline embeds are final and never re-PATCHed (default `300000`; `0` disables; minimum `10000`) |
826
1008
  | `pruneAfterMs` | number | Retention for state-store entries: entries untouched longer than this are dropped on load (default `86400000` / 24h; `0` disables; minimum `60000` / 60s — smaller values fall back to the default, since a retention shorter than the gap between events prunes the tracked message id in between and turns the embed into message-per-event spam; the last Discord message is kept). Heartbeat refreshes don't reset the clock — only real pipeline events do |
827
1009
  | `billingAlerts` | boolean | Kill-switch for the daemon-global billing-alert message (the 2026-06-15 billing canary). Default `true` when a webhook is configured; `false` keeps billing alerts off Discord while the per-project status embed stays on |
1010
+ | `ciAlerts` | boolean | Kill-switch for CI-completion notices (#7428 — one fresh message per settled `ci_complete` event, no state tracked). Default `true` when a webhook is configured; `false` keeps them off Discord while the per-project status embed / billing alerts stay on |
1011
+ | `staleAfterMs` | number | How long a live embed may go without a pipeline event before the sink marks the project **stale** (#5676 status watchdog; default `600000` / 10 min). Any finite value >= 0 is honoured; anything else falls back to the default |
1012
+ | `offlineAfterMs` | number | How long a live embed may go without a pipeline event before the sink marks the project **offline** and stops re-PATCHing it (#5676; default `1800000` / 30 min). Same validation as `staleAfterMs` |
1013
+ | `statePath` | string | Override for the status-embed state store (default `~/.chroxy/discord-webhook-state.json`). The caller defaults it and the config value wins — set it to relocate the store off `$HOME` |
1014
+ | `billingStatePath` | string | Override for the billing-alert state store (default `~/.chroxy/discord-billing-state.json`), the billing-sink counterpart to `statePath` |
828
1015
 
829
1016
  Status-message state (message ids, current state per project) persists in
830
1017
  `~/.chroxy/discord-webhook-state.json`; the billing-alert message tracks its own
@@ -867,13 +1054,12 @@ identical to a daemon without the feature.
867
1054
  When on, at each task's due time the daemon spins up (or resumes) that task's
868
1055
  session and runs its prompt with **no client connected**.
869
1056
 
870
- ##### Supported providers — hook-routed providers (including the default) are refused
1057
+ ##### Supported providers — hook-routed providers are refused
871
1058
 
872
1059
  > **A scheduled task only fires on a provider that answers permission prompts
873
- > in-process.** Right now that is `claude-sdk`, `claude-byok`, `codex` (the
874
- > app-server driver), `deepseek`, and `ollama`. Every other provider — **including
875
- > the daemon default `claude-tui`**, plus `claude-cli`, `claude-channel`, and
876
- > `gemini` — is **refused**: the task does not fire, no session is created, and the
1060
+ > in-process.** Right now that is `claude-sdk` (the daemon default), `claude-byok`,
1061
+ > `codex` (the app-server driver), `deepseek`, and `ollama`. Every other provider —
1062
+ > `claude-tui`, `claude-cli`, `claude-channel`, and `gemini` — is **refused**: the task does not fire, no session is created, and the
877
1063
  > run is recorded with status `refused` naming the provider.
878
1064
 
879
1065
  This is deliberate, not an oversight. The scheduler's whole safety story is that a
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Node.js daemon that bridges your phone to Claude Code via WebSocket over Cloudflare tunnel.
4
4
 
5
- The server runs in **CLI headless mode**: it executes the Claude Agent SDK in-process by default, or shells out to `claude -p`, `gemini -p`, or `codex exec` for the other providers, and streams parsed events to clients. No tmux, no PTY.
5
+ The server runs in **CLI headless mode**: it executes the Claude Agent SDK in-process by default, or shells out to `claude -p`, `gemini --prompt=<text>`, or `codex exec` for the other providers, and streams parsed events to clients. No tmux, no PTY.
6
6
 
7
7
  ## Quick Start
8
8
 
@@ -31,7 +31,7 @@ The server will print a QR code. Scan it with the Chroxy app.
31
31
  | `chroxy start --cwd /path` | Set working directory |
32
32
  | `chroxy start --model opus` | Use a specific Claude model |
33
33
  | `chroxy start --allowed-tools tool1,tool2` | Restrict exposed tools |
34
- | `chroxy start --provider name` | Use a specific session provider (default: `claude-tui`) |
34
+ | `chroxy start --provider name` | Use a specific session provider (default: `claude-sdk`) |
35
35
  | `chroxy start --no-encrypt` | Disable end-to-end encryption |
36
36
  | `chroxy dev` | Development mode (supervisor + auto-restart) |
37
37
  | `chroxy deploy` | Validate and restart the running server |
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { writeFileSync } from 'fs'
4
+ import { observeClaudeNativeRoute } from '../src/utils/claude-native-route.js'
5
+
6
+ const markerPath = process.argv[2]
7
+ const nonce = process.argv[3]
8
+ if (!markerPath || !nonce) process.exit(2)
9
+
10
+ const observed = observeClaudeNativeRoute(process.env)
11
+ writeFileSync(markerPath, JSON.stringify({
12
+ version: 1,
13
+ nonce,
14
+ safe: observed.safe,
15
+ firstPartyEndpoint: observed.firstPartyEndpoint,
16
+ blockedKeys: observed.blockedKeys,
17
+ }), { mode: 0o600 })