Repository navigation
Description
This was generated by AI during triage.
Agent Brief
Category: enhancement
Summary: The headless prompt tells a session how to wait on a command that went to the background, so it never waits on process names other sessions share
Current behavior:
Every Session prompt ends with the headless paragraph: run tests and other long commands in the foreground, raising the Bash timeout if needed, and never end the turn while a background task you depend on is still running. It says nothing about a foreground command that outlives the Bash tool's longest timeout (600s). The tool then moves the command to the background, and the session is left to improvise its own wait.
Seen in the #148 Merge run on 2026-09-30, while #147 and #158 ran at the same time: the full cargo test went past 600s and was moved to the background (task bmk201pfz). The session waited on it with until ! pgrep -f "cargo test"; do sleep 5; done. That pattern also matched the other sessions' cargo test processes. Its own suite finished (exit 0) at about 12:08Z, but the loop kept going until the tool killed it at 12:14:49Z (exit 144). That is about 7 minutes lost, and it could have been the whole session if the other suites had kept running.
Desired behavior:
The headless paragraph also says: if a command is moved to the background, wait for that task by its own task id or output file, never on process names or patterns (pgrep, ps | grep, and the like), because other sessions on the same machine run the same commands. The existing guidance stays: foreground first, and don't end the turn while a background task you depend on is still running.
Key interfaces:
- The shared headless text every Session prompt ends with: add the new guidance there, not to any one prompt
- If the generated prompts directory (Generate a top-level prompts/ directory showing every Session prompt #176–Generate prompts/README.md as the directory's entry point #178) has landed, its checked-in prompt files and golden-file test pick up the new text
Acceptance criteria:
- Every Session prompt (fresh, continuing, each Repair kind, and any others) ends with headless text that says to wait on a backgrounded command by its own task id or output file
- The same text says not to wait on process names or patterns, and gives the reason: other sessions on the machine run the same commands
- The existing foreground and "never end your turn while a background task you depend on is still running" guidance is still there
- Tests that assert on prompt text pass with the new wording
Out of scope:
- Making the test suite faster (Make the test suite faster #174)
- Any change to how thirdshift detects or reports killed background work
- Changing the Bash timeout the sessions run with
Activity