From b04c045064dbbe5dfa09ee6c94f7e6fce363e4f8 Mon Sep 17 00:00:00 2001 From: Amolith Date: Sun, 5 Jul 2026 02:23:17 +0000 Subject: [PATCH] docs: document reply-wait cursor workflow Teach agent-skill consumers to capture the record, use archive-id as the MAM receive cursor, avoid treating message-id as a cursor, and fall back through recent MAM list if archive-id cannot be resolved. Amp-Thread-ID: https://ampcode.com/threads/T-019f2fe4-f392-7688-8b2f-8d40eb9fa4b8 --- src/main.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main.c b/src/main.c index 8a9afae1b0cbd8a2ef59172c3cadc659baec5306..beb2e867fe1019bec30deafa51f4f3abc7522dc3 100644 --- a/src/main.c +++ b/src/main.c @@ -579,6 +579,17 @@ static int _agent_skill_command(int argc, char *argv[]) { "archive-id is empty, the message was sent but the archive cursor was not\n" "resolved before timeout.\n" "\n" + "Send-then-wait-for-reply workflow:\n" + " 1. Capture the line from message chat.\n" + " 2. Extract its archive-id attribute. Do not use message-id as after-id;\n" + " message-id is only the client stanza id.\n" + " 3. Run mam receive for the same JID with after-id=. This skips\n" + " your outgoing message and waits for newer archived messages.\n" + " 4. If archive-id is empty, the send likely succeeded but the cursor was not\n" + " resolved. Fall back to mam list over a recent time window, find the line\n" + " whose message-id matches the sent message-id, then use that line's id as\n" + " the receive cursor.\n" + "\n" "MAM fields for list/receive are unordered key=value terms: with=, start=,\n" "end=, after-id=, before-id=, ids=, max=. A bare JID is shorthand for with=.\n" "A second bare argument is an error. start= accepts XMPP timestamps or relative\n"