Skip to content

Wait on the room the caller is actually delivered on - #73

Merged
vitramir merged 1 commit into
mainfrom
wait-on-the-callers-own-room
Aug 21, 2026
Merged

vitramir merged 1 commit into
mainfrom
wait-on-the-callers-own-room

Conversation

@vitramir

Copy link
Copy Markdown
Contributor

agyn threads … --wait subscribed to thread_participant:me and read GetUnackedMessages for every caller.

A thread delivers to one of two surfaces depending on what the participant is — users and apps get a message recipient and are notified on thread_participant:me, agent instances get an inbox item and are notified on instance_inbox:me — and the two are mutually exclusive. Run inside an agent workload, the command subscribed to a room its events never reach and then read a table its messages are never written to, so an agent waiting on another agent's reply could only ever time out.

Observed in TestAgentAgynCLIWaitToAnotherAgent: agent A waited 120s, agent B replied into the right thread 9 seconds later, A exited wait timed out. That thread has 0 message_recipients rows and 2 agent_inbox_deliveries rows.

Picks the surface from the caller — an agent instance reads and acks its own inbox and subscribes to instance_inbox:me, every other caller is unchanged. The ack addresses the item rather than the message inside it, so the surface remembers which item each message arrived in.

Per agyn-cli.md#wait-behavior and threads.md; the platform half (instance_inbox:me rewrite, room authorization, the inbox RPCs) was already in place.

A thread delivers to one of two surfaces depending on what the
participant is: users and apps get a message recipient and are notified
on thread_participant:me, agent instances get an inbox item and are
notified on instance_inbox:me. The two are mutually exclusive.

This command spoke only the first, for every caller. Run inside an agent
workload it subscribed to a room its events never reach and then read a
table its messages are never written to, so waiting on a reply from
another agent could only ever time out -- the reply arrives, and the
waiter is watching the wrong two places for it.

Pick the surface from the caller: an agent instance reads and acks its
inbox and subscribes to instance_inbox:me, everyone else is unchanged.
The ack addresses the item rather than the message inside it, so the
surface remembers which item each message arrived in.
@vitramir
vitramir merged commit afff6dd into main Aug 21, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant