@chroxy/server 0.11.0 → 0.11.11

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 (386) hide show
  1. package/CONFIG.md +206 -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 +958 -0
  12. package/src/activity-registry.js +110 -5
  13. package/src/agent-connections.js +304 -0
  14. package/src/agent-control/client.js +1645 -0
  15. package/src/agent-control/events.js +551 -0
  16. package/src/agent-control/local-connection.js +293 -0
  17. package/src/agent-control/mcp-server.js +547 -0
  18. package/src/anthropic-compatible-config.js +30 -4
  19. package/src/anthropic-compatible-session.js +15 -6
  20. package/src/anthropic-gemini-shim.js +444 -0
  21. package/src/anthropic-gemini-translate.js +1030 -0
  22. package/src/anthropic-openai-shim.js +0 -1
  23. package/src/archive-continuation.js +164 -0
  24. package/src/assistant-response.js +24 -0
  25. package/src/auth-probes.js +120 -13
  26. package/src/background-shell-tracker.js +27 -0
  27. package/src/base-session.js +1520 -36
  28. package/src/bearer-recheck.js +49 -0
  29. package/src/billing-budget.js +19 -0
  30. package/src/billing-class.js +40 -7
  31. package/src/binary-provenance-trust.js +11 -5
  32. package/src/bound-client-policy.js +291 -0
  33. package/src/built-in-tools/bash-exec.js +46 -7
  34. package/src/built-in-tools/file-ops.js +69 -5
  35. package/src/built-in-tools/tool-transforms.js +1113 -13
  36. package/src/byok-compose-state.js +6 -9
  37. package/src/byok-credentials.js +2 -3
  38. package/src/byok-mcp-client.js +92 -7
  39. package/src/byok-mcp-config.js +633 -122
  40. package/src/byok-mcp-fleet.js +49 -7
  41. package/src/byok-mcp-oauth-store.js +18 -16
  42. package/src/byok-mcp-trust.js +37 -23
  43. package/src/byok-session.js +707 -179
  44. package/src/byok-tool-executor.js +2742 -26
  45. package/src/byok-tools.js +9 -2
  46. package/src/channels/chroxy-channel-server.js +2 -3
  47. package/src/checkpoint-manager.js +64 -46
  48. package/src/claude-channel-session.js +16 -10
  49. package/src/claude-model-catalog.js +131 -16
  50. package/src/claude-model-refresh.js +385 -0
  51. package/src/claude-model-request.js +103 -0
  52. package/src/claude-setting-sources.js +74 -0
  53. package/src/claude-stream-parser.js +53 -3
  54. package/src/claude-tui/diagnostic-tail.js +83 -0
  55. package/src/claude-tui/form-driver.js +44 -7
  56. package/src/claude-tui/model-error.js +41 -0
  57. package/src/claude-tui/pty-driver.js +215 -88
  58. package/src/claude-tui/sanitize-question-payload.js +109 -0
  59. package/src/claude-tui/usage-limit.js +239 -0
  60. package/src/claude-tui-session.js +3563 -284
  61. package/src/claude-tui-tool-response.js +300 -0
  62. package/src/cli/agent-cmd.js +236 -0
  63. package/src/cli/agent-control-cmd.js +65 -0
  64. package/src/cli/config-cmd.js +4 -4
  65. package/src/cli/config-dir-cmd.js +234 -0
  66. package/src/cli/connection-state.js +54 -0
  67. package/src/cli/deploy-cmd.js +45 -10
  68. package/src/cli/doctor-cmd.js +7 -3
  69. package/src/cli/freshness-cmd.js +53 -0
  70. package/src/cli/init-cmd.js +15 -16
  71. package/src/cli/pages-cmd.js +6 -4
  72. package/src/cli/pair-code-cmd.js +7 -6
  73. package/src/cli/pair-discord-cmd.js +7 -6
  74. package/src/cli/providers-cmd.js +3 -3
  75. package/src/cli/schedule-cmd.js +91 -40
  76. package/src/cli/server-cmd.js +54 -1
  77. package/src/cli/service-cmd.js +33 -10
  78. package/src/cli/session-cmd.js +227 -74
  79. package/src/cli/shared.js +162 -11
  80. package/src/cli/shell-cmd.js +7 -4
  81. package/src/cli/status-cmd.js +19 -5
  82. package/src/cli/tokens-cmd.js +4 -5
  83. package/src/cli/tunnel-cmd.js +255 -24
  84. package/src/cli/worktree-gc-cmd.js +2 -2
  85. package/src/cli-session.js +1250 -126
  86. package/src/cli.js +8 -0
  87. package/src/codex-app-server-client.js +36 -3
  88. package/src/codex-app-server-session.js +1517 -81
  89. package/src/codex-bundled-client.js +66 -0
  90. package/src/codex-error-text.js +114 -0
  91. package/src/codex-model-catalog.js +548 -0
  92. package/src/codex-model-rejections.js +87 -0
  93. package/src/codex-native-resume.js +104 -0
  94. package/src/codex-protocol-capabilities.js +188 -0
  95. package/src/codex-session.js +450 -27
  96. package/src/config-dir-migration.js +449 -0
  97. package/src/config-dir.js +108 -0
  98. package/src/config.js +306 -26
  99. package/src/connection-authority.js +48 -0
  100. package/src/connection-info.js +78 -23
  101. package/src/connection-locality.js +60 -0
  102. package/src/container-liveness-monitor.js +189 -0
  103. package/src/continuation-metadata-worker.js +17 -0
  104. package/src/continuations.js +227 -0
  105. package/src/control-room/host-prune.js +5 -0
  106. package/src/control-room/integrations.js +7 -20
  107. package/src/control-room/skills-inventory.js +2 -2
  108. package/src/conversation-scanner.js +42 -39
  109. package/src/conversation-scope.js +59 -39
  110. package/src/conversation-search.js +28 -39
  111. package/src/credential-store.js +23 -19
  112. package/src/daemon-commit.js +92 -0
  113. package/src/daemon-idle-state.js +171 -0
  114. package/src/daemon-update-status.js +314 -0
  115. package/src/dashboard-build.js +70 -0
  116. package/src/declared-status.js +90 -0
  117. package/src/deepseek-credentials.js +2 -3
  118. package/src/dev-preview.js +170 -182
  119. package/src/device-preferences.js +2 -2
  120. package/src/diff-parser.js +87 -0
  121. package/src/discord-credentials.js +2 -3
  122. package/src/docker-byok-pool.js +3 -1
  123. package/src/docker-byok-session.js +678 -78
  124. package/src/docker-image-allowlist.js +23 -1
  125. package/src/docker-sdk-session.js +172 -3
  126. package/src/docker-session.js +294 -11
  127. package/src/doctor.js +781 -64
  128. package/src/durable-write.js +35 -0
  129. package/src/edited-input.js +264 -0
  130. package/src/environment-manager.js +175 -36
  131. package/src/environments/authority.js +101 -0
  132. package/src/environments/backends/container-claude-spawn.js +94 -0
  133. package/src/environments/backends/docker.js +31 -10
  134. package/src/environments/backends/k8s.js +49 -24
  135. package/src/environments/destroy-with-sessions.js +142 -0
  136. package/src/event-ingest.js +118 -13
  137. package/src/event-normalizer.js +186 -235
  138. package/src/folder-trust-wire.js +137 -0
  139. package/src/folder-trust-worker.js +17 -0
  140. package/src/folder-trust.js +1572 -0
  141. package/src/freshness/activity-meter.js +101 -0
  142. package/src/freshness/adapter.js +199 -0
  143. package/src/freshness/checks.js +239 -0
  144. package/src/freshness/config.js +98 -0
  145. package/src/freshness/core.js +185 -0
  146. package/src/freshness/derive.js +680 -0
  147. package/src/freshness/exchange.js +305 -0
  148. package/src/freshness/file-ledger.js +400 -0
  149. package/src/freshness/grade.js +81 -0
  150. package/src/freshness/hash.js +45 -0
  151. package/src/freshness/inbox.js +163 -0
  152. package/src/freshness/index.js +20 -0
  153. package/src/freshness/investigation.js +474 -0
  154. package/src/freshness/keys.js +177 -0
  155. package/src/freshness/ledger.js +122 -0
  156. package/src/freshness/outbox.js +131 -0
  157. package/src/freshness/policy.js +599 -0
  158. package/src/freshness/queue.js +843 -0
  159. package/src/freshness/read-errors.js +23 -0
  160. package/src/freshness/render.js +153 -0
  161. package/src/freshness/runtime.js +113 -0
  162. package/src/freshness/session-registry-adapter.js +161 -0
  163. package/src/freshness/state-file-adapter.js +167 -0
  164. package/src/freshness-runner/build-info.js +139 -0
  165. package/src/freshness-runner/cli.js +105 -0
  166. package/src/freshness-runner/run-tick.js +109 -0
  167. package/src/freshness-runner/stamp.js +57 -0
  168. package/src/freshness-sources/claude-transcript-adapter.js +211 -0
  169. package/src/freshness-sources/codex-transcript-adapter.js +33 -0
  170. package/src/freshness-sources/index.js +8 -0
  171. package/src/gemini-byok-session.js +292 -0
  172. package/src/gemini-credentials.js +67 -0
  173. package/src/gemini-key-safety.js +246 -0
  174. package/src/gemini-models.js +386 -0
  175. package/src/gemini-session.js +81 -5
  176. package/src/handler-utils.js +540 -80
  177. package/src/handlers/checkpoint-handlers.js +47 -4
  178. package/src/handlers/control-room-handlers.js +51 -11
  179. package/src/handlers/conversation-handlers.js +469 -56
  180. package/src/handlers/daemon-update-handlers.js +81 -0
  181. package/src/handlers/evaluator-handlers.js +14 -1
  182. package/src/handlers/feature-handlers.js +186 -69
  183. package/src/handlers/file-handlers.js +57 -13
  184. package/src/handlers/folder-trust-handlers.js +90 -0
  185. package/src/handlers/input-handlers.js +714 -48
  186. package/src/handlers/orchestration-handlers.js +3 -3
  187. package/src/handlers/principal-admin-handlers.js +229 -0
  188. package/src/handlers/principal-handlers.js +262 -0
  189. package/src/handlers/scheduler-handlers.js +92 -18
  190. package/src/handlers/session-handlers.js +551 -20
  191. package/src/handlers/session-pr-status-handlers.js +283 -0
  192. package/src/handlers/session-pr-threads-handlers.js +247 -0
  193. package/src/handlers/settings-handlers.js +372 -50
  194. package/src/handlers/skills-handlers.js +20 -4
  195. package/src/handlers/summarize-handlers.js +32 -1
  196. package/src/handlers/survey-throttle.js +380 -0
  197. package/src/health-proof.js +40 -0
  198. package/src/history-page.js +112 -0
  199. package/src/http-routes.js +127 -8
  200. package/src/ide/search.js +24 -6
  201. package/src/ide/symbols.js +20 -6
  202. package/src/input-context.js +117 -0
  203. package/src/instruction-policy-compiler.js +229 -0
  204. package/src/instruction-policy.js +250 -0
  205. package/src/jsonl-reader.js +378 -91
  206. package/src/jsonl-subprocess-session.js +96 -9
  207. package/src/keychain.js +1 -1
  208. package/src/logger.js +166 -30
  209. package/src/mailbox-route.js +113 -22
  210. package/src/message-wire.js +386 -0
  211. package/src/model-discovery.js +43 -3
  212. package/src/models.js +1276 -174
  213. package/src/notification-prefs.js +27 -4
  214. package/src/notifications/discord-billing-sink.js +22 -5
  215. package/src/notifications/discord-ci-sink.js +243 -0
  216. package/src/notifications/discord-webhook-client.js +71 -0
  217. package/src/notifications/discord-webhook-sink.js +64 -23
  218. package/src/notifications/expo-push-sink.js +85 -6
  219. package/src/notifications/ready-body.js +16 -5
  220. package/src/ollama-session.js +34 -2
  221. package/src/orchestration/build-manager.js +9 -2
  222. package/src/orchestration/git-ops.js +41 -7
  223. package/src/orchestration/orchestration-manager.js +112 -36
  224. package/src/orchestration/permission-gate.js +17 -2
  225. package/src/orchestration/run-model.js +2 -1
  226. package/src/orchestration/run-record.js +11 -0
  227. package/src/orchestration/turn-driver.js +185 -43
  228. package/src/orphan-reaper.js +470 -0
  229. package/src/outgoing-policy.js +189 -0
  230. package/src/pairing.js +92 -13
  231. package/src/path-hash-trust-ledger.js +642 -25
  232. package/src/permission-deadlines.js +82 -0
  233. package/src/permission-floor.js +1410 -43
  234. package/src/permission-hook.js +180 -69
  235. package/src/permission-manager.js +737 -89
  236. package/src/permission-mode-support.js +35 -0
  237. package/src/permission-resolved-by.js +89 -0
  238. package/src/permission-resolver.js +126 -8
  239. package/src/permission-scope.js +43 -0
  240. package/src/platform.js +315 -47
  241. package/src/preview-ingress.js +54 -0
  242. package/src/preview-target.js +213 -0
  243. package/src/principal-audit.js +189 -0
  244. package/src/principal-binding.js +25 -0
  245. package/src/principal-brakes.js +21 -0
  246. package/src/principal-effect.js +101 -0
  247. package/src/principal-journal.js +905 -0
  248. package/src/principal-kill-switch.js +183 -0
  249. package/src/principal-label.js +5 -0
  250. package/src/principal-pending-permissions.js +177 -0
  251. package/src/principal-policy.js +1094 -0
  252. package/src/principal-sessions-snapshot.js +208 -0
  253. package/src/principal-store.js +488 -0
  254. package/src/principal-subscriptions.js +283 -0
  255. package/src/prompt-evaluator.js +34 -4
  256. package/src/provider-customization.js +180 -0
  257. package/src/providers.js +209 -4
  258. package/src/push.js +30 -4
  259. package/src/question-route-map.js +130 -0
  260. package/src/redaction.js +531 -20
  261. package/src/roster-broadcast.js +186 -0
  262. package/src/scheduled-task-store.js +330 -26
  263. package/src/scheduler.js +368 -11
  264. package/src/sdk-session.js +2114 -188
  265. package/src/server-cli/preview-shutdown.js +22 -0
  266. package/src/server-cli/push-notification-handler.js +17 -3
  267. package/src/server-cli/server-orchestrator.js +28 -5
  268. package/src/server-cli-child.js +33 -18
  269. package/src/server-cli.js +553 -38
  270. package/src/server-identity.js +15 -11
  271. package/src/service.js +396 -25
  272. package/src/session-archive-limits.js +15 -0
  273. package/src/session-archive.js +1029 -0
  274. package/src/session-busy-state.js +72 -0
  275. package/src/session-ci-watcher.js +1099 -0
  276. package/src/session-context.js +7 -2
  277. package/src/session-manager.js +4062 -312
  278. package/src/session-message-history.js +841 -16
  279. package/src/session-name-allocator.js +685 -0
  280. package/src/session-pr-status.js +654 -0
  281. package/src/session-pr-threads.js +271 -0
  282. package/src/session-preset-trust.js +3 -3
  283. package/src/session-preset.js +10 -5
  284. package/src/session-state-persistence.js +94 -17
  285. package/src/session-timeout-manager.js +20 -0
  286. package/src/session-token-store.js +17 -8
  287. package/src/session-wake.js +240 -0
  288. package/src/shell-approval-info.js +2 -2
  289. package/src/shell-approval-store.js +3 -1
  290. package/src/skills-loader.js +7 -4
  291. package/src/skills-manager.js +2 -2
  292. package/src/skills-trust.js +95 -13
  293. package/src/skills-usage.js +2 -3
  294. package/src/snapshots-store.js +2 -3
  295. package/src/statusline.js +100 -29
  296. package/src/summarize-session.js +53 -4
  297. package/src/supervisor.js +22 -11
  298. package/src/sweep-stale-provider-dirs.js +95 -0
  299. package/src/thinking-level-wire.js +39 -0
  300. package/src/thinking-stream.js +179 -0
  301. package/src/tool-result.js +61 -0
  302. package/src/transcript-sources.js +109 -0
  303. package/src/transcript-tasks.js +372 -25
  304. package/src/trusted-file-read.js +302 -0
  305. package/src/tunnel/base.js +0 -8
  306. package/src/tunnel/cloudflare.js +34 -31
  307. package/src/tunnel/index.js +9 -0
  308. package/src/tunnel/preview.js +64 -0
  309. package/src/turn-outcome.js +140 -0
  310. package/src/usage-normalize.js +9 -5
  311. package/src/user-shell-session.js +59 -5
  312. package/src/utils/agent-sdk-version.js +107 -0
  313. package/src/utils/argv-safety.js +770 -0
  314. package/src/utils/auth-cause.js +60 -0
  315. package/src/utils/binary-package-manifest.js +639 -0
  316. package/src/utils/binary-version.js +224 -0
  317. package/src/utils/bounded-regex-worker.js +29 -0
  318. package/src/utils/bounded-regex.js +162 -0
  319. package/src/utils/claude-binary.js +43 -0
  320. package/src/utils/claude-config-dir.js +245 -0
  321. package/src/utils/claude-login-command.js +16 -0
  322. package/src/utils/claude-native-route.js +81 -0
  323. package/src/utils/componentwise-resolver.js +133 -37
  324. package/src/utils/deploy-control-files.js +87 -0
  325. package/src/utils/exec-failure-reason.js +21 -0
  326. package/src/utils/git-repo.js +42 -0
  327. package/src/utils/is-entry-point.js +137 -0
  328. package/src/utils/node-pty-probe.js +95 -0
  329. package/src/utils/node-pty-support.js +118 -0
  330. package/src/utils/opened-file-path.js +167 -0
  331. package/src/utils/path-containment.js +165 -0
  332. package/src/utils/permission-mode-sidecar.js +51 -0
  333. package/src/utils/pid-liveness.js +47 -0
  334. package/src/utils/preflight.js +360 -16
  335. package/src/utils/read-limiter.js +217 -0
  336. package/src/utils/regular-file.js +375 -0
  337. package/src/utils/safe-regex.js +113 -0
  338. package/src/utils/small-file.js +129 -0
  339. package/src/utils/spawn-env.js +189 -4
  340. package/src/utils/stale-session-dirs.js +182 -0
  341. package/src/utils/stat-identity.js +43 -0
  342. package/src/utils/verify-provenance.js +406 -13
  343. package/src/web-task-manager.js +297 -16
  344. package/src/worktree-gc.js +202 -6
  345. package/src/ws-auth.js +163 -31
  346. package/src/ws-broadcaster.js +49 -5
  347. package/src/ws-client-manager.js +24 -1
  348. package/src/ws-client-sender.js +7 -0
  349. package/src/ws-file-ops/browser.js +363 -58
  350. package/src/ws-file-ops/common.js +320 -14
  351. package/src/ws-file-ops/git.js +395 -42
  352. package/src/ws-file-ops/index.js +2 -0
  353. package/src/ws-file-ops/memory.js +137 -35
  354. package/src/ws-file-ops/open-nofollow.js +354 -0
  355. package/src/ws-file-ops/reader.js +571 -113
  356. package/src/ws-forwarding.js +349 -39
  357. package/src/ws-handler-context.js +88 -2
  358. package/src/ws-history.js +1010 -175
  359. package/src/ws-message-handlers.js +25 -1
  360. package/src/ws-permissions.js +307 -37
  361. package/src/ws-schemas.js +5 -0
  362. package/src/ws-server.js +885 -98
  363. package/sidecar/node_modules/.package-lock.json +0 -29
  364. package/sidecar/node_modules/ws/LICENSE +0 -20
  365. package/sidecar/node_modules/ws/README.md +0 -548
  366. package/sidecar/node_modules/ws/browser.js +0 -8
  367. package/sidecar/node_modules/ws/index.js +0 -22
  368. package/sidecar/node_modules/ws/lib/buffer-util.js +0 -131
  369. package/sidecar/node_modules/ws/lib/constants.js +0 -19
  370. package/sidecar/node_modules/ws/lib/event-target.js +0 -292
  371. package/sidecar/node_modules/ws/lib/extension.js +0 -203
  372. package/sidecar/node_modules/ws/lib/limiter.js +0 -55
  373. package/sidecar/node_modules/ws/lib/permessage-deflate.js +0 -528
  374. package/sidecar/node_modules/ws/lib/receiver.js +0 -706
  375. package/sidecar/node_modules/ws/lib/sender.js +0 -602
  376. package/sidecar/node_modules/ws/lib/stream.js +0 -161
  377. package/sidecar/node_modules/ws/lib/subprotocol.js +0 -62
  378. package/sidecar/node_modules/ws/lib/validation.js +0 -152
  379. package/sidecar/node_modules/ws/lib/websocket-server.js +0 -554
  380. package/sidecar/node_modules/ws/lib/websocket.js +0 -1393
  381. package/sidecar/node_modules/ws/package.json +0 -70
  382. package/sidecar/node_modules/ws/wrapper.mjs +0 -21
  383. package/src/dashboard-next/dist/assets/index-C2ipeGlq.js +0 -111
  384. package/src/dashboard-next/dist/assets/index-DM-_dISG.css +0 -1
  385. package/src/dashboard-next/dist/index.html +0 -13
  386. 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`
@@ -46,6 +107,7 @@ of `~/.chroxy/config.json` regardless of which group it appears in.
46
107
  | Key | Type | CLI Flag | Environment Variable | Description |
47
108
  |-----|------|----------|---------------------|-------------|
48
109
  | `maxSessions` | number | - | `CHROXY_MAX_SESSIONS` | Maximum concurrent sessions (default `5`). Creating one past the cap is rejected with `SESSION_LIMIT_REACHED`. Must be ≥ 1. |
110
+ | `sessionNaming` | string | - | *(unmapped — see [note](#environment-variable-names))* | How a session created without a name is named: `project` (default) gives `<project> <n>` (numbers kept per project in a durable store next to `session-state.json`), `legacy` keeps `Session <n>`. An explicit name always wins; a project that cannot be determined, or a store that cannot be trusted, falls back to the legacy name. Any other value warns at startup and uses `project`. |
49
111
  | `maxMessages` | number | `--max-messages <count>` | `CHROXY_MAX_MESSAGES` | Messages retained per session before FIFO eviction (default `1000`). |
50
112
  | `maxHistory` | number | - | `CHROXY_MAX_HISTORY` | Legacy alias for `maxMessages`. `maxMessages` wins when both are set; prefer the canonical key. |
51
113
  | `maxPayload` | number | `--max-payload <bytes>` | `CHROXY_MAX_PAYLOAD` | WebSocket max message size in bytes. **Effective default `10485760` (10 MB)** — large enough for image / document attachments. Range `1024` (1 KB) – `104857600` (100 MB); values outside it warn at startup. |
@@ -81,10 +143,12 @@ of `~/.chroxy/config.json` regardless of which group it appears in.
81
143
 
82
144
  | Key | Type | CLI Flag | Environment Variable | Description |
83
145
  |-----|------|----------|---------------------|-------------|
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. |
146
+ | `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
147
  | `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). |
148
+ | `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). |
149
+ | `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
150
  | `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. |
