Expand description
Shell commands that outran their grace period and finished in the background.
Every shell command starts in the foreground. One that has not exited by the time
lifecycle.shell_grace_secs elapses is demoted: the turn gets a handle and carries on, the
command keeps running on an OS thread of its own, and its output goes to a file rather than
into the conversation. When it finishes, the runtime enqueues a task on this capsule with
crate::origin::TaskOrigin::Completion carrying the exit code and that file’s path.
The handle is not addressable. Nothing takes a work id as an argument — no tool, no host import, no CLI subcommand — because a pollable handle invites a loop that burns turns waiting, which is the cost demotion exists to remove. A demoted command is learned about through its completion and no other way.
Constants§
- WORK_
ID_ PREFIX - Prefix on every work id. Distinct from
tsk_/ctx_/ses_so a reader oftrace.jsonlcan tell at a glance which id space a value belongs to.
Functions§
- new_
work_ id - A fresh work id, matching
^wrk_[0-9a-f]+$.