Answer product-owner round 1: 0 🔴, 3 🟡 (0 misread); check a shell that holds a heavy slot, name the process's command, and judge each shell once

This commit is contained in:
2026-11-19 09:56:43 +01:00
parent ed241f3ab5
commit f3af8fda13
5 changed files with 75 additions and 42 deletions
+2 -2
View File
@@ -18,12 +18,12 @@ RECORD = "lingering-workers.md"
def stopped_shells(proc: Streaming, printed_result: bool, record: pathlib.Path, effects: Effects) -> None:
"""Stops the shells of a claude that is still alive CHECK_EVERY seconds after it printed its final result (printed_result), saying each stop on the terminal and in record. A claude whose latest line is not a result is working and keeps its shells, and so does one with a shell that wrote output within QUIET seconds or runs a busy tool, as `Shell.runs_busy_tool` says. A subagent's shells are children of the claude too, so they count like its own: a subagent that prints keeps them, and one inside a single quiet call loses it."""
"""Stops the shells of a claude that is still alive CHECK_EVERY seconds after it printed its final result (printed_result), saying each stop on the terminal and in record. A claude whose latest line is not a result is working and keeps its shells, and so does one with a shell that wrote output within QUIET seconds or runs a busy tool or holds a heavy slot, as `Shell.runs_busy_tool` and `Shell.holds_slot` say. A subagent's shells are children of the claude too, so they count like its own: a subagent that prints keeps them, and one inside a single quiet call loses it."""
if not printed_result:
return
now = effects.now()
shells = proc.shells()
if any(now - shell.written <= QUIET or shell.runs_busy_tool for shell in shells):
if any(now - shell.written <= QUIET or shell.runs_busy_tool or shell.holds_slot for shell in shells):
return
for shell in shells:
proc.stop(shell)