151
+ | `codexBinary` | string | - | `CHROXY_CODEX_BIN` | Explicit path of the `codex` client the codex provider launches, instead of the first `codex` on `PATH` (#8609). The config-file value is published to `CHROXY_CODEX_BIN` once at startup by `applyCodexBinaryConfig`, and an env var that is already set wins. See [../../docs/providers.md](../../docs/providers.md). |
88
152
 
89
153
  ### Permissions and security gates
90
154
 
@@ -93,9 +157,9 @@ of `~/.chroxy/config.json` regardless of which group it appears in.
93
157
  | `allowedTools` | array | `--allowed-tools <list>` | `CHROXY_ALLOWED_TOOLS` | Auto-approved tools (CLI mode) |
94
158
  | `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
159
  | `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. |
160
+ | `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
161
  | `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. |
162
+ | `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
163
  | `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
164
  | `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
165
 
@@ -114,6 +178,9 @@ of `~/.chroxy/config.json` regardless of which group it appears in.
114
178
  |-----|------|----------|---------------------|-------------|
115
179
  | `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
180
  | `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. |
181
+ | `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. |
182
+ | `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). |
183
+ | `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, maxConsecutiveWakes?: 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). `maxConsecutiveWakes` (default `3`, floored to an integer ≥ 1) bounds the wake → push → CI → wake loop (#8326): after that many daemon wakes into one session with no user-typed input between (typing in chat or the terminal pane resets the count; a daemon-authored wake does not), the next wake is refused with outcome `wake-cap` and logged, while the `ci_complete` push notification still goes out. The count is in-memory, per session, and starts at 0 after a daemon restart. Mailbox and scheduler/orchestration turns are neither counted nor capped. |
117
184
 
118
185
  ### Control Room
119
186
 
@@ -138,7 +205,9 @@ of `~/.chroxy/config.json` regardless of which group it appears in.
138
205
 
139
206
  | Key | Type | CLI Flag | Environment Variable | Description |
140
207
  |-----|------|----------|---------------------|-------------|
208
+ | _(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
209
  | _(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> }`. |
210
+ | _(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
211
 
143
212
  ### Environment variable names
144
213
 
@@ -161,6 +230,11 @@ helper that consumes them, bypassing the merge layer entirely:
161
230
  `summarize` object), and `CHROXY_BINARY_PROVENANCE` /
162
231
  `CHROXY_BINARY_SIGNATURE_GATE` (`binaryProvenance`).
163
232
 
233
+ `CHROXY_CONFIG_DIR` is a direct read too, and necessarily so — the merge layer
234
+ reads `config.json`, and this variable is what decides which `config.json` that
235
+ is. It is read **per filesystem call** rather than once at import, for the reason
236
+ given in [The config root](#the-config-root-chroxy_config_dir).
237
+
164
238
  **The naive fallback.** 16 schema keys have no explicit `envKeyForConfig` entry,
165
239
  so their *merge-layer* lookup falls back to a bare `key.toUpperCase()` — which
166
240
  drops the `CHROXY_` prefix and all word separators: `features` → `FEATURES`,
@@ -192,18 +266,21 @@ rather than being silently dropped.
192
266
  |-------|---------------------|
193
267
  | `billing` | `creditTier`, `monthlyCreditBudgetUsd`, `budgetWarningPercent`, `egressCheck`, `datacenterPrefixes` |
194
268
  | `worktreeGc` | `autoReap`, `reapIntervalMs`, `maxLockAgeMs` |
269
+ | `orphanReap` | `enabled`, `sweepIntervalMs`, `minAgeMs` |
270
+ | `sessionArchive` | `enabled`, `maxEntries`, `maxAgeDays`, `maxMegabytes` |
271
+ | `sessionCi` | `watch`, `wakeAgent`, `intervalMs`, `discoveryIntervalMs`, `maxSurveysPerTick`, `maxConsecutiveWakes` |
195
272
  | `userShell` | `enabled`, `requireApproval` |
196
273
  | `environments.k8s` | `namespace`, `inCluster`, `kubeconfigPath`, `sidecarImage`, `imagePullPolicy`, `connectMode`, `namespaceQuota`, `namespaceLimitRange`, `workspace` |
197
274
  | `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` |
275
+ | `notifications.discord` | `botName`, `billingAlerts`, `ciAlerts`, `colors`, `defaultColor`, `permissionColor`, `errorColor`, `updateThrottleMs`, `heartbeatIntervalMs`, `pruneAfterMs`, `staleAfterMs`, `offlineAfterMs`, `statePath`, `billingStatePath` |
276
+ | `providers` *(object form)* | `anthropicCompatible`, `openaiCompatible`, `acp`, `allowAnyModel` |
200
277
 
201
278
  `summarize`, `features`, and `orchestration` have no unknown-key check today, so
202
279
  a typo in one of those is silently ignored rather than warned about.
203
280
 
204
281
  ### Unrestricted provider models (`providers.allowAnyModel`)
205
282
 
206
- The static-allowlist subprocess providers (e.g. `gemini`, `codex`, `deepseek`)
283
+ The static-allowlist subprocess providers (currently `gemini` and `deepseek`)
207
284
  hard-reject a model id that is not in their built-in list, even when the upstream
208
285
  API already serves it — which otherwise forces a chroxy release just to add one.
209
286
  `providers.allowAnyModel` is an array of provider ids that opt out of that check
@@ -212,11 +289,29 @@ API already serves it — which otherwise forces a chroxy release just to add on
212
289
  ```json
213
290
  {
214
291
  "providers": {
215
- "allowAnyModel": ["codex", "gemini"]
292
+ "allowAnyModel": ["gemini"]
216
293
  }
217
294
  }
218
295
  ```
219
296
 
297
+ `codex` is no longer in that bucket (#7727): its allowlist is the installed
298
+ binary's own `model/list` answer, and it accepts any id while it has not been
299
+ able to ask. Listing `codex` here still works — the opt-out is checked ahead of
300
+ the catalog and is deliberately kept for a catalog that is wrong or unreachable
301
+ — but it is no longer needed to serve a model the OpenAI API already exposes,
302
+ and leaving it set makes a catalog that never arrived indistinguishable from one
303
+ that did.
304
+
305
+ That tri-state is worth naming, because "unrestricted" and "restricted to six
306
+ ids" are both wrong descriptions of codex today. **Catalog in hand** → its ids
307
+ are authoritative at both gates (`set_model` and session creation). **No catalog**
308
+ (cold daemon, an unresolved or failed probe, a binary below the `model/list`
309
+ floor) → unrestricted; any id is passed through to the binary. The two are
310
+ different facts and are never collapsed, so a probe that wedged does not silently
311
+ empty the picker. Where the catalog comes from, and what it does and does not
312
+ carry — notably **no context window** — is documented in
313
+ [Where the model list comes from](../../docs/providers.md#where-the-model-list-comes-from-modellist).
314
+
220
315
  An opted-in provider passes the model id through verbatim and lets the upstream
221
316
  API be the validator. Default is **off** for every provider, so the
222
317
  misconfiguration-catching strictness is preserved unless you explicitly opt in.
@@ -247,7 +342,7 @@ phrase list. The pattern is OR-ed with the default; setting it cannot
247
342
  the source fails to compile (unbalanced brackets, etc.) the server logs a
248
343
  warning and falls back to the default pattern only.
249
344
 
250
- This config is consumed by the auto-evaluator hook (see `shouldSkipEvaluator`
345
+ This config is consumed by the auto-evaluator hook (see `shouldSkipEvaluatorAsync`
251
346
  in `packages/server/src/prompt-evaluator.js`); the on-demand "Evaluate"
252
347
  button in the dashboard always evaluates, regardless of this setting.
253
348
 
@@ -500,16 +595,104 @@ The `provider` key picks which AI CLI backs a session by default:
500
595
 
501
596
  | Value | Backing binary / SDK | Required env |
502
597
  |-------|----------------------|--------------|
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` |
598
+ | `claude-sdk` (default, #8266) | `@anthropic-ai/claude-agent-sdk` | Claude Code login or `ANTHROPIC_API_KEY` |
599
+ | `claude-tui` | drives the interactive `claude` TUI under a PTY (the default from #5819 until #8266) | Claude Code subscription login |
505
600
  | `claude-cli` | `claude -p` (Claude Code CLI) | Claude Code login (CLI intentionally strips `ANTHROPIC_API_KEY` from its environment) |
506
601
  | `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` |
602
+ | `gemini` | `gemini --prompt=<text>` CLI | `GEMINI_API_KEY` |
508
603
  | `codex` | `codex exec` CLI | `OPENAI_API_KEY` |
509
604
  | `docker-sdk` / `docker-cli` | Claude SDK/CLI inside a Docker container | Requires `environments.enabled=true` + Docker |
510
605
 
511
606
  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
607
 
608
+ ### Agent connections
609
+
610
+ `agentConnections` assigns stable host-local names to explicit authentication
611
+ routes. A current client shows these entries under their runtime before creating
612
+ a session and sends the selected `connectionId`. The daemon persists the selected
613
+ descriptor with the session. Restore requires the same descriptor version, stable
614
+ connection id, runtime id, and requested authentication route; if any member of
615
+ that identity tuple changes or the connection is removed, restore is refused.
616
+
617
+ ```json
618
+ {
619
+ "agentConnections": [
620
+ {
621
+ "id": "codex-subscription",
622
+ "label": "Codex subscription",
623
+ "provider": "openai",
624
+ "runtime": "codex",
625
+ "authRoute": "native"
626
+ },
627
+ {
628
+ "id": "codex-api",
629
+ "label": "Codex API",
630
+ "provider": "openai",
631
+ "runtime": "codex",
632
+ "authRoute": "api",
633
+ "credentialKey": "OPENAI_API_KEY"
634
+ },
635
+ {
636
+ "id": "local-ollama",
637
+ "label": "Local Ollama",
638
+ "provider": "local",
639
+ "runtime": "ollama",
640
+ "authRoute": "local",
641
+ "inferenceLocation": "local"
642
+ }
643
+ ]
644
+ }
645
+ ```
646
+
647
+ Supported built-in route/runtime pairs are `claude-tui` + `native`, `codex` +
648
+ `native` or `api`, `claude-byok` + `api`, and `ollama` + `local`. Other pairs,
649
+ including imported ACP authentication, appear as unsupported and cannot create a
650
+ session. Native credentials remain in the vendor CLI's own store. API entries
651
+ refer to the runtime's existing Chroxy credential-store slot or environment
652
+ variable by name (`OPENAI_API_KEY` for Codex and `ANTHROPIC_API_KEY` for Claude
653
+ BYOK); unsupported references cannot create a session. Literal `apiKey`,
654
+ `token`, `credential`, or `secret` fields are rejected.
655
+ Connection descriptors never contain credential values.
656
+
657
+ For Codex, a native selection removes OpenAI API environment settings from that
658
+ child process; an API selection supplies only the selected Chroxy credential.
659
+ Both explicit routes start Codex with per-process configuration that selects the
660
+ built-in `openai` provider and pins its API and ChatGPT service base URLs to the
661
+ vendor endpoints. Before `thread/start`, the daemon verifies the effective
662
+ provider with `config/read` and the requested credential class with
663
+ `account/read`; it then requires `thread/start` to report the built-in provider
664
+ before marking the connection ready. The daemon never switches between routes
665
+ automatically. Native login establishes the subscription billing route, while
666
+ account identity and entitlement eligibility remain `unknown` until Codex offers
667
+ an authoritative source.
668
+
669
+ For Claude, an explicit native selection removes API-key, bearer-token, custom
670
+ endpoint, and third-party cloud-provider route settings from the child process.
671
+ Session startup pins the generated settings to Anthropic's first-party endpoint
672
+ while retaining the normal Claude Code settings sources. It reruns the configured
673
+ binary health, quarantine, signature, and provenance checks immediately before both
674
+ `claude auth status --json` and the TUI spawn, using the exact binary, resolved
675
+ project directory, child environment, and generated settings file. The auth
676
+ probe must report `claude.ai` authentication through its first-party API provider
677
+ with no API-key source. A shell-free `SessionStart` hook then observes the
678
+ settings environment applied inside the real TUI process; a fresh session-private
679
+ nonce must confirm the exact Anthropic endpoint and the absence of API-key,
680
+ bearer-token, gateway, and third-party cloud selectors before Chroxy marks the
681
+ session ready. Missing, stale, custom, or unverifiable routes stop that TUI.
682
+ Every respawn repeats the full sequence. User, project, local, and managed
683
+ Claude Code settings, instructions, skills, hooks, and plugins continue to load;
684
+ if any effective setting changes the observed authentication or endpoint route,
685
+ the startup check fails closed. Chroxy runtime skills injected with
686
+ `--append-system-prompt` and Chroxy's permission hook/rules also continue to
687
+ apply. This proves the route at each startup, but it cannot prove that an
688
+ administrator will not refresh managed settings later in
689
+ the lifetime of an already-running vendor process. Discovery remains process-free
690
+ and reports readiness as unknown until startup. Legacy provider-only
691
+ `claude-tui` sessions keep their existing environment and settings behavior.
692
+ The native route is subscription billed; account identity and entitlement
693
+ eligibility remain `unknown` because the status command does not establish
694
+ either one.
695
+
513
696
  ### `claude-channel` (research preview)
514
697
 
515
698
  `claude-channel` drives Claude through Anthropic's first-party **channels MCP
@@ -808,7 +991,8 @@ The non-secret knobs live under `notifications.discord` in `config.json`:
808
991
  "updateThrottleMs": 15000,
809
992
  "heartbeatIntervalMs": 300000,
810
993
  "pruneAfterMs": 86400000,
811
- "billingAlerts": true
994
+ "billingAlerts": true,
995
+ "ciAlerts": true
812
996
  }
813
997
  }
814
998
  }
@@ -825,6 +1009,11 @@ The non-secret knobs live under `notifications.discord` in `config.json`:
825
1009
  | `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
1010
  | `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
1011
  | `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 |
1012
+ | `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 |
1013
+ | `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 |
1014
+ | `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` |
1015
+ | `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` |
1016
+ | `billingStatePath` | string | Override for the billing-alert state store (default `~/.chroxy/discord-billing-state.json`), the billing-sink counterpart to `statePath` |
828
1017
 
829
1018
  Status-message state (message ids, current state per project) persists in
830
1019
  `~/.chroxy/discord-webhook-state.json`; the billing-alert message tracks its own
@@ -867,13 +1056,12 @@ identical to a daemon without the feature.
867
1056
  When on, at each task's due time the daemon spins up (or resumes) that task's
868
1057
  session and runs its prompt with **no client connected**.
869
1058
 
870
- ##### Supported providers — hook-routed providers (including the default) are refused
1059
+ ##### Supported providers — hook-routed providers are refused
871
1060
 
872
1061
  > **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
1062
+ > in-process.** Right now that is `claude-sdk` (the daemon default), `claude-byok`,
1063
+ > `codex` (the app-server driver), `deepseek`, and `ollama`. Every other provider —
1064
+ > `claude-tui`, `claude-cli`, `claude-channel`, and `gemini` — is **refused**: the task does not fire, no session is created, and the
877
1065
  > run is recorded with status `refused` naming the provider.
878
1066
 
879
1067
  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 })