pub struct PersistentShellTool { /* private fields */ }Expand description
A long-lived shell whose state (working directory, environment variables,
shell functions) persists across calls — unlike the one-shot BashTool.
Also supports write_stdin to feed raw input to the shell, for driving
interactive programs. This is the analog of Codex’s persistent exec session.
Known limitation (documented, not fixed — see UX-29.md “Known
limitations”): if a REPL turn is hard-cancelled (race_ctrl_c in
crates/cli/src/main.rs) while execute() below is mid-.await waiting
for the completion sentinel, only that .await is dropped — the child
held in ShellState is untouched (by design: it must survive to serve
the NEXT call in this REPL session) and keeps running the in-flight
command to completion on its own schedule. The cancelled command’s
eventual output (and sentinel line) still lands in the shared stdout
pipe, so the next shell call in the same session can either block
behind the stale command finishing or read a garbage prefix ahead of its
own sentinel. This is no worse than the pre-existing hard-kill behavior
this ticket replaced (which would have torn down the whole process), and
the on-disk session file itself is unaffected — only the persistent
shell’s own child-process state can go stale.
Trait Implementations§
Source§impl Default for PersistentShellTool
impl Default for PersistentShellTool
Source§impl Tool for PersistentShellTool
impl Tool for PersistentShellTool
Source§fn description(&self) -> &str
fn description(&self) -> &str
crate::Config.