Expand description
Durable interactive-agent session records, so a coding-agent TUI piloted through winx (claude, codex, …) is not silently lost when the process that owned its PTY dies (host reboot, guardian kill, embedded-adapter restart).
Modeled on herdr’s agent_resume (https://github.com/herdrdev/herdr,
Apache-2.0): persist what was launched where, and rebuild a resume
command after the loss. winx keeps it deliberately simpler than herdr — it
records the launch command it executed itself instead of inspecting
process trees, and resumes by conversation-continuation flags (claude --continue, codex resume --last) instead of persisted session ids.
Lifecycle: every foreground Command action either overwrites the record
(the command launches a known agent) or clears it (it doesn’t) — the main
PTY runs one foreground program at a time, so the latest record is the
only one that can still matter. Records survive until superseded; a stale
record after a clean agent exit only makes the recovery hint say the agent
“was running”, which continuation-style resume commands tolerate.
Structs§
- Agent
Session Record - What was running in the foreground PTY when the record was written.
Functions§
- clear_
agent_ session - clear_
agent_ session_ at_ path - detect_
agent_ launch - Canonical agent id when
commandlaunches a known interactive coding agent in the foreground,Noneotherwise. - load_
agent_ session - load_
agent_ session_ from_ path - now_
unix_ ms - save_
agent_ session - save_
agent_ session_ to_ path