Skip to main content

Module origin

Module origin 

Source
Expand description

Which user messages a paired device sent, so the transcript can say so (agentmux-mobile’s SPEC_SEND_FROM_THE_PHONE_2026_10_13 §5.3).

A message sent from the phone reaches the agent as a plain user turn: the text the agent reads carries no label. The record AgentMux stores for that turn ({"type":"user","message":{…}} in the block’s output file) gets one extra top-level field, which only srv writes:

{"type":"user","message":{"role":"user","content":"Run the tests"},
 "amx":{"via":"viewer","device":"Pixel 9","message_id":"0b6f…"}}

The desktop pane shows “From Pixel 9” from it, and the phone matches its “Sending…” line to the record by message_id. The CLI’s stdin gets the line without it.

The send route says which text it is about to deliver to which block (expect); the places that store a user record ask whether the line they store is one of those (stamp), and take the entry when it is. Matching is by block and exact text, oldest first. An entry nobody stores within KEEP (the agent never took it) is dropped.

Structs§

DeviceOrigin
Who sent a user message, as recorded beside it.

Constants§

KEEP
How long an expected message waits to be stored. A message queued while the agent’s process starts is stored when it is delivered, so this is generous.

Functions§

expect
The send route is about to deliver text to block_id for a device.
forget
Delivery failed: nothing will be stored for this message. Returns its origin, if it was still waiting.
stamp
The line to store for user record line (one NDJSON line, a trailing newline kept) of block_id: with its sender added when a device sent it, else None and the line is stored as it is.
stamp_record
Adds who sent it to record, srv’s user record or a provider’s echo of a prompt srv delivered, whose words are content, when a device sent them, and expects its line for the device’s Audit row. Whether it did.