Expand description
Files a background task’s pid in db_background_tasks from srv itself
(docs/specs/SPEC_BACKGROUND_TASK_STRUCTURED_FEED_AND_SWARM_OWNERSHIP_2026_09_27.md §5, first bullet;
docs/specs/SPEC_BACKGROUND_TASK_PID_CAPTURE_2026_08_20.md).
agentmux-bashwrap publishes a pid chunk when the command it runs starts. Only an open agent pane used to
read it, and relayed it to srv: with the pane closed or parked the row never got its pid, and the liveness sweep
(background_task_sweep) had nothing to check it by. The chunk is on the broker whether or not a pane is open, so
srv reads it there.
The pid usually beats its row: bashwrap publishes it at its own start, and the row is made when the CLI’s task
feed (in the stdout reader, which needs no pane) or the pane’s docknodestatus first sees the call run in the
background. A pid that finds no row waits in the process-wide pen (PendingBackgroundPids), and whoever makes the
row applies it (apply_stashed).
Functions§
- apply_
stashed - The row
tool_idnow exists: give it the pid that came before it, if one did. Blocking: a store write. - file_
pid - Record
pidon the rowtool_id, or keep it in the pen until that row exists. Tells the pane to re-read whenbrokeris given. Blocking: a store write. - install
- Start listening. Called once, with the app’s broker and store.