@chroxy/server 0.10.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.
- package/CONFIG.md +602 -19
- package/README.md +2 -2
- package/hooks/claude-native-route-check.mjs +17 -0
- package/hooks/permission-hook.sh +416 -11
- package/package.json +20 -23
- package/sidecar/Dockerfile +1 -1
- package/sidecar/PROTOCOL.md +9 -1
- package/sidecar/agent.js +102 -10
- package/sidecar/package-lock.json +3 -3
- package/src/acp-config.js +206 -0
- package/src/acp-session.js +954 -0
- package/src/activity-registry.js +110 -5
- package/src/agent-connections.js +293 -0
- package/src/agent-control/client.js +1616 -0
- package/src/agent-control/events.js +547 -0
- package/src/agent-control/local-connection.js +275 -0
- package/src/agent-control/mcp-server.js +545 -0
- package/src/anthropic-compatible-config.js +29 -4
- package/src/anthropic-compatible-session.js +15 -6
- package/src/anthropic-openai-shim.js +0 -1
- package/src/archive-continuation.js +164 -0
- package/src/assistant-response.js +24 -0
- package/src/auth-probes.js +120 -13
- package/src/background-shell-tracker.js +27 -0
- package/src/base-session.js +1353 -41
- package/src/bearer-recheck.js +49 -0
- package/src/billing-budget.js +24 -1
- package/src/billing-class.js +40 -7
- package/src/binary-provenance-trust.js +101 -0
- package/src/bound-client-policy.js +279 -0
- package/src/built-in-tools/bash-exec.js +46 -7
- package/src/built-in-tools/file-ops.js +74 -9
- package/src/built-in-tools/tool-transforms.js +1113 -13
- package/src/byok-compose-state.js +6 -9
- package/src/byok-credentials.js +2 -3
- package/src/byok-mcp-client.js +1153 -20
- package/src/byok-mcp-config.js +1712 -8
- package/src/byok-mcp-fleet.js +416 -29
- package/src/byok-mcp-oauth-store.js +329 -0
- package/src/byok-mcp-oauth.js +635 -0
- package/src/byok-mcp-trust.js +257 -40
- package/src/byok-session.js +1400 -149
- package/src/byok-tool-executor.js +2681 -38
- package/src/byok-tools.js +9 -2
- package/src/channels/chroxy-channel-server.js +2 -3
- package/src/checkpoint-manager.js +96 -51
- package/src/chroxy-host-metadata.js +122 -0
- package/src/claude-channel-session.js +16 -10
- package/src/claude-model-catalog.js +131 -16
- package/src/claude-model-refresh.js +385 -0
- package/src/claude-model-request.js +103 -0
- package/src/claude-stream-parser.js +109 -3
- package/src/claude-tui/diagnostic-tail.js +83 -0
- package/src/claude-tui/form-driver.js +44 -7
- package/src/claude-tui/model-error.js +41 -0
- package/src/claude-tui/pty-driver.js +223 -60
- package/src/claude-tui/sanitize-question-payload.js +109 -0
- package/src/claude-tui/usage-limit.js +239 -0
- package/src/claude-tui-session.js +3611 -286
- package/src/claude-tui-tool-response.js +300 -0
- package/src/cli/agent-control-cmd.js +65 -0
- package/src/cli/config-cmd.js +6 -6
- package/src/cli/config-dir-cmd.js +234 -0
- package/src/cli/deploy-cmd.js +46 -11
- package/src/cli/doctor-cmd.js +7 -3
- package/src/cli/init-cmd.js +16 -17
- package/src/cli/providers-cmd.js +6 -6
- package/src/cli/schedule-cmd.js +804 -0
- package/src/cli/server-cmd.js +64 -2
- package/src/cli/service-cmd.js +70 -27
- package/src/cli/session-cmd.js +227 -74
- package/src/cli/shared.js +168 -14
- package/src/cli/tokens-cmd.js +212 -0
- package/src/cli/tunnel-cmd.js +256 -25
- package/src/cli/worktree-gc-cmd.js +2 -2
- package/src/cli-session.js +1117 -116
- package/src/cli.js +8 -0
- package/src/codex-app-server-client.js +36 -3
- package/src/codex-app-server-session.js +2108 -101
- package/src/codex-bundled-client.js +66 -0
- package/src/codex-model-catalog.js +548 -0
- package/src/codex-model-rejections.js +87 -0
- package/src/codex-native-resume.js +104 -0
- package/src/codex-protocol-capabilities.js +188 -0
- package/src/codex-session.js +571 -45
- package/src/config-dir-migration.js +444 -0
- package/src/config-dir.js +108 -0
- package/src/config.js +738 -52
- package/src/connection-authority.js +48 -0
- package/src/connection-info.js +5 -9
- package/src/connection-locality.js +60 -0
- package/src/container-liveness-monitor.js +189 -0
- package/src/continuation-metadata-worker.js +17 -0
- package/src/continuations.js +114 -0
- package/src/control-room/host-prune.js +5 -0
- package/src/control-room/integrations.js +23 -30
- package/src/control-room/skills-inventory.js +8 -3
- package/src/control-room/survey.js +32 -0
- package/src/conversation-scanner.js +40 -18
- package/src/conversation-scope.js +59 -39
- package/src/conversation-search.js +24 -22
- package/src/credential-store.js +279 -29
- package/src/daemon-commit.js +92 -0
- package/src/daemon-idle-state.js +171 -0
- package/src/daemon-update-status.js +314 -0
- package/src/dashboard-build.js +70 -0
- package/src/declared-status.js +90 -0
- package/src/deepseek-credentials.js +2 -3
- package/src/dev-preview.js +169 -182
- package/src/device-preferences.js +2 -2
- package/src/diagnostics.js +3 -0
- package/src/diff-parser.js +87 -0
- package/src/discord-credentials.js +2 -3
- package/src/docker-byok-pool.js +3 -1
- package/src/docker-byok-session.js +678 -78
- package/src/docker-image-allowlist.js +23 -1
- package/src/docker-sdk-session.js +188 -4
- package/src/docker-session.js +293 -10
- package/src/doctor.js +783 -66
- package/src/edited-input.js +264 -0
- package/src/environment-manager.js +175 -36
- package/src/environments/authority.js +95 -0
- package/src/environments/backends/container-claude-spawn.js +94 -0
- package/src/environments/backends/docker.js +39 -10
- package/src/environments/backends/k8s.js +58 -24
- package/src/environments/destroy-with-sessions.js +142 -0
- package/src/event-ingest.js +137 -14
- package/src/event-normalizer.js +363 -110
- package/src/external-session-registry.js +0 -0
- package/src/gemini-session.js +100 -7
- package/src/github-webhook.js +188 -4
- package/src/handler-utils.js +563 -62
- package/src/handlers/checkpoint-handlers.js +162 -20
- package/src/handlers/control-room-handlers.js +99 -29
- package/src/handlers/conversation-handlers.js +563 -25
- package/src/handlers/credential-handlers.js +43 -2
- package/src/handlers/daemon-update-handlers.js +81 -0
- package/src/handlers/evaluator-handlers.js +14 -1
- package/src/handlers/feature-handlers.js +186 -69
- package/src/handlers/file-handlers.js +101 -13
- package/src/handlers/github-webhook-handlers.js +204 -0
- package/src/handlers/input-handlers.js +689 -48
- package/src/handlers/orchestration-handlers.js +238 -0
- package/src/handlers/scheduler-handlers.js +584 -0
- package/src/handlers/session-handlers.js +546 -16
- package/src/handlers/session-pr-status-handlers.js +283 -0
- package/src/handlers/session-pr-threads-handlers.js +247 -0
- package/src/handlers/settings-handlers.js +822 -35
- package/src/handlers/skills-handlers.js +13 -4
- package/src/handlers/summarize-handlers.js +32 -1
- package/src/handlers/survey-throttle.js +380 -0
- package/src/handlers/token-handlers.js +11 -2
- package/src/health-proof.js +40 -0
- package/src/history-page.js +104 -0
- package/src/http-routes.js +286 -8
- package/src/ide/search.js +24 -6
- package/src/ide/symbols.js +20 -6
- package/src/input-context.js +117 -0
- package/src/instruction-policy-compiler.js +229 -0
- package/src/instruction-policy.js +250 -0
- package/src/jsonl-reader.js +309 -48
- package/src/jsonl-subprocess-session.js +122 -9
- package/src/keychain.js +160 -13
- package/src/logger.js +240 -31
- package/src/mailbox-route.js +11 -22
- package/src/message-wire.js +386 -0
- package/src/model-discovery.js +43 -3
- package/src/models.js +1276 -174
- package/src/notification-prefs.js +100 -10
- package/src/notifications/discord-billing-sink.js +22 -5
- package/src/notifications/discord-ci-sink.js +243 -0
- package/src/notifications/discord-webhook-client.js +71 -0
- package/src/notifications/discord-webhook-sink.js +82 -12
- package/src/notifications/expo-push-sink.js +85 -6
- package/src/notifications/ready-body.js +16 -5
- package/src/ollama-session.js +34 -2
- package/src/orchestration/build-manager.js +63 -0
- package/src/orchestration/decision-contract.js +245 -0
- package/src/orchestration/git-ops.js +381 -0
- package/src/orchestration/orchestration-manager.js +1342 -0
- package/src/orchestration/permission-gate.js +121 -0
- package/src/orchestration/role-prompts.js +136 -0
- package/src/orchestration/run-budget.js +81 -0
- package/src/orchestration/run-ledger.js +487 -0
- package/src/orchestration/run-model.js +206 -0
- package/src/orchestration/run-record.js +336 -0
- package/src/orchestration/run-report.js +194 -0
- package/src/orchestration/to-wire.js +201 -0
- package/src/orchestration/turn-driver.js +422 -0
- package/src/orphan-reaper.js +413 -0
- package/src/outgoing-policy.js +183 -0
- package/src/pairing.js +236 -12
- package/src/path-hash-trust-ledger.js +642 -25
- package/src/permission-audit.js +79 -3
- package/src/permission-deadlines.js +82 -0
- package/src/permission-floor.js +1770 -0
- package/src/permission-hook.js +180 -69
- package/src/permission-manager.js +1175 -94
- package/src/permission-mode-support.js +35 -0
- package/src/permission-resolver.js +174 -12
- package/src/permission-rule-store.js +411 -0
- package/src/permission-scope.js +43 -0
- package/src/platform.js +483 -23
- package/src/preview-ingress.js +54 -0
- package/src/preview-target.js +213 -0
- package/src/prompt-evaluator.js +34 -4
- package/src/provider-customization.js +180 -0
- package/src/providers.js +228 -6
- package/src/push.js +30 -4
- package/src/question-route-map.js +130 -0
- package/src/redaction.js +360 -8
- package/src/roster-broadcast.js +186 -0
- package/src/schedule-parser.js +311 -0
- package/src/scheduled-task-store.js +945 -0
- package/src/scheduler.js +1099 -0
- package/src/sdk-session.js +2374 -168
- package/src/server-cli/preview-shutdown.js +22 -0
- package/src/server-cli/push-notification-handler.js +11 -2
- package/src/server-cli/server-orchestrator.js +50 -4
- package/src/server-cli/tunnel-lifecycle-handler.js +3 -2
- package/src/server-cli-child.js +33 -18
- package/src/server-cli.js +760 -62
- package/src/server-identity.js +42 -14
- package/src/service.js +682 -53
- package/src/session-archive-limits.js +15 -0
- package/src/session-archive.js +1029 -0
- package/src/session-busy-state.js +72 -0
- package/src/session-ci-watcher.js +926 -0
- package/src/session-context.js +7 -2
- package/src/session-manager.js +3879 -308
- package/src/session-message-history.js +749 -37
- package/src/session-pr-status.js +654 -0
- package/src/session-pr-threads.js +271 -0
- package/src/session-preset-trust.js +3 -3
- package/src/session-preset.js +10 -5
- package/src/session-state-persistence.js +94 -17
- package/src/session-timeout-manager.js +20 -0
- package/src/session-title.js +168 -0
- package/src/session-token-store.js +70 -36
- package/src/session-wake.js +240 -0
- package/src/shell-approval-info.js +2 -2
- package/src/shell-approval-store.js +3 -1
- package/src/skills-loader.js +7 -4
- package/src/skills-manager.js +2 -2
- package/src/skills-trust.js +95 -13
- package/src/skills-usage.js +22 -5
- package/src/snapshots-store.js +2 -3
- package/src/statusline.js +596 -0
- package/src/subagent-counter.js +9 -1
- package/src/summarize-session.js +51 -4
- package/src/supervisor.js +99 -38
- package/src/sweep-stale-provider-dirs.js +95 -0
- package/src/thinking-level-wire.js +39 -0
- package/src/thinking-stream.js +179 -0
- package/src/token-manager.js +39 -9
- package/src/tool-result.js +61 -0
- package/src/transcript-sources.js +109 -0
- package/src/transcript-tasks.js +413 -31
- package/src/trusted-file-read.js +302 -0
- package/src/tunnel/base.js +0 -8
- package/src/tunnel/cloudflare.js +145 -35
- package/src/tunnel/index.js +13 -1
- package/src/tunnel/preview.js +64 -0
- package/src/tunnel-check.js +1 -1
- package/src/turn-outcome.js +137 -0
- package/src/turn-tracker.js +0 -0
- package/src/usage-normalize.js +122 -0
- package/src/user-shell-session.js +157 -37
- package/src/utils/agent-sdk-version.js +107 -0
- package/src/utils/argv-safety.js +741 -0
- package/src/utils/auth-cause.js +60 -0
- package/src/utils/binary-package-manifest.js +597 -0
- package/src/utils/binary-version.js +224 -0
- package/src/utils/bounded-regex-worker.js +25 -0
- package/src/utils/bounded-regex.js +153 -0
- package/src/utils/claude-binary.js +43 -0
- package/src/utils/claude-config-dir.js +245 -0
- package/src/utils/claude-login-command.js +16 -0
- package/src/utils/claude-native-route.js +81 -0
- package/src/utils/componentwise-resolver.js +301 -0
- package/src/utils/composite-key.js +45 -0
- package/src/utils/deploy-control-files.js +87 -0
- package/src/utils/exec-failure-reason.js +21 -0
- package/src/utils/git-repo.js +42 -0
- package/src/utils/is-entry-point.js +137 -0
- package/src/utils/iso-datetime.js +51 -0
- package/src/utils/node-pty-probe.js +95 -0
- package/src/utils/node-pty-support.js +118 -0
- package/src/utils/opened-file-path.js +167 -0
- package/src/utils/path-containment.js +165 -0
- package/src/utils/permission-mode-sidecar.js +51 -0
- package/src/utils/preflight.js +485 -29
- package/src/utils/read-limiter.js +217 -0
- package/src/utils/regular-file.js +375 -0
- package/src/utils/safe-regex.js +113 -0
- package/src/utils/small-file.js +129 -0
- package/src/utils/spawn-env.js +196 -5
- package/src/utils/stale-session-dirs.js +182 -0
- package/src/utils/stat-identity.js +43 -0
- package/src/utils/verify-binary.js +276 -0
- package/src/utils/verify-provenance.js +634 -0
- package/src/utils/wire-counters.js +48 -0
- package/src/web-task-manager.js +256 -16
- package/src/worktree-gc.js +11 -3
- package/src/ws-auth.js +69 -21
- package/src/ws-broadcaster.js +14 -2
- package/src/ws-client-manager.js +16 -1
- package/src/ws-client-sender.js +7 -0
- package/src/ws-file-ops/browser.js +370 -66
- package/src/ws-file-ops/common.js +384 -11
- package/src/ws-file-ops/git.js +615 -44
- package/src/ws-file-ops/index.js +7 -0
- package/src/ws-file-ops/memory.js +460 -0
- package/src/ws-file-ops/open-nofollow.js +354 -0
- package/src/ws-file-ops/reader.js +676 -94
- package/src/ws-forwarding.js +373 -55
- package/src/ws-handler-context.js +89 -2
- package/src/ws-history.js +1018 -177
- package/src/ws-message-handlers.js +23 -1
- package/src/ws-outbound-schemas.js +207 -0
- package/src/ws-permissions.js +589 -38
- package/src/ws-schemas.js +6 -0
- package/src/ws-server.js +936 -105
- package/src/dashboard-next/dist/assets/index-C2ipeGlq.js +0 -111
- package/src/dashboard-next/dist/assets/index-DM-_dISG.css +0 -1
- package/src/dashboard-next/dist/index.html +0 -13
package/CONFIG.md
CHANGED
|
@@ -11,32 +11,314 @@ 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
|
|
|
77
|
+
Every key below is a real entry in `CONFIG_SCHEMA`
|
|
78
|
+
([`packages/server/src/config.js`](src/config.js)) — that object is the
|
|
79
|
+
authoritative list, and anything not in it triggers an `Unknown config key`
|
|
80
|
+
warning at startup and is ignored.
|
|
81
|
+
|
|
82
|
+
The tables are grouped for readability only; every key lives at the **top level**
|
|
83
|
+
of `~/.chroxy/config.json` regardless of which group it appears in.
|
|
84
|
+
|
|
85
|
+
### Core server
|
|
86
|
+
|
|
16
87
|
| Key | Type | CLI Flag | Environment Variable | Description |
|
|
17
88
|
|-----|------|----------|---------------------|-------------|
|
|
18
89
|
| `apiToken` | string | - | `API_TOKEN` | Authentication token for clients |
|
|
19
|
-
| `
|
|
20
|
-
| `port` | number | - | `PORT` | Local WebSocket port (default: 8765) |
|
|
90
|
+
| `port` | number | - | `PORT` | Local WebSocket port (default: 8765). Range `1`–`65535`. |
|
|
21
91
|
| `host` | string | `--host <address>` | `CHROXY_HOST` | Bind address for the server socket. Unset binds `0.0.0.0` (all interfaces) so the mobile app / LAN clients can reach it. Set to `127.0.0.1` for a loopback-only bind that keeps auth enabled — opt-in defence-in-depth for single-device setups. `--no-auth` always forces loopback regardless of this key. When bound to loopback the mDNS `_chroxy._tcp` advertisement is suppressed (the server is not LAN-reachable). |
|
|
22
|
-
| `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. |
|
|
23
|
-
| `shell` | string | - | `SHELL_CMD` | Shell to use (default: `$SHELL` or `/bin/zsh`) |
|
|
24
92
|
| `cwd` | string | `--cwd <path>` | `CHROXY_CWD` | Working directory (CLI mode) |
|
|
25
|
-
| `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. |
|
|
26
|
-
| `allowedTools` | array | `--allowed-tools <list>` | `CHROXY_ALLOWED_TOOLS` | Auto-approved tools (CLI mode) |
|
|
27
93
|
| `noAuth` | boolean | `--no-auth` | `CHROXY_NO_AUTH` | Disable authentication (localhost only) |
|
|
94
|
+
| `externalUrl` | string | - | `CHROXY_EXTERNAL_URL` | Public URL clients should use instead of a Cloudflare tunnel — for operators who front the daemon with their own reverse proxy / VPN / ingress. When set, tunnel startup **and** the supervisor are skipped. Must parse as a URL with an `http:` or `https:` scheme; a malformed value warns at startup. |
|
|
95
|
+
| `showToken` | boolean | `--show-token` | `CHROXY_SHOW_TOKEN` | Print the full API token in the terminal connect block instead of a masked prefix. Off by default so a shared screen / recorded terminal doesn't leak the token. |
|
|
96
|
+
| `logFormat` | string | `--log-format <format>` | `CHROXY_LOG_FORMAT` | Log output format: `text` (default) or `json`. Any value other than the literal `json` keeps the human-readable text logger. |
|
|
97
|
+
| `maxRestarts` | number | `--max-restarts <count>` | `CHROXY_MAX_RESTARTS` | Max consecutive child restarts the supervisor attempts before giving up and exiting (default `10`). Only applies in supervisor mode (the default for `chroxy start` with a tunnel). |
|
|
98
|
+
| `terminalDownGraceMs` | number | - | `CHROXY_TERMINAL_DOWN_GRACE_MS` | How long the supervisor keeps serving a terminal `status: "down"` health response (reason `supervisor_gave_up`) after exhausting `maxRestarts`, before exiting — long enough for a polling client to latch the terminal state instead of seeing a bare connection refusal (#6022). Default `15000` (15 s); `0` restores the pre-#6022 exit-immediately behaviour. |
|
|
99
|
+
| `noEncrypt` | boolean | `--no-encrypt` | `CHROXY_NO_ENCRYPT` | Disable end-to-end message encryption (dev/testing only). Transport TLS from the tunnel still applies, but message payloads are no longer encrypted between client and daemon. |
|
|
100
|
+
| `encryptLocalhost` | boolean | - | `CHROXY_ENCRYPT_LOCALHOST` | Force E2E encryption on loopback connections too, disabling the localhost plaintext bypass unconditionally (#6564). Off by default — the bypass is already auto-disabled whenever a tunnel is active. |
|
|
101
|
+
| `tokenExpiry` | string | - | `CHROXY_TOKEN_EXPIRY` | Rotation lifetime for the **primary API token** (`24h`, `7d`, …). When set, the token manager rotates the token on expiry and honours a short grace window for the previous value. Unset (the default) means the primary token never expires. Distinct from `sessionTokenTtl`, which governs *paired device* session tokens. |
|
|
102
|
+
| `sessionTokenTtl` | string | - | `CHROXY_SESSION_TOKEN_TTL` | *(default `30d`)* How long a paired device's session token stays valid without reconnecting (#6598). **Sliding** — each successful connect refreshes it, so only an *idle* device expires. A duration string (`30d`, `15d`, `12h`); floored at 5 min. Tokens are persisted encrypted at rest (`~/.chroxy/session-tokens.json`), so they now survive daemon restarts. Longer = fewer re-pairs but a wider stolen-token window; you own the dial. |
|
|
103
|
+
| `repos` | array | - | `CHROXY_REPOS` | Explicit list of git repository paths the Control Room surveys and `chroxy worktree gc` sweeps. Unioned with the repos auto-discovered under [`controlRoomRoot`](#control-room) — an explicit entry is never dropped even if it lives outside that root. |
|
|
104
|
+
|
|
105
|
+
### Sessions, history, and limits
|
|
106
|
+
|
|
107
|
+
| Key | Type | CLI Flag | Environment Variable | Description |
|
|
108
|
+
|-----|------|----------|---------------------|-------------|
|
|
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
|
+
| `maxMessages` | number | `--max-messages <count>` | `CHROXY_MAX_MESSAGES` | Messages retained per session before FIFO eviction (default `1000`). |
|
|
111
|
+
| `maxHistory` | number | - | `CHROXY_MAX_HISTORY` | Legacy alias for `maxMessages`. `maxMessages` wins when both are set; prefer the canonical key. |
|
|
112
|
+
| `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. |
|
|
113
|
+
| `maxToolInput` | number | `--max-tool-input <bytes>` | `CHROXY_MAX_TOOL_INPUT` | Maximum tool-input size in bytes before the input is truncated and a notice is surfaced in the transcript. Default `262144` (256 KB). |
|
|
114
|
+
| `sessionTimeout` | string | `--session-timeout <duration>` | `CHROXY_SESSION_TIMEOUT` | Idle-session timeout as a duration string (`2h`, `30m`). **Disabled by default.** Minimum 30 s; a malformed duration or a sub-30s value warns at startup. This is a plain idle reaper — distinct from the [inactivity safety net](#inactivity-safety-net), which measures silence *within* a running turn. |
|
|
28
115
|
| `costBudget` | number | `--cost-budget <dollars>` | `CHROXY_COST_BUDGET` | Per-session cost budget in dollars. Applied independently to each session (not a shared pool across sessions). Warns at 80%, pauses the session at 100%. |
|
|
29
|
-
| `
|
|
30
|
-
| `
|
|
31
|
-
| `
|
|
32
|
-
| `
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
116
|
+
| `summarize` | object | - | `CHROXY_SEMANTIC_TITLES_MODEL`, `CHROXY_SEMANTIC_TITLES_TIMEOUT_MS` *(title path only)* | Optional override for one-shot summarizer calls (#5547): `{ provider?: string, model?: string, titleTimeoutMs?: number }`. `model` makes the sidebar "Summarize & start new session" action use a cheaper model than the target session's own; `provider` is accepted for forward-compat but the one-shot path currently always runs through the SDK provider. `titleTimeoutMs` is read by the semantic-title path — see [Semantic session titles](#semantic-session-titles-featuressemantictitles). Unset ⇒ summarize with the session's own model. |
|
|
117
|
+
| `transforms` | array | - | `CHROXY_TRANSFORMS` | Opt-in prompt pre-processing pipeline, as a list of built-in transform names applied in order to each outgoing user message. Built-ins: `contextAnnotation` (prefixes `cwd` / `model` / `git branch` / `platform` as ambient context, skipped for messages under 10 chars) and `voiceCleanup` (strips voice-to-text filler words and normalises punctuation — only fires when the message was flagged as voice input). Empty / unset ⇒ messages pass through unchanged. |
|
|
118
|
+
| `sandbox` | object | - | `CHROXY_SANDBOX` | SDK sandbox settings forwarded verbatim to sessions for lightweight in-process isolation. Unset ⇒ no sandbox opts are threaded. Unrelated to the Codex per-session `codexSandbox` wire field and to the Docker/K8s [`environments`](#environments-isolation-and-worktrees) backends. |
|
|
119
|
+
| `promptEvaluatorSkipPattern` | string | - | *(unmapped — see [note](#environment-variable-names))* | Per-session regex source (case-insensitive) extending the default skip list used by the prompt evaluator's trivial-message heuristic. See [Prompt evaluator skip heuristic](#prompt-evaluator-skip-heuristic) below. |
|
|
120
|
+
|
|
121
|
+
### Timeouts
|
|
122
|
+
|
|
123
|
+
| Key | Type | CLI Flag | Environment Variable | Description |
|
|
124
|
+
|-----|------|----------|---------------------|-------------|
|
|
36
125
|
| `resultTimeoutMs` | number | - | `CHROXY_RESULT_TIMEOUT_MS` | Per-session **soft-warning** inactivity window in milliseconds. When no SDK / CLI event arrives within this window, the server emits an `inactivity_warning` event (#3899) so clients can render a check-in chip and surface a push notification — the session stays alive. The kill path is `hardTimeoutMs` (below). See [Inactivity safety net](#inactivity-safety-net). Default `1800000` (30 min); range `30000`–`86400000` (30 s – 24 h). |
|
|
37
126
|
| `hardTimeoutMs` | number | - | `CHROXY_HARD_TIMEOUT_MS` | Per-session **hard-kill** inactivity window in milliseconds. When `resultTimeoutMs` has already fired and silence continues to this longer threshold, the server emits `permission_expired` for every outstanding permission prompt, force-clears busy state, and emits a generic `error` event with `"Response timed out after <duration> of inactivity"` (#3899). Default `7200000` (2 h); range `30000`–`86400000` (30 s – 24 h). Must be ≥ `resultTimeoutMs` or the soft warning never fires — validator warns. |
|
|
127
|
+
| `streamStallTimeoutMs` | number | - | `CHROXY_STREAM_STALL_TIMEOUT_MS` | Stream-stall recovery window in ms (#4467). Resets on any stream activity from the child; when silence reaches this window *while the session is busy*, the session emits a recoverable error (`code: stream_stall`), clears busy state, and clients can offer a retry. Default `300000` (5 min); range `5000`–`86400000` (5 s – 24 h), or `0` to disable for operators with legitimately long event gaps. |
|
|
128
|
+
| `providerStreamStallTimeoutMs` | object | - | `CHROXY_PROVIDER_STREAM_STALL_TIMEOUT_MS` | Per-provider override map for `streamStallTimeoutMs`, keyed by provider id — e.g. `{ "codex": 900000, "gemini": 600000 }`. An entry wins over the global value for sessions on that provider; providers without an entry fall through to the global value. Each entry follows the same `5000`–`86400000`-or-`0` range; a bad entry warns and is dropped (falling back to the global value) rather than failing startup. As an env var, pass JSON: `CHROXY_PROVIDER_STREAM_STALL_TIMEOUT_MS='{"codex":900000}'`. |
|
|
38
129
|
| `backgroundShellHardQuiesceMs` | number | - | `CHROXY_BACKGROUND_SHELL_HARD_QUIESCE_MS` | How long a background shell (`Bash` with `run_in_background: true`) may go with **no new output** before the server treats it as finished and **reaps** its liveness tracking, so a finished-but-never-polled command stops pinning the session `running` forever (#5265). Default `14400000` (4 h); range `60000`–`86400000` (60 s – 24 h), or **`0` to disable** hard-reaping (advisory-only, the #5247 behaviour). **Tradeoff:** a genuinely long-running compute that emits no output for hours (and is never polled via `BashOutput`) could have its tracking reaped and the session become idle-timeout-eligible. A noisy long-runner (e.g. a dev server logging within the window) keeps its output-file mtime fresh and is never reaped. Operators running long silent computes should raise this (e.g. 6–8 h) or set `0`. |
|
|
39
|
-
|
|
|
130
|
+
| `mcpToolCallTimeoutMs` | number | - | `CHROXY_MCP_TOOL_CALL_TIMEOUT_MS` | Per-call timeout for MCP `tools/call` requests made by BYOK sessions (#4482). Default `30000` (30 s). Range `1000` (1 s) – `600000` (10 min) — below 1 s every realistic MCP server times out, above 10 min the conversation is already lost. Unlike `streamStallTimeoutMs`, `0` is **not** a disable sentinel: any non-positive value warns and the runtime falls back to the 30 s client default. |
|
|
131
|
+
|
|
132
|
+
### Tunnel and remote access
|
|
133
|
+
|
|
134
|
+
| Key | Type | CLI Flag | Environment Variable | Description |
|
|
135
|
+
|-----|------|----------|---------------------|-------------|
|
|
136
|
+
| `tunnel` | string | `--tunnel <mode>` | `CHROXY_TUNNEL` | Tunnel mode: `quick` (default — random Cloudflare URL, no account), `named` (stable hostname, requires a Cloudflare account + `cloudflared login`), `none`, or a `provider:mode` pair such as `cloudflare:named`. Ignored when `--no-auth` or `externalUrl` is in play. |
|
|
137
|
+
| `tunnelName` | string | `--tunnel-name <name>` | `CHROXY_TUNNEL_NAME` | Named-tunnel name (requires `cloudflared login`). Only meaningful with `tunnel: "named"`. |
|
|
138
|
+
| `tunnelHostname` | string | `--tunnel-hostname <host>` | `CHROXY_TUNNEL_HOSTNAME` | Named-tunnel public hostname, e.g. `chroxy.example.com`. Only meaningful with `tunnel: "named"`. |
|
|
139
|
+
| `tunnelConfig` | object | - | `CHROXY_TUNNEL_CONFIG` | Extra provider options spread into the tunnel provider's start call — an escape hatch for `cloudflared` knobs that have no dedicated key. As an env var, pass JSON. See [../../docs/named-tunnel-guide.md](../../docs/named-tunnel-guide.md). |
|
|
140
|
+
|
|
141
|
+
### Providers and models
|
|
142
|
+
|
|
143
|
+
| Key | Type | CLI Flag | Environment Variable | Description |
|
|
144
|
+
|-----|------|----------|---------------------|-------------|
|
|
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. |
|
|
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. |
|
|
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). |
|
|
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. |
|
|
150
|
+
|
|
151
|
+
### Permissions and security gates
|
|
152
|
+
|
|
153
|
+
| Key | Type | CLI Flag | Environment Variable | Description |
|
|
154
|
+
|-----|------|----------|---------------------|-------------|
|
|
155
|
+
| `allowedTools` | array | `--allowed-tools <list>` | `CHROXY_ALLOWED_TOOLS` | Auto-approved tools (CLI mode) |
|
|
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. |
|
|
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). |
|
|
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. |
|
|
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). |
|
|
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. |
|
|
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. |
|
|
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. |
|
|
163
|
+
|
|
164
|
+
### Skills
|
|
165
|
+
|
|
166
|
+
| Key | Type | CLI Flag | Environment Variable | Description |
|
|
167
|
+
|-----|------|----------|---------------------|-------------|
|
|
168
|
+
| `maxSkillBytes` | number | - | *(unmapped — see [note](#environment-variable-names))* | Per-skill byte cap. Skills exceeding this size are rejected with a sanitised log warning. Default `32768` (32KB). Set to `0` to disable the per-skill cap. |
|
|
169
|
+
| `maxTotalSkillBytes` | number | - | *(unmapped — see [note](#environment-variable-names))* | Global skills-context budget. When a session's merged active-skill set exceeds this size, lower-priority skills are dropped first (frontmatter `priority` defaults to 100; ties broken alphabetically). Default `262144` (256KB). Set to `0` to disable the global cap. |
|
|
170
|
+
| `providerSkillAllowlist` | object | - | *(unmapped — see [note](#environment-variable-names))* | Per-provider skill allowlist. Object keyed by provider id (e.g. `codex`, `gemini`); each value is an array of skill names that may load for that provider. See [Per-provider skill allowlist](#per-provider-skill-allowlist) below. |
|
|
171
|
+
| `trustMismatchMode` | string | - | *(unmapped — see [note](#environment-variable-names))* | One of `warn` or `block`. When set, the server records a SHA-256 hash of every loaded skill on first activation and compares it on every subsequent load. See [Skill content-hash trust](#skill-content-hash-trust) below. Disabled (no hashing) when omitted. |
|
|
172
|
+
|
|
173
|
+
### Environments, isolation, and worktrees
|
|
174
|
+
|
|
175
|
+
| Key | Type | CLI Flag | Environment Variable | Description |
|
|
176
|
+
|-----|------|----------|---------------------|-------------|
|
|
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). |
|
|
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). |
|
|
182
|
+
|
|
183
|
+
### Control Room
|
|
184
|
+
|
|
185
|
+
| Key | Type | CLI Flag | Environment Variable | Description |
|
|
186
|
+
|-----|------|----------|---------------------|-------------|
|
|
187
|
+
| `controlRoomRoot` | string | - | `CHROXY_CONTROL_ROOM_ROOT` | Filesystem root the Host Status survey scans for auto-discovered git repos (#5172). The discovered set is unioned with explicit [`repos`](#core-server) entries. Defaults to `~/Projects`. |
|
|
188
|
+
| `controlRoomRunnerRoot` | string | - | `CHROXY_RUNNER_ROOT` | Filesystem root the self-hosted GitHub Actions runner survey scans for runner installs — directories containing a `.runner` config (#5253). Defaults to `~/github-runners`. |
|
|
189
|
+
| `controlRoomRunnerIncludeGithub` | boolean | - | `CHROXY_RUNNER_INCLUDE_GITHUB` | Whether the runner survey enriches each runner with GitHub's view (online / busy / labels) via `gh api` (#5260). Default `true`. Set `false` for a faster local-only survey, or on hosts where `gh` isn't authenticated. |
|
|
190
|
+
| `controlRoomContainersIncludeStats` | boolean | - | `CHROXY_CONTAINERS_INCLUDE_STATS` | Whether the containers survey runs the `docker stats` enrichment (#6133). Default `true`. Set `false` for an inventory-only survey on a slow or socketless Docker. |
|
|
191
|
+
| `controlRoomRepoMemoryBin` | string | - | `CHROXY_REPO_MEMORY_BIN` | Explicit path to the `repo-memory` binary the Integrations survey shells out to (#5499). When unset the survey probes `PATH` with `which repo-memory` once per snapshot — set this on hosts where the daemon runs under a GUI/launchd `PATH` that misses npm globals. |
|
|
192
|
+
|
|
193
|
+
### Notifications, billing, and opt-in features
|
|
194
|
+
|
|
195
|
+
| Key | Type | CLI Flag | Environment Variable | Description |
|
|
196
|
+
|-----|------|----------|---------------------|-------------|
|
|
197
|
+
| `notifications` | object | - | *(unmapped — see [note](#environment-variable-names))* | Notification-sink settings. Today the only sub-block is `notifications.discord` — see [Discord notifications](#discord-notifications-notificationsdiscord). The webhook URL is a **secret** and deliberately *not* a config key. |
|
|
198
|
+
| `billing` | object | - | *(unmapped — see [note](#environment-variable-names))* | Monthly programmatic-credit budget meter (#5665). `creditTier` (`pro` \| `max5x` \| `max20x`), `monthlyCreditBudgetUsd` (a raw USD cap that wins over the tier preset), `budgetWarningPercent` (1–100, default `80`), plus the #5828 canary knobs `egressCheck` (boolean, default off — an outbound public-IP lookup that warns when a subscription-billed provider runs from a cloud host) and `datacenterPrefixes` (extra IPv4 prefixes merged into the built-in datacenter classifier). See [Nested config blocks](#nested-config-blocks-at-a-glance). |
|
|
199
|
+
| `features` | object | - | `CHROXY_ENABLE_IDE`, `CHROXY_ENABLE_ORCHESTRATION`, `CHROXY_ENABLE_SCHEDULER`, `CHROXY_SEMANTIC_TITLES` | Opt-in feature flags, all **off by default** and all fail-closed — only a literal `true` in config (or a literal `"1"` in the env) enables one. `ide` (IDE navigation surface, epic #6469), `orchestration` (delegation harness, epic #6691), `scheduler` (headless execution of scheduled tasks, #6865), and `semanticTitles` (model-generated session titles, #6764 — `CHROXY_SEMANTIC_TITLES=0` also force-*disables*). Full inventory in [Opt-in features](#opt-in-features-features); the title flag has its own section under [Semantic session titles](#semantic-session-titles-featuressemantictitles). Each env var is read directly by its feature gate, so it overrides config regardless of the merge layer. |
|
|
200
|
+
| `orchestration` | object | - | `CHROXY_ORCHESTRATION` | Tuning for the orchestration engine, which only runs when `features.orchestration` is on. `maxParallelWorkers` (default `2`), `reserveSessions` (`1`), `maxCommitteeIterations` (`4`), `maxParseRetries` (`2`), `turnTimeoutMs` (`1800000` / 30 min), `diff: { maxBytes: 65536, maxFileBytes: 8192 }`, `bash: { implementAllowlist: [] }`, and `roles` (per-role provider/model overrides). Declared in the schema so a configured block doesn't trip the misleading "unknown key" warning. See [`docs/design/orchestration/`](../../docs/design/orchestration/README.md). |
|
|
201
|
+
|
|
202
|
+
### Env-only settings
|
|
203
|
+
|
|
204
|
+
| Key | Type | CLI Flag | Environment Variable | Description |
|
|
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. |
|
|
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. |
|
|
209
|
+
|
|
210
|
+
### Environment variable names
|
|
211
|
+
|
|
212
|
+
Two different mechanisms put an environment variable in the tables above, and
|
|
213
|
+
they are worth telling apart.
|
|
214
|
+
|
|
215
|
+
**1. Merge-layer overrides.** `mergeConfig` looks every schema key up in the
|
|
216
|
+
environment and, if present, that value wins over the config file. The name comes
|
|
217
|
+
from `envKeyForConfig()` in
|
|
218
|
+
[`packages/server/src/config.js`](src/config.js) — most keys have an **explicit**
|
|
219
|
+
entry there (`port` → `PORT`, `controlRoomRunnerRoot` → `CHROXY_RUNNER_ROOT`, …).
|
|
220
|
+
|
|
221
|
+
**2. Direct reads.** Some settings are read straight out of `process.env` by the
|
|
222
|
+
helper that consumes them, bypassing the merge layer entirely:
|
|
223
|
+
`CHROXY_ENABLE_IDE` / `CHROXY_ENABLE_ORCHESTRATION` / `CHROXY_ENABLE_SCHEDULER` /
|
|
224
|
+
`CHROXY_SEMANTIC_TITLES` (the four [`features` gates](#opt-in-features-features)),
|
|
225
|
+
`CHROXY_SEMANTIC_TITLES_MODEL` /
|
|
226
|
+
`CHROXY_SEMANTIC_TITLES_TIMEOUT_MS` (which override *specific fields* of
|
|
227
|
+
`summarize` on the title path only — they are not a general override for the
|
|
228
|
+
`summarize` object), and `CHROXY_BINARY_PROVENANCE` /
|
|
229
|
+
`CHROXY_BINARY_SIGNATURE_GATE` (`binaryProvenance`).
|
|
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
|
+
|
|
236
|
+
**The naive fallback.** 16 schema keys have no explicit `envKeyForConfig` entry,
|
|
237
|
+
so their *merge-layer* lookup falls back to a bare `key.toUpperCase()` — which
|
|
238
|
+
drops the `CHROXY_` prefix and all word separators: `features` → `FEATURES`,
|
|
239
|
+
`billing` → `BILLING`, `workspaceRoots` → `WORKSPACEROOTS`, `userShell` →
|
|
240
|
+
`USERSHELL`, `trustMismatchMode` → `TRUSTMISMATCHMODE`, `summarize` →
|
|
241
|
+
`SUMMARIZE`, `binaryProvenance` → `BINARYPROVENANCE`, and so on. The tables mark
|
|
242
|
+
these *(unmapped)* wherever the key has no direct-read env var to list instead;
|
|
243
|
+
`summarize`, `features`, and `binaryProvenance` are unmapped at the merge layer
|
|
244
|
+
too, even though their rows list the direct reads above.
|
|
245
|
+
|
|
246
|
+
Those fallback names are **not a supported interface**:
|
|
247
|
+
|
|
248
|
+
- They are generic enough that an unrelated variable already in your environment
|
|
249
|
+
could be picked up as chroxy config (this is exactly why `orchestration` was
|
|
250
|
+
given an explicit `CHROXY_ORCHESTRATION` mapping in #6691).
|
|
251
|
+
- Object-typed keys would have to be supplied as a JSON string.
|
|
252
|
+
|
|
253
|
+
Set these keys in `~/.chroxy/config.json` instead. If you need an env override
|
|
254
|
+
for one of them, add an explicit mapping to `envKeyForConfig()` rather than
|
|
255
|
+
relying on the fallback.
|
|
256
|
+
|
|
257
|
+
### Nested config blocks at a glance
|
|
258
|
+
|
|
259
|
+
Several keys are object blocks whose sub-keys are validated at startup — a typo
|
|
260
|
+
inside one produces a non-fatal `unknown key` warning naming the supported set,
|
|
261
|
+
rather than being silently dropped.
|
|
262
|
+
|
|
263
|
+
| Block | Recognised sub-keys |
|
|
264
|
+
|-------|---------------------|
|
|
265
|
+
| `billing` | `creditTier`, `monthlyCreditBudgetUsd`, `budgetWarningPercent`, `egressCheck`, `datacenterPrefixes` |
|
|
266
|
+
| `worktreeGc` | `autoReap`, `reapIntervalMs`, `maxLockAgeMs` |
|
|
267
|
+
| `orphanReap` | `enabled`, `sweepIntervalMs`, `minAgeMs` |
|
|
268
|
+
| `sessionArchive` | `enabled`, `maxEntries`, `maxAgeDays`, `maxMegabytes` |
|
|
269
|
+
| `sessionCi` | `watch`, `wakeAgent`, `intervalMs`, `discoveryIntervalMs`, `maxSurveysPerTick` |
|
|
270
|
+
| `userShell` | `enabled`, `requireApproval` |
|
|
271
|
+
| `environments.k8s` | `namespace`, `inCluster`, `kubeconfigPath`, `sidecarImage`, `imagePullPolicy`, `connectMode`, `namespaceQuota`, `namespaceLimitRange`, `workspace` |
|
|
272
|
+
| `environments.rancher` | `rancherUrl`, `clusterId`, `token`, `tokenEnv`, `tokenFile`, `caData`, `skipTLSVerify`, `defaultProjectId` |
|
|
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` |
|
|
275
|
+
|
|
276
|
+
`summarize`, `features`, and `orchestration` have no unknown-key check today, so
|
|
277
|
+
a typo in one of those is silently ignored rather than warned about.
|
|
278
|
+
|
|
279
|
+
### Unrestricted provider models (`providers.allowAnyModel`)
|
|
280
|
+
|
|
281
|
+
The static-allowlist subprocess providers (currently `gemini` and `deepseek`)
|
|
282
|
+
hard-reject a model id that is not in their built-in list, even when the upstream
|
|
283
|
+
API already serves it — which otherwise forces a chroxy release just to add one.
|
|
284
|
+
`providers.allowAnyModel` is an array of provider ids that opt out of that check
|
|
285
|
+
(#6378):
|
|
286
|
+
|
|
287
|
+
```json
|
|
288
|
+
{
|
|
289
|
+
"providers": {
|
|
290
|
+
"allowAnyModel": ["gemini"]
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
```
|
|
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
|
+
|
|
313
|
+
An opted-in provider passes the model id through verbatim and lets the upstream
|
|
314
|
+
API be the validator. Default is **off** for every provider, so the
|
|
315
|
+
misconfiguration-catching strictness is preserved unless you explicitly opt in.
|
|
316
|
+
A missing or non-array value is treated as an empty set; non-string entries are
|
|
317
|
+
dropped.
|
|
318
|
+
|
|
319
|
+
Note that this lives inside the **object** form of the `providers` key, which is
|
|
320
|
+
the same block that carries `anthropicCompatible` — it does not apply to the
|
|
321
|
+
legacy array form.
|
|
40
322
|
|
|
41
323
|
### Prompt evaluator skip heuristic
|
|
42
324
|
|
|
@@ -58,7 +340,7 @@ phrase list. The pattern is OR-ed with the default; setting it cannot
|
|
|
58
340
|
the source fails to compile (unbalanced brackets, etc.) the server logs a
|
|
59
341
|
warning and falls back to the default pattern only.
|
|
60
342
|
|
|
61
|
-
This config is consumed by the auto-evaluator hook (see `
|
|
343
|
+
This config is consumed by the auto-evaluator hook (see `shouldSkipEvaluatorAsync`
|
|
62
344
|
in `packages/server/src/prompt-evaluator.js`); the on-demand "Evaluate"
|
|
63
345
|
button in the dashboard always evaluates, regardless of this setting.
|
|
64
346
|
|
|
@@ -142,6 +424,45 @@ directly. Format:
|
|
|
142
424
|
A corrupted or missing trust file is treated as empty (fail-open) so a single
|
|
143
425
|
bad write can't lock every skill out of every session.
|
|
144
426
|
|
|
427
|
+
### Binary provenance verification
|
|
428
|
+
|
|
429
|
+
`binaryProvenance` opts the daemon into pre-spawn provenance verification of the
|
|
430
|
+
external binaries it executes as providers (`claude`, `codex`, `gemini`) and of
|
|
431
|
+
`cloudflared`. This extends the always-on P1 integrity/quarantine check (#6708)
|
|
432
|
+
with two **opt-in, OFF-by-default** gates — see
|
|
433
|
+
[`docs/security/spawned-binary-provenance.md`](../../docs/security/spawned-binary-provenance.md).
|
|
434
|
+
|
|
435
|
+
```jsonc
|
|
436
|
+
{
|
|
437
|
+
"binaryProvenance": {
|
|
438
|
+
"mode": "off", // "off" (default) | "warn" | "block"
|
|
439
|
+
"signatureGate": false // macOS spctl notarization gate
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
- **`mode`** — a cross-platform SHA-256 **pin ledger** (`~/.chroxy/binary-trust.json`,
|
|
445
|
+
same fail-open/atomic-0600 sidecar as the skill ledger). Each binary's hash is
|
|
446
|
+
pinned on first sight (trust-on-first-use); a later change to that hash re-gates
|
|
447
|
+
the binary. `warn` logs the change and still spawns; `block` **refuses the
|
|
448
|
+
spawn** until the operator re-approves. Catches an in-place binary swap
|
|
449
|
+
regardless of signature or quarantine state. `off` (default) skips the ledger
|
|
450
|
+
entirely. Env override: `CHROXY_BINARY_PROVENANCE` = `off`/`warn`/`block`.
|
|
451
|
+
- **`signatureGate`** — when `true`, a binary that fails `spctl --assess`
|
|
452
|
+
(Gatekeeper / notarization) is hard-blocked. For operators who run only
|
|
453
|
+
notarized provider builds; chroxy's bundled providers are ad-hoc-signed and
|
|
454
|
+
would be rejected, so it can only ever be opt-in. **macOS-only** — a documented
|
|
455
|
+
no-op on Linux/Windows (the pin ledger still applies). Env override:
|
|
456
|
+
`CHROXY_BINARY_SIGNATURE_GATE` = `1`/`0`.
|
|
457
|
+
|
|
458
|
+
Both fail-safe: when a gate is on, a failure blocks (`block` / signature) or is
|
|
459
|
+
loudly surfaced (`warn`) — an unverified binary is never silently spawned. A
|
|
460
|
+
`block`-mode failure surfaces as a `session_error`
|
|
461
|
+
(`code: PROVIDER_BINARY_PROVENANCE`) for providers, or aborts the tunnel start
|
|
462
|
+
(`code: TUNNEL_BINARY_PROVENANCE`) for `cloudflared`. To re-approve a
|
|
463
|
+
legitimately-updated binary, remove its entry from `~/.chroxy/binary-trust.json`
|
|
464
|
+
(or delete the file — it fails open and re-pins on next spawn).
|
|
465
|
+
|
|
145
466
|
### Skip permissions (TUI provider)
|
|
146
467
|
|
|
147
468
|
`dangerouslySkipPermissions` is a **TUI-only** opt-out from chroxy's permission
|
|
@@ -230,6 +551,16 @@ from the SDK / CLI for the configured duration.
|
|
|
230
551
|
| Soft | `resultTimeoutMs` | `CHROXY_RESULT_TIMEOUT_MS` | `1800000` (30 min) | Emits `inactivity_warning` event + push notification. Session stays alive. Clients render a "check in" chip in the activity indicator. |
|
|
231
552
|
| Hard | `hardTimeoutMs` | `CHROXY_HARD_TIMEOUT_MS` | `7200000` (2 h) | Emits `permission_expired` for every outstanding permission request, force-clears busy state, aborts any in-flight SDK query, and emits a generic `error` event (`"Response timed out after <duration> of inactivity"`). Session must be re-driven by the user. |
|
|
232
553
|
|
|
554
|
+
**Whole milliseconds only (#7083).** Every millisecond option — `resultTimeoutMs`,
|
|
555
|
+
`hardTimeoutMs`, `streamStallTimeoutMs`, `backgroundShellHardQuiesceMs`,
|
|
556
|
+
`mcpToolCallTimeoutMs`, `terminalDownGraceMs`, and each entry of
|
|
557
|
+
`providerStreamStallTimeoutMs` — is truncated to an integer when the config is merged,
|
|
558
|
+
from the config file and the env var alike. A fractional value logs a warning naming the
|
|
559
|
+
key and the value it was changed to. They must be whole ms because they are sent on the
|
|
560
|
+
wire, where the protocol schemas require an integer. Note this is truncation toward zero,
|
|
561
|
+
so `30000.9` becomes `30000` — never rounded up into a range it did not qualify for. USD
|
|
562
|
+
options (`costBudget`, `billing.*`, provider `pricing.*`) are deliberately untouched.
|
|
563
|
+
|
|
233
564
|
Both fields share the same range (`30000`–`86400000`, 30 s – 24 h) and the
|
|
234
565
|
same WS schema cap (#3768). Values outside the range emit warn-only log
|
|
235
566
|
lines during validation; the runtime applies whatever was set. The
|
|
@@ -262,16 +593,104 @@ The `provider` key picks which AI CLI backs a session by default:
|
|
|
262
593
|
|
|
263
594
|
| Value | Backing binary / SDK | Required env |
|
|
264
595
|
|-------|----------------------|--------------|
|
|
265
|
-
| `claude-
|
|
266
|
-
| `claude-
|
|
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 |
|
|
267
598
|
| `claude-cli` | `claude -p` (Claude Code CLI) | Claude Code login (CLI intentionally strips `ANTHROPIC_API_KEY` from its environment) |
|
|
268
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 |
|
|
269
|
-
| `gemini` | `gemini
|
|
600
|
+
| `gemini` | `gemini --prompt=<text>` CLI | `GEMINI_API_KEY` |
|
|
270
601
|
| `codex` | `codex exec` CLI | `OPENAI_API_KEY` |
|
|
271
602
|
| `docker-sdk` / `docker-cli` | Claude SDK/CLI inside a Docker container | Requires `environments.enabled=true` + Docker |
|
|
272
603
|
|
|
273
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.
|
|
274
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
|
+
|
|
275
694
|
### `claude-channel` (research preview)
|
|
276
695
|
|
|
277
696
|
`claude-channel` drives Claude through Anthropic's first-party **channels MCP
|
|
@@ -492,6 +911,57 @@ swallowed) and cached per process, so it adds one read (plus a create if the
|
|
|
492
911
|
object is missing) per configured object the first time a tenant namespace is
|
|
493
912
|
used, and nothing on subsequent calls for that namespace.
|
|
494
913
|
|
|
914
|
+
### Semantic session titles (`features.semanticTitles`)
|
|
915
|
+
|
|
916
|
+
By default a session's sidebar label is a raw truncation of the first user
|
|
917
|
+
message. With `features.semanticTitles` on, that first turn also fires a cheap
|
|
918
|
+
one-shot model call that summarises the message into a short title (#6764).
|
|
919
|
+
|
|
920
|
+
```json
|
|
921
|
+
{
|
|
922
|
+
"features": {
|
|
923
|
+
"semanticTitles": true
|
|
924
|
+
},
|
|
925
|
+
"summarize": {
|
|
926
|
+
"model": "haiku",
|
|
927
|
+
"titleTimeoutMs": 15000
|
|
928
|
+
}
|
|
929
|
+
}
|
|
930
|
+
```
|
|
931
|
+
|
|
932
|
+
**Enabling.** `features.semanticTitles: true` in config, or
|
|
933
|
+
`CHROXY_SEMANTIC_TITLES=1`. The env var also force-*disables* when set to `0`,
|
|
934
|
+
which is handy for tests and A/B runs without editing config. Like the other
|
|
935
|
+
`features` flags this is fail-closed — only a literal `true` (or the literal env
|
|
936
|
+
string `"1"`) turns it on.
|
|
937
|
+
|
|
938
|
+
**Which model.** Resolution order:
|
|
939
|
+
|
|
940
|
+
1. `CHROXY_SEMANTIC_TITLES_MODEL`
|
|
941
|
+
2. `summarize.model` — the same cheap-model override used by the sidebar
|
|
942
|
+
"Summarize & start new session" action, deliberately reused so an operator who
|
|
943
|
+
already tuned the summarizer gets the same model for titles
|
|
944
|
+
3. `haiku` (the built-in default)
|
|
945
|
+
|
|
946
|
+
The default stays a cheap Haiku alias so titling never burns a premium model.
|
|
947
|
+
|
|
948
|
+
**Timeout.** Resolution order:
|
|
949
|
+
|
|
950
|
+
1. `CHROXY_SEMANTIC_TITLES_TIMEOUT_MS`
|
|
951
|
+
2. `summarize.titleTimeoutMs`
|
|
952
|
+
3. `15000` (15 s)
|
|
953
|
+
|
|
954
|
+
Invalid or non-positive values in either source fall back to the default. The
|
|
955
|
+
timeout matters because the title call is fire-and-forget: without one, a stalled
|
|
956
|
+
provider connection leaves the promise pending forever, pinning the
|
|
957
|
+
`SessionManager` and the first message (an unbounded per-session leak) and never
|
|
958
|
+
tearing down the one-shot subprocess.
|
|
959
|
+
|
|
960
|
+
**Failure behaviour is always fail-open.** When the flag is off, the call fails,
|
|
961
|
+
the timeout fires, or no model access is available, the session silently keeps
|
|
962
|
+
the truncation-based label. A title is a cosmetic nicety — it never blocks or
|
|
963
|
+
fails a turn.
|
|
964
|
+
|
|
495
965
|
### Discord notifications (`notifications.discord`)
|
|
496
966
|
|
|
497
967
|
The Discord webhook sink (#5413 Phase 2) maintains one status-embed message
|
|
@@ -519,7 +989,8 @@ The non-secret knobs live under `notifications.discord` in `config.json`:
|
|
|
519
989
|
"updateThrottleMs": 15000,
|
|
520
990
|
"heartbeatIntervalMs": 300000,
|
|
521
991
|
"pruneAfterMs": 86400000,
|
|
522
|
-
"billingAlerts": true
|
|
992
|
+
"billingAlerts": true,
|
|
993
|
+
"ciAlerts": true
|
|
523
994
|
}
|
|
524
995
|
}
|
|
525
996
|
}
|
|
@@ -536,12 +1007,124 @@ The non-secret knobs live under `notifications.discord` in `config.json`:
|
|
|
536
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`) |
|
|
537
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 |
|
|
538
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` |
|
|
539
1015
|
|
|
540
1016
|
Status-message state (message ids, current state per project) persists in
|
|
541
1017
|
`~/.chroxy/discord-webhook-state.json`; the billing-alert message tracks its own
|
|
542
1018
|
id in `~/.chroxy/discord-billing-state.json`. Full setup walkthrough:
|
|
543
1019
|
[docs/guides/discord-notifications.md](../../docs/guides/discord-notifications.md).
|
|
544
1020
|
|
|
1021
|
+
### Opt-in features (`features`)
|
|
1022
|
+
|
|
1023
|
+
Some surfaces are **off by default** and activate only when the operator opts in.
|
|
1024
|
+
Each is gated by a strict-boolean config key under `features`, or by an env
|
|
1025
|
+
override that must be exactly `1`:
|
|
1026
|
+
|
|
1027
|
+
```json
|
|
1028
|
+
{
|
|
1029
|
+
"features": {
|
|
1030
|
+
"scheduler": false
|
|
1031
|
+
}
|
|
1032
|
+
}
|
|
1033
|
+
```
|
|
1034
|
+
|
|
1035
|
+
| Key | Env override | Default | What it enables |
|
|
1036
|
+
|-----|--------------|---------|-----------------|
|
|
1037
|
+
| `features.scheduler` | `CHROXY_ENABLE_SCHEDULER=1` | `false` | Headless execution of scheduled tasks (#6865) |
|
|
1038
|
+
| `features.ide` | `CHROXY_ENABLE_IDE=1` | `false` | The IDE navigation surface (epic #6469) |
|
|
1039
|
+
| `features.orchestration` | `CHROXY_ENABLE_ORCHESTRATION=1` | `false` | The orchestration/delegation harness (epic #6691) |
|
|
1040
|
+
| `features.semanticTitles` | `CHROXY_SEMANTIC_TITLES=1` | `false` | Model-generated session titles (#6764) — see [Semantic session titles](#semantic-session-titles-featuressemantictitles) |
|
|
1041
|
+
|
|
1042
|
+
All four are **fail-closed**: anything other than a literal `true` in config (or
|
|
1043
|
+
a literal `"1"` in the env) leaves the feature off, so `"yes"`, `1`, or `"true"`
|
|
1044
|
+
in the config file do *not* enable it. `CHROXY_SEMANTIC_TITLES` is the one env
|
|
1045
|
+
override that also force-*disables* when set to `0`.
|
|
1046
|
+
|
|
1047
|
+
#### `features.scheduler` — headless scheduled execution
|
|
1048
|
+
|
|
1049
|
+
Scheduled tasks (`~/.chroxy/scheduled-tasks.json`) can be created, listed, and
|
|
1050
|
+
edited at any time, but they **never fire** unless this flag is on. With the flag
|
|
1051
|
+
off the daemon arms no scheduler timers and starts no sessions — behaviour is
|
|
1052
|
+
identical to a daemon without the feature.
|
|
1053
|
+
|
|
1054
|
+
When on, at each task's due time the daemon spins up (or resumes) that task's
|
|
1055
|
+
session and runs its prompt with **no client connected**.
|
|
1056
|
+
|
|
1057
|
+
##### Supported providers — hook-routed providers are refused
|
|
1058
|
+
|
|
1059
|
+
> **A scheduled task only fires on a provider that answers permission prompts
|
|
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
|
|
1063
|
+
> run is recorded with status `refused` naming the provider.
|
|
1064
|
+
|
|
1065
|
+
This is deliberate, not an oversight. The scheduler's whole safety story is that a
|
|
1066
|
+
permission prompt raised by an unattended turn gets **denied** and the run fails
|
|
1067
|
+
visibly. That requires observing the prompt and answering it programmatically,
|
|
1068
|
+
which only providers with in-process permissions expose. Hook-routed providers
|
|
1069
|
+
instead go out through `hooks/permission-hook.sh` → `POST /permission`, which the
|
|
1070
|
+
daemon cannot answer with no client attached — such a run would stall on every
|
|
1071
|
+
gated tool call until the 300-second auto-deny and then finish looking successful
|
|
1072
|
+
with nothing actually done. Refusing is the honest outcome.
|
|
1073
|
+
|
|
1074
|
+
**A task with no explicit `target.provider` therefore does not fire**, because it
|
|
1075
|
+
resolves to the daemon default. Set `target.provider` to one of the supported ids.
|
|
1076
|
+
Widening support to hook-routed providers needs a programmatic
|
|
1077
|
+
permission-answering surface for them — tracked in
|
|
1078
|
+
[#7003](https://github.com/blamechris/chroxy/issues/7003).
|
|
1079
|
+
|
|
1080
|
+
##### The permission floor
|
|
1081
|
+
|
|
1082
|
+
Because nobody is watching the turn, a run that does fire runs under a hard floor:
|
|
1083
|
+
|
|
1084
|
+
- The run is pinned to the `approve` permission mode. A task whose stored
|
|
1085
|
+
`target.permissionMode` is `auto` or `acceptEdits` is **clamped down** to
|
|
1086
|
+
`approve` — a scheduled task can never grant itself auto-approval. (`plan` is
|
|
1087
|
+
allowed: it is stricter than `approve`.)
|
|
1088
|
+
- **The clamp is re-asserted before every fire, not just at session creation.**
|
|
1089
|
+
A task's session is deliberately kept alive and reused across runs, and an
|
|
1090
|
+
operator inspecting it can change its permission mode by hand — so before each
|
|
1091
|
+
fire the daemon forces the clamped mode back on and verifies it by reading it
|
|
1092
|
+
back. If it cannot be verified, **the fire is skipped** and recorded `refused`.
|
|
1093
|
+
A manual switch to Auto therefore cannot leak into the next unattended run.
|
|
1094
|
+
- The run is created with an explicit `skipPermissions: false`, so it does **not**
|
|
1095
|
+
inherit a server-wide [`dangerouslySkipPermissions`](#skip-permissions-tui-provider).
|
|
1096
|
+
- The task's `target.cwd` is checked against the **same working-directory
|
|
1097
|
+
allowlist the dashboard enforces** — the credential-directory deny-list
|
|
1098
|
+
(`~/.ssh`, `~/.aws`, `~/.config`, `~/.chroxy`, …), your `workspaceRoots`
|
|
1099
|
+
allowlist if configured, and the `$HOME` fallback otherwise. `~/.chroxy/scheduled-tasks.json`
|
|
1100
|
+
is an editable file, so a hand-written `target.cwd` gets no more trust than one
|
|
1101
|
+
typed into the UI: a disallowed directory is recorded `refused` and does not fire.
|
|
1102
|
+
- If the turn hits a permission prompt, there is no human to answer it: the prompt
|
|
1103
|
+
is **denied**, the turn is aborted, and the run is recorded as a failed run with
|
|
1104
|
+
the reason. A scheduled task that needs a permission fails visibly rather than
|
|
1105
|
+
escalating silently. A run that raised any prompt is **never** recorded
|
|
1106
|
+
`success`, even when the agent went on to finish its turn without the tool.
|
|
1107
|
+
- To let a scheduled task actually perform a gated operation, author an explicit
|
|
1108
|
+
**permission rule** for it. Rules are matched before a prompt is raised, so an
|
|
1109
|
+
allow-rule is the one auditable, human-authored way to widen what a scheduled
|
|
1110
|
+
run may do — and the protected-path / secret-read floor still cannot be
|
|
1111
|
+
bypassed by one.
|
|
1112
|
+
|
|
1113
|
+
Each run records a last-run result plus its session id into the registry:
|
|
1114
|
+
|
|
1115
|
+
| status | meaning |
|
|
1116
|
+
|--------|---------|
|
|
1117
|
+
| `success` | the turn completed and no permission prompt was raised |
|
|
1118
|
+
| `error` | the run happened and failed — including a run whose tool calls were denied |
|
|
1119
|
+
| `timeout` | the run exceeded the per-run timeout and was abandoned |
|
|
1120
|
+
| `skipped` | the slot passed unused (the daemon was down past the grace window) |
|
|
1121
|
+
| `refused` | **nothing ran** — unsupported provider, disallowed cwd, or an unverifiable permission mode. A misconfiguration to fix, not a transient failure |
|
|
1122
|
+
|
|
1123
|
+
Runs are serialized (one at a time by default) so a burst of simultaneously-due
|
|
1124
|
+
tasks cannot spawn a herd of sessions, a task is never re-fired while its previous
|
|
1125
|
+
run is still in flight, and a task whose due time passed while the daemon was down
|
|
1126
|
+
is skipped rather than fired late if it is more than an hour stale.
|
|
1127
|
+
|
|
545
1128
|
## Examples
|
|
546
1129
|
|
|
547
1130
|
### Using Config File Only
|