Conversation
session/create hardcoded `mode: "yolo"`, so every new session started unrestricted with no way to start it in `plan` or `build` instead. `ZCODE_ACP_MODE` now supplies the create-time mode. It is opt-in: unset still means `yolo`, and the mode dropdown switches modes per session as before. Values are the backend's own mode ids. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DLQ3W2owia4SJBvzxSqvVc
william0wang
left a comment
There was a problem hiding this comment.
Reviewed (typecheck pass; session-lazy tests 35/35; invalid modes are rejected by the backend with a clear error and resume never clobbers the stored session's mode — both verified).
One small blocking inconsistency: the create-time mode isn't reflected in the session/new response. buildModes() (src/config/options.ts:230-246) returns a hardcoded currentModeId: "yolo" for pending sessions (zcodeSid === null), so a client is told the session is in yolo while it was actually created in ZCODE_ACP_MODE — the stale value stands until the first materialized mode read. Please thread the create-time mode through the pending branch (e.g. seed server.lastMode at create, or pass the env mode as buildModes' pending default).
Review follow-up: buildModes hardcoded currentModeId "yolo" for pending sessions, so a client was told "yolo" while the session was actually created in ZCODE_ACP_MODE — the stale value stood until the first materialized mode read, and the mode configOption's currentValue had the same staleness. The create-time mode now lives in one helper, initialSessionMode(), used by the session/create call, buildModes' pending branch, and buildConfigOptions' pending branch. lastMode seeding at session/new follows automatically (it reads buildModes' output). The existing ZCODE_ACP_MODE test now also asserts the response's currentModeId and mode currentValue.
|
Thanks! Addressed in 37e8565 — the create-time mode now lives in a single helper ( The existing |
|
Verified the fix: typecheck clean, targeted suites green (41/41) — Same housekeeping as #188: #187's README table reformat leaves this branch conflicting on |
## Problem `session/create` hardcodes `mode: "yolo"`, so every new session starts unrestricted. There is no way to start a session in `plan` or `build` without switching after the fact. ## Change `ZCODE_ACP_MODE` supplies the create-time mode. Unset still means `yolo`, and the mode dropdown keeps switching modes per session. Values are the backend's own mode ids. The README documents the variable. ## Tests `tests/session-lazy.test.ts` asserts the default stays `yolo` and that the variable overrides it. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01DLQ3W2owia4SJBvzxSqvVc
🤖 I have created a release *beep* *boop* --- ## [0.39.0](v0.38.0...v0.39.0) (2026-09-16) ### Features * choose the initial session mode with ZCODE_ACP_MODE ([#189](#189)) ([a1aa2e0](a1aa2e0)) * honor ZCODE_HOME for the config and lazy-session store paths ([#187](#187)) ([0593488](0593488)) * pin the provider and model with ZCODE_PROVIDER and ZCODE_MODEL ([#188](#188)) ([6aa8999](6aa8999)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Problem
session/createhardcodesmode: "yolo", so every new session starts unrestricted. There is no way to start a session inplanorbuildwithout switching after the fact.Change
ZCODE_ACP_MODEsupplies the create-time mode. Unset still meansyolo, and the mode dropdown keeps switching modes per session. Values are the backend's own mode ids. The README documents the variable.Tests
tests/session-lazy.test.tsasserts the default staysyoloand that the variable overrides it.🤖 Generated with Claude Code
https://claude.ai/code/session_01DLQ3W2owia4SJBvzxSqvVc