Skip to content
Merged
38 changes: 19 additions & 19 deletions docs/developers/daemon/02-serve-runtime.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,25 +113,25 @@ Calling `createServeApp` directly returns only an `Application`; the embedder ow

## Configuration

| Source | Key | Effect |
| --------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| Env | `QWEN_SERVER_TOKEN` | Bearer token after trim. |
| Env | `QWEN_SERVE_NO_MCP_POOL=1` | Forces `mcpPoolActive=false`. |
| ACP child env | `QWEN_SERVE_MCP_CLIENT_BUDGET` / `QWEN_SERVE_MCP_BUDGET_MODE` | Generated from `--mcp-client-budget` / `--mcp-budget-mode` and forwarded through `childEnvOverrides`. |
| Env | `QWEN_SERVE_PROMPT_DEADLINE_MS` / `QWEN_SERVE_WRITER_IDLE_TIMEOUT_MS` | Default prompt / SSE idle timeouts. |
| Env | `QWEN_SERVE_RATE_LIMIT*` | Rate-limit switch, prompt / mutation / read caps, and window default. |
| Env | `QWEN_SERVE_DEBUG=1` | Verbose stderr logs. See [`19-observability.md`](./19-observability.md). |
| Flags | `--hostname`, `--port` | Listen binding. |
| Flags | `--token`, `--require-auth`, `--enable-session-shell` | Bearer token, loopback auth hardening, and explicit shell execution switch. |
| Flag | `--workspace` | Overrides `process.cwd()`; repeat to register additional isolated workspace runtimes. |
| Flags | `--max-sessions`, `--max-pending-prompts-per-session`, `--max-connections`, `--event-ring-size` | Bridge / Express caps. |
| Flags | `--mcp-client-budget=N`, `--mcp-budget-mode={off,warn,enforce}` | Forwarded to the ACP child. |
| Flags | `--allow-origin`, `--allow-private-auth-base-url` | Browser CORS allowlist and localhost/private auth provider installation switch. |
| Flags | `--prompt-deadline-ms`, `--writer-idle-timeout-ms`, `--channel-idle-timeout-ms` | Prompt, SSE writer, and ACP child idle lifecycle control. |
| Flags | `--session-reap-interval-ms`, `--session-idle-timeout-ms` | Disconnected-session reaping control. |
| Flags | `--rate-limit*` | Per-tier HTTP rate limit. |
| `settings.json` | `policy.permissionStrategy`, `policy.consensusQuorum` | `MultiClientPermissionMediator` policy and quorum. |
| `settings.json` | `context.fileName` | `getCurrentGeminiMdFilename` override for the bridge. |
| Source | Key | Effect |
| --------------- | ---------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| Env | `QWEN_SERVER_TOKEN` | Bearer token after trim. |
| Env | `QWEN_SERVE_NO_MCP_POOL=1` | Forces `mcpPoolActive=false`. |
| ACP child env | `QWEN_SERVE_MCP_CLIENT_BUDGET` / `QWEN_SERVE_MCP_BUDGET_MODE` | Generated from `--mcp-client-budget` / `--mcp-budget-mode` and forwarded through `childEnvOverrides`. |
| Env | `QWEN_SERVE_PROMPT_DEADLINE_MS` / `QWEN_SERVE_WRITER_IDLE_TIMEOUT_MS` | Default prompt / SSE idle timeouts. |
| Env | `QWEN_SERVE_RATE_LIMIT*` | Rate-limit switch, prompt / mutation / read caps, and window default. |
| Env | `QWEN_SERVE_DEBUG=1` | Verbose stderr logs. See [`19-observability.md`](./19-observability.md). |
| Flags | `--hostname`, `--port` | Listen binding. |
| Flags | `--token`, `--require-auth`, `--enable-session-shell` | Bearer token, loopback auth hardening, and explicit shell execution switch. |
| Flag | `--workspace` | Overrides `process.cwd()`; repeat to register additional isolated workspace runtimes. |
| Flags | `--max-sessions`, `--max-pending-prompts-per-session`, `--max-connections`, `--event-ring-size` | Bridge / Express caps. |
| Flags | `--mcp-client-budget=N`, `--mcp-budget-mode={off,warn,enforce}` | Forwarded to the ACP child. |
| Flags | `--allow-origin`, `--allow-private-auth-base-url` | Browser CORS allowlist and localhost/private auth provider installation switch. |
| Flags | `--prompt-deadline-ms`, `--writer-idle-timeout-ms`, `--channel-idle-timeout-ms`, `--initialize-timeout-ms` | Prompt, SSE writer, ACP child idle lifecycle, and ACP child request timeout control. |
| Flags | `--session-reap-interval-ms`, `--session-idle-timeout-ms` | Disconnected-session reaping control. |
| Flags | `--rate-limit*` | Per-tier HTTP rate limit. |
| `settings.json` | `policy.permissionStrategy`, `policy.consensusQuorum` | `MultiClientPermissionMediator` policy and quorum. |
| `settings.json` | `context.fileName` | `getCurrentGeminiMdFilename` override for the bridge. |

See [`17-configuration.md`](./17-configuration.md) for the merged reference.

Expand Down
2 changes: 2 additions & 0 deletions docs/developers/daemon/17-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ This page collects every setting that affects the `qwen serve` daemon and its ad
| `--prompt-deadline-ms <n>` | positive integer | unset | Server-side prompt wallclock limit in ms. Timeout aborts and returns an error. |
| `--writer-idle-timeout-ms <n>` | positive integer | unset | Per-SSE-connection idle timeout in ms. The daemon closes the SSE connection when no event is sent for this duration. |
| `--channel-idle-timeout-ms <n>` | non-negative integer | `0` | How long to keep the ACP child alive after the last session closes. `0` means reclaim immediately. |
| `--initialize-timeout-ms <n>` | positive integer | `10000` | ACP child request timeout, including the initialize handshake (ms). |
| `--session-reap-interval-ms <n>` | non-negative integer | `60000` | Session reaper scan interval; `0` disables it. |
| `--session-idle-timeout-ms <n>` | non-negative integer | `1800000` | Disconnected-session idle reaping time; `0` disables it. |
| `--rate-limit` / `--no-rate-limit` | boolean | env / off | Enables per-tier HTTP rate limiting for prompt, mutation, and read routes. |
Expand Down Expand Up @@ -101,6 +102,7 @@ The daemon constructs each workspace runtime from that workspace's merged settin
| `promptDeadlineMs` | Prompt wallclock limit. |
| `writerIdleTimeoutMs` | SSE writer idle timeout. |
| `channelIdleTimeoutMs` | How long to keep the ACP child warm after the last session closes. |
| `initializeTimeoutMs` | ACP child request timeout, including the initialize handshake. |
| `sessionReapIntervalMs` | Session reaper scan interval. |
| `sessionIdleTimeoutMs` | Disconnected-session idle reaping time. |
| `rateLimit*` | Per-tier HTTP rate limit switch, thresholds, and window. |
Expand Down
2 changes: 2 additions & 0 deletions docs/developers/daemon/20-quickstart-operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ The CLI is defined in **`packages/cli/src/commands/serve.ts`**:
| `--prompt-deadline-ms <n>` | number | none | - | Server-side prompt wallclock limit in ms; timeout aborts the prompt. |
| `--writer-idle-timeout-ms <n>` | number | none | - | Per-SSE-connection idle timeout in ms. |
| `--channel-idle-timeout-ms <n>` | number | `0` | - | Keeps the ACP child alive after the last session closes. `0` means reclaim immediately. |
| `--initialize-timeout-ms <n>` | number | `10000` | - | ACP child request timeout, including the initialize handshake (ms). |
| `--session-reap-interval-ms <n>` | number | `60000` | - | Session reaper scan interval. `0` disables it. |
| `--session-idle-timeout-ms <n>` | number | `1800000` | - | Disconnected-session idle timeout. `0` disables it. |
| `--rate-limit` / `--no-rate-limit` | boolean | env / off | - | Enables or disables per-tier HTTP rate limiting. |
Expand Down Expand Up @@ -156,6 +157,7 @@ Settings I/O failure, such as malformed JSON, falls back to defaults. `InvalidPo
| `--event-ring-size > 1_000_000` | Thrown during bridge construction |
| `--allow-origin '*'` without token | `Refusing to start with --allow-origin '*' but no bearer token configured` |
| `--prompt-deadline-ms` / `--writer-idle-timeout-ms` is not a positive integer | `Must be a positive integer` |
| `--initialize-timeout-ms` is not a positive integer or exceeds `2^31-1` | `Must be a positive integer` / `Exceeds maximum JS timer delay` |
| Unknown `policy.permissionStrategy` or non-positive `policy.consensusQuorum` | `InvalidPolicyConfigError` |

## 7. Curl verification checklist
Expand Down
Loading
Loading