acpmux: inter-session messages steer a running turn
Summary
A message sent from one agent session to another waited for the recipient's running turn to end, which can take minutes, before the recipient read it. Now a message steers into the running turn when the recipient's agent supports steering, and queues behind the turn otherwise:
acpmux send --no-waitsteers by default;--no-steerqueues instead. A send that waits for its reply still queues unless given--steer, because a steer is answered as soon as the agent reads it, before the reply. With--no-waitit printssteeredorqueued, and--jsongainssteered.- The
cmux agent messagepump hands messages to acpmux sessions withsteer: true. chief tellsends its prompt to a child withsteer: true.
Provenance is unchanged. Sub-session send_message is out of scope: the subsession-visibility lane (cmux/subsession-visibility) already makes it steer.
Testing
Regression: cmux-tui.yml focused, test_filter=the_pump_delivers_a_queued_message.
- Base plus the test only (1b00a1901c21): RED_RESULT
- Head (33568af64ba7): GREEN_RESULT
New unit tests: send_steers_messages_by_default_and_queues_waiting_sends (acpmux) and a_message_to_a_child_steers_its_running_turn (optchat-chief). PR CI runs them.
python3 scripts/cmux-next/prepush-gate.py: no new violations.
Observed / Not run
Observed: the focused runs above and the pre-push gate.
Not run: a live steer between two real sessions in a tagged build. The steer path itself (prompt_with with steer) is the existing one that acpmux send --steer already uses.
Changelog
Changed: Messages between agent sessions reach a busy recipient's running turn at once when its agent supports steering, instead of waiting for the turn to end
Proof
CLI and daemon behavior only; see Testing.
Agent session: cosmic-gray
🤖 Generated with Claude Code
Need help on this PR? Tag @codesmith-bot with what you need.
Summary by cubic
Messages between agent sessions previously waited for the recipient's running turn to end—which could take minutes—before being read. Now a message steers into the running turn when the recipient's agent supports steering, and queues behind the turn otherwise. A steer without interrupt never stops a turn whose agent cannot steer; it queues and waits for the turn to end.
acpmux send --no-waitsteers by default;--no-steerqueues instead.- A send that waits for its reply still queues unless given
--steer. --no-waitprintssteeredorqueued, and--jsongains asteeredfield.queuedis reported from the hub's decision, so a pending permission no longer showsqueuedwhen the agent steers.- The
cmux agent messagepump andchief tellnow send messages to agents with steering enabled.