Review follow-up (tianyicui): plan mode and the sandbox are orthogonal
AXES, not just orthogonal state — entering plan must not change what the
sandbox enforces, matching Codex's separation of Plan/Default
collaboration presets from sandbox and approval settings.
ModeDefinition.access, the bash/resolve-mode clamp, and both cap-derived
guards are removed; a ModeDefinition is exactly { section }, and a mode
now carries only its guidance section plus the exit_plan_mode review.
The bash seam's resolveMode + waterfall go with their only listener:
dsh-bash and dsh-tool-bash revert to master byte-for-byte, and the
dsh-mode → dsh-bash dependency edge is gone. A deployment that wants
kernel-enforced read-only planning pairs the mode picker with the
independent sandbox-mode option, in either order.
The RFC archives this as the second removed enforcement shape (after
the interim allowlist) with the same restart trigger — effects
self-declaration; the orthogonality FAQ now answers with the two-axis
rule. The plan example demonstrates the axes side by side, and the
re-recorded fixtures pin the guidance-only section.
2.2 KiB
ctx.modes
ModesService — provided by @deepseek-ai/dsh-mode.
ctx.modes: the session-mode service. Owns the mode/set vocabulary, the pending-intent flush, the boundary narration, the mode:policy section, and the exit tool's visibility rule. UIs read mode flips off session/event; there is no live mirror.
ctx.modes.resolved
readonly resolved: ResolvedModes
Validated definitions (built-in plan merged unless overridden).
ctx.modes.list()
list(): string[]
The selectable mode vocabulary: DEFAULT_MODE first, then the configured definitions — the list a mode picker advertises.
Returns Mode names, default first.
ctx.modes.get(agent)
get(agent: Agent): { current: string; pending?: string }
The agent's mode state: the folded mode in force (a folded name the config no longer defines reads as DEFAULT_MODE) plus the pending user-selected intent awaiting its boundary flush, when one exists.
agent— The agent to read.
Returns The current (effective) mode and the pending intent, if any.
ctx.modes.set(agent, mode)
set(agent: Agent, mode: string): void
Select the agent's mode. Validates the name against list (loud on unknown; default is always a valid target), drops a no-op (target equals the pending intent, else the current fold), and otherwise records a pending intent flushed as a mode/set at the next turn boundary.
agent— The agent to switch.mode— The target mode name.