acpmux: runtime workers get an 8 MiB stack (a debug daemon overflowed 2 MiB)

TE
7d ago
+7-0

tests/durable_agents.rs fails about one run in three on Linux CI, on base as well. The test reports daemon closed the socket. The daemon's own output says why: thread 'tokio-rt-worker' has overflowed its stack / fatal runtime error: stack overflow, aborting. The debug-build daemon aborts deep in adoption, because its request futures (above all server/requests.rs dispatch_request) are large in a debug build and tokio's workers get only 2 MiB.

This PR gives the runtime's workers 8 MiB, the main thread's default on Linux and macOS. The constant is WORKER_STACK_BYTES in cli/entry.rs runtime.

Any PR that adds a field to the session/prompt arm makes this red more likely. #27519 took it from about one failing test per three runs to two per run, so this lands first.

Risk

risk:low. The change reserves more virtual address space per worker thread; memory is committed only when the stack is actually used. The stdio MCP servers keep their 2 workers (#27606).

Evidence

Same harness, cargo test -p acpmux --test durable_agents on Linux, through cmux-ci test:

runstack overflowsfailing tests
base, 3 runs11, 0, 0
this PR, 4 runs00, 1 (stalled_turn::an_adopted_turn_whose_model_went_quiet…: no overflow, a separate flaky test), 0, 0

cargo test -p acpmux --lib cli:: passes: 364 tests.

Changelog

none

Agent session: agent session

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Gives acpmux runtime workers an 8 MiB stack, replacing tokio's 2 MiB default, so the debug daemon stops aborting on stack overflow during adoption. Those aborts were flaking tests/durable_agents.rs on Linux CI about one run in three.

  • The overflow happened deep in adoption because debug-build request futures (dispatch_request) are large.
  • Risk is low: the larger stack only reserves virtual address space, and memory is committed only as it's used.