Repository navigation
test(acpmux): a gated fake agent exits with its daemon - #22936
Conversation
The FAKE_START_GATE loop polls for its gate file and never reads stdin, so a test that stops its daemon before opening the gate leaves the agent (in its own process group) polling forever: 257 were left on huge-blue (2026-10-21). Red: the agent outlives its closed stdin. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15bf1-fdac-78a0-ac2e-a3aef81402c7&host=cosmic-gray
While it waits at FAKE_START_GATE it now selects on stdin: EOF (the daemon that started it is gone, even after a SIGKILL) ends it, and lines that arrive first are kept for after the gate. person_auto_start's Daemon drop kills a daemon that does not stop within 10 s, so a hung shutdown never holds its agents' stdin open. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15bf1-fdac-78a0-ac2e-a3aef81402c7&host=cosmic-gray
Bugbot needs on-demand usage enabledBugbot uses usage-based billing for this team and requires on-demand usage to be enabled. A team admin can enable on-demand usage in the Cursor dashboard. |
|
owner: 01a15bf1-fdac-78a0-ac2e-a3aef81402c7 |
1 similar comment
|
owner: 01a15bf1-fdac-78a0-ac2e-a3aef81402c7 |
|
cmux status (one comment, edited in place; each line is updated by the job that owns it) Review App of this head (app.zip, kept 1 day)
|
Review: splitlines() also breaks at U+2028/U+2029, which serde_json writes unescaped, and strict UTF-8 differs from stdin's own decoding. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15bf1-fdac-78a0-ac2e-a3aef81402c7&host=cosmic-gray
|
Bead |
|
Review: independent subagent PASS. The low note on how pre-gate lines split was fixed in 03eda2d. Compile: |
|
Shipped in:
|
A test that stopped its daemon before opening
FAKE_START_GATEleft the gatedfake_agent.pypolling forever. It runs in its own process group (process_group(0)), so the daemon's SIGTERM never reached it, and its gate loop never read stdin. machine-mesh counted 257 of them on huge-blue (2026-10-21). The 13 I inspected were allaas-<tag>-<pid>/gatepollers fromperson_auto_start.rs.fake_agent.py: while it waits at the gate, it selects on stdin. EOF ends it: the daemon is gone, even after a SIGKILL of the test binary. Bytes that arrive first are kept and read after the gate.person_auto_start.rs: theDaemondrop kills a daemon that hasn't stopped within 10 s, so a hung shutdown can't keep its agents' stdin open.auto_start_a_gated_agent_exits_with_its_daemon_and_keeps_what_came_first: a gated agent exits when its stdin closes, and aninitializesent before the gate opens still gets its reply.Test-only; no product code changes.
Changelog
none
Observed / Not run
Observed, on cmux16 (
cargo test --locked -p acpmux --test person_auto_start):fake_agent.pywith the new test: FAILED, "a gated agent outlived the stdin of its daemon";aas-gateagents left afterwards;hub_integrationan_agent_that_never_answers_its_start_fails_with_a_deadline and lib a_prompt_is_accepted_when_recorded_before_the_agent_starts.Not run: the full acpmux suite (left to CI).
Agent session: cosmic-gray
🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.Summary by cubic
Fixes gated fake agents that polled forever after their daemon died, leaving orphan processes behind (257 on huge-blue, 2026-10-21). A gated agent now selects on stdin while waiting at the start gate: stdin EOF ends it, and bytes received early are kept until the gate opens. The test
Daemondrop also kills a daemon that won't stop within 10s, so a hung shutdown can't hold its agents' stdin open. Adds a test covering both behaviors. Test-only; no product code changes.Written for commit 03eda2d. Summary will update on new commits.