Optional abduco nesting so sessions survive the agent #19
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
The agent owns every pty master, which is what lets sessions outlive their
windows. The consequence is written down as a failure mode in
docs/spec/session-agent.md:The first mitigation is in place. This issue is the second one, which the plan
listed as optional and to be added "only if it bites".
What it would mean
abduco(ISC, ~1.5k lines) detaches a program from its controlling terminal:abduco -A name commandcreates or attaches to a session. Running a session'scommand under it means the child survives even the agent dying — at the cost of
another pty layer between Terminalko and the program.
Shape of the work:
actually runs;
crates/terminalko-agent/src/launch.rsis where it belongs: it already turns asession's configuration into an argument list as a pure function, with 24 tests,
and this is one more transformation — wrap the computed argv rather than special
casing each kind;
is restarted, sessions that were nested are not in its
HashMapany more.Something has to enumerate abduco's socket directory and re-adopt them, which
means a session identity that survives the agent — today the id is a GSettings
UUID, which does survive, so name the abduco session after it;
abducomust be a runtime dependency only when the setting is on: preflightalready refuses a session whose program is missing, and the message should say
which program and why.
Whether to do it
Only with evidence. The question to answer first: has the agent ever died on
you? It is a small single-purpose process with panics denied in the pty and IPC
paths, and nothing has reported a crash. Two pty layers per session is a real
cost — resize forwarding, signal propagation and an extra process each — for a
failure nobody has seen.
If issue #18 (socket activation) lands, a crashed agent is also restarted
automatically, which makes the recovery path here more valuable and the crash
itself less damaging. Consider that first.
Acceptance criteria
SIGKILLleaves the session'sprogram running, and a new agent re-adopts it and can attach a window to it with
its output.
Ctrl+Cbehave the same through the extra layer — the nested-ptyresize test (
a_resize_reaches_a_terminal_nested_in_another) is the model tofollow.
docs/spec/session-agent.mdexplains the setting and its cost.Notes
entry in
NOTICE; seeCONTRIBUTING.md.