feat: hold_conch — exclusive voice access across turns + pause_conversation tool
Summary
Adds two related features for multi-agent voice coordination:
1. hold_conch parameter on converse
A new hold_conch: bool parameter that, when True, sets a hold between turns so other agents queue rather than speak while the holding agent is processing.
How it works:
- After each
conversecall withhold_conch=True, aconch_holdfile is written to~/.voicemode/conch_holdwith the holding process's PID - Other agents calling
try_acquire()checkis_held_by_other()and returnFalseimmediately if a hold is active - The hold is released on the next
conversecall withhold_conch=False(the default), or automatically when the holding process exits (dead PID check)
New Conch class methods:
Conch.set_hold(agent_name)— write the hold fileConch.release_hold()— remove it (PID-checked, won't clobber another agent's hold)Conch.is_held_by_other()— returnsTrueif another live process holds
2. pause_conversation(seconds, message=None) MCP tool
A new tool that sleeps for a specified duration while holding the conch, blocking other agents for the full duration.
- Calculates resume time at call time and logs it immediately (e.g.
Pause started: 30s, resuming at 22:09:45) messageparameter should be set to the calculated resume time (e.g."Resuming at 22:09:45") — it appears in the tool call display in the client UI while the pause is running, giving the user visibility without any streaming- Returns
"Pause complete. Resumed at HH:MM:SS (after Xs)."when done - Max safe duration ~5 min due to MCP client timeouts
Testing
Tested with two concurrent agents (Agent A holding, Agent B queuing) in a live multi-agent session:
- Agent A calls
converse(..., hold_conch=True)— speaks and sets the hold - Agent B calls
converse(..., wait_for_conch=True)— correctly queues and does not speak - Agent A calls
pause_conversation(seconds=30, message="Resuming at HH:MM:SS")— hold is maintained for the full 30s; Agent B continues waiting throughout - Agent A calls
converse(..., hold_conch=False)— releases hold; Agent B acquires and speaks
Known limitations / discussion points for maintainer
⚠️ skip_conch=True overrides hold_conch — observed in testing
Observed behaviour: When Agent B timed out waiting (CONCH_TIMEOUT default 60s) while Agent A held the conch, Agent B fell back to calling converse(skip_conch=True) and successfully spoke over Agent A's held conversation. The hold was completely bypassed.
skip_conch=True skips the hold file check entirely — it does not call try_acquire() or is_held_by_other(). So a held conversation is not protected against agents using skip_conch.
The current skip_conch docstring describes this as intentional: "speak immediately regardless of whether another agent holds it". But this makes hold_conch not truly exclusive. A possible alternative semantics: skip_conch jumps the queue but still respects an active hold. Left for the maintainer to decide — raising it here for visibility.
⚠️ CONCH_TIMEOUT (default 60s) interacts poorly with long holds
Observed behaviour: Agent B with wait_for_conch=True timed out after 60s while Agent A held across a pause_conversation(seconds=180). After timeout, Agent B had no coordination option left other than skip_conch.
With hold_conch now enabling intentional holds longer than 60s, the default timeout may need revisiting — or agents should be instructed to use a longer timeout when they know a long hold is in progress.
Stale hold file — no permanent lockout risk
If the holding process dies without calling release_hold(), the hold file is left on disk. However, is_held_by_other() always verifies liveness via os.kill(pid, 0) before returning True. A dead PID raises ProcessLookupError, which is caught, and is_held_by_other() returns False — so other agents can always proceed past a stale hold. There is no risk of a permanent lockout.
The orphaned file is harmless but does accumulate. Active cleanup (same pattern as _check_and_clear_stale_lock) could be added to is_held_by_other() or release_hold() if desired.
@ai-cora could you please help review?
Thank you, Tony — this is excellent work and it shipped. Your design and original patch landed as VM-1433 (conch holdership), reimplemented on a single-file model (the hold is the existing conch left in place and marked, rather than a second conch_hold file) to avoid the release→set_hold and pause-clobber races a two-file design invites. Both hold_conch on converse and the pause_conversation tool are now on master, and you're credited by name in the CHANGELOG. We also root-fixed the two limitations you flagged: wait_for_conch now waits through a live hold (so agents no longer auto-fall-back to skip_conch over a held floor), and the conch timeout default rose 60→300s. Closing as landed-with-credit. Hugely appreciated — see commits 0f2451d / 2b44263 / 57939d1.