You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds POST /session/:id/approval-mode — the first strict-gated session
mutation surface introduced in Wave 4 alongside PR 16 / PR 21. Remote
clients can switch a live session's approval mode (plan / default /
auto-edit / yolo) without touching the user's host CLI.
Routing:
- Route handler validates `mode` against the closed `APPROVAL_MODES`
enum and an optional `persist: boolean` flag (400 on either)
- Bridge `setSessionApprovalMode` forwards through the new
`qwen/control/session/approval_mode` ACP extMethod (introduced in a
new `SERVE_CONTROL_EXT_METHODS` namespace) so the change lands inside
the ACP child's per-session `Config`
- `persist: true` writes `tools.approvalMode` to workspace settings via
a new `BridgeOptions.persistApprovalMode` callback wired in
`runQwenServe`. Default is ephemeral so a remote caller does not
pollute the user's host settings unless asked
Trust gate translation:
- ACP child catches `TrustGateError` from `Config.setApprovalMode` and
re-raises as a JSON-RPC error with `data.errorKind: 'trust_gate'`
- Bridge detects the structured payload and re-instantiates the typed
`TrustGateError` (since the class name does not survive the wire)
- `sendBridgeError` translates to HTTP 403 with the closed PR-13
`errorKind: 'auth_env_error'` taxonomy
SDK additions:
- `DaemonClient.setSessionApprovalMode(sessionId, mode, opts?, clientId?)`
mirrors the route shape and forwards `X-Qwen-Client-Id`
- New `DaemonApprovalMode` literal union and `DAEMON_APPROVAL_MODES`
const tuple; `DaemonApprovalModeResult` for the route response
- New `approval_mode_changed` typed event on `DaemonControlEvent`,
reducer integration on `DaemonSessionViewState`
(`approvalMode` / `approvalModeChangedCount` / `lastApprovalModeChange`)
- Drift detector `approvalMode.test.ts` walks core's `ApprovalMode`
enum and fails CI if `APPROVAL_MODES` or `DAEMON_APPROVAL_MODES`
drift in either direction
New capability tag `session_approval_mode_control` (always-on, since v1).
🤖 Generated with [Qwen Code](https://github.com/QwenLM/qwen-code)
0 commit comments