Agent View: undocumented behavior — are run_in_background child processes killed when the supervisor reaps an idle session after ~1h?

Resolved 💬 3 comments Opened May 16, 2026 by cossio Closed Jun 16, 2026

Summary

The Agent View docs state that once a session finishes and sits unattached for ~1 hour, the supervisor stops its process to free resources, then restarts a fresh process on next attach/peek/reply. What happens to background child processes spawned via run_in_background during that reaping window is not documented.

Scenario

  1. A background session's agent launches a long-running task (e.g. a multi-hour simulation) via run_in_background: true.
  2. The agent's turn ends, so the session is "finished"/idle while the detached child keeps running.
  3. The session sits unattached for ~1 hour and the supervisor stops the parent Claude Code process.

Questions / gap

  • Does the supervisor kill the background child process when it stops the parent? (Normally a child would die with its parent.)
  • Does an active tracked background task prevent the ~1h reaping? The UI already shows Cannot open agents — N background task(s) running, implying background tasks are tracked.
  • If the child is killed, the harness's "re-invoke the agent when a background task completes" contract can never fire — the task and its completion callback are silently lost.

Requests

  1. Document the exact interaction between the ~1h supervisor reaping and in-flight run_in_background tasks.
  2. Ideally handle it: keep a session exempt from reaping while it has tracked background tasks still running, so long jobs and the completion callback survive.

Affected docs

Filed via Claude Code.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