Wait for next fmsg message
wait_for_messageWait for and retrieve the next inbound message on a thread, batching messages within a settle period and returning thread context for replying.
Instructions
Block until the next inbound message arrives (pushed over the fmsg host's WebSocket) and return it with its thread context so you can answer with reply. Use this when the user asks you to chat, converse, keep replying, auto-reply, or respond to the next message. Loop: wait → reply → wait again passing the after_id from the previous result. On status "timeout" simply call again with the same arguments. Messages arriving on the same thread within settle_seconds are batched into ONE result; reply once, to the newest (reply_target_id). Your own messages, reactions and no-reply messages never qualify. Each call blocks at most timeout_seconds (max 230); stop looping when the user interrupts or the limits they set are reached.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| from | No | only accept messages from this address or short name | |
| after_id | No | only messages with a greater id qualify; pass the after_id from the previous result. Omit on the first call to wait for messages arriving from now on | |
| thread_of | No | only accept messages in this message's thread | |
| include_thread | No | include the assembled thread context of the newest message | |
| settle_seconds | No | after the first message, keep collecting same-thread messages for this long | |
| timeout_seconds | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note | Yes | ||
| status | Yes | ||
| skipped | Yes | messages deliberately passed over; after_id has advanced past them | |
| after_id | Yes | pass this as after_id on the next call | |
| messages | Yes | ||
| transport | Yes | ||
| unclassified | Yes | messages whose thread could not be determined; after_id is held before them, call again to retry | |
| thread_root_id | Yes | ||
| reply_target_id | Yes | newest message of the batch; reply to this one | |
| pending_other_threads | Yes |