Cross-Turn Workdir Reset
Last updated
How each request supplies its own working directory instead of inheriting one from history.
The workdir is supplied per request, not carried over from history: the TUI passes its own working directory,
/v1/send resolves the work_dir field, and subagents inherit or resolve theirs. Since v1.2.0 it is written into the turn context on every run, not into the system prompt, so the cached system prefix survives a directory change; a directory mentioned in an earlier turn does not carry over through history.- Turn context — a
Work directory: ...line stating that this directory is authoritative for this turn, that earlier ones in history are ignored, and thatrun_commandalready starts there. Stateless/v1/chat/completionsruns keep the line in their own system prompt instead - TUI — the user sets the directory with
Shift+P(an absolute path, ~/..., or a path relative to the current one; it must exist), and every later request carries it. Removed in v1.3.0: the agent'scdthroughrun_commandand theworkdirframe that pushed the new directory to the TUI;run_commandnow rejectscdand points to absolute paths or['sh','-c','cd <dir> && <command>']for a single command
The per-message metadata header (timestamp + working directory wrapped around each user message) and its TUI stripper
stripUserMetaHeader were removed; the turn-context work directory line is the only workdir anchor.