Skip to content

The agent that grows with you

docs(process): _owns_job says which surfaces actually own their background jobs

kshitijk4poor10b430de5ee6
diff --git a/tools/process_registry_ownership.py b/tools/process_registry_ownership.py
index f9e6969382b..40bc8df10cd 100644
--- a/tools/process_registry_ownership.py
+++ b/tools/process_registry_ownership.py
@@ -23,7 +23,11 @@ class ProcessOwnershipMixin:
def _owns_job(self, persist_on_release: bool) -> bool:
"""Not owned, on purpose: ``persist_on_release`` jobs, which must outlive the agent (#41225);
every job of a gateway, which re-adopts its jobs from the checkpoint after a crash (flagged by
- recover_from_checkpoint; a supervised gateway also before it gets there); every job of a
+ recover_from_checkpoint, which every gateway boot runs, checkpoint or not; a supervised gateway
+ also before it gets there). The classic CLI, the TUI, the Desktop, ACP, cron and messaging all
+ run their tools in a gateway, so their background jobs are not owned; a process that is not a
+ gateway (a standalone serve with no session authority, the slash worker, an embedder of
+ AIAgent) owns its jobs, and foreground commands are owned everywhere. Also not owned: every job of a
managed worker, a per-turn interpreter whose jobs the next turn's worker adopts with their
output log (worker_output_log); and Windows, where the layer-3 job object covers ownership."""
from agent.runtime_session_store import is_worker_process