You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Friend DM never sends presence: turn.start has no trigger, so no 'is thinking…' for DM replies (#297 follow-up) #332
In a friend DM, the replying home never sends the presence signal, so the asker never sees Name is thinking… while the friend's Bot works. Bot Social prod lists presence in GET /v1/platformfeatures, and the face-room case works (the line shows there). Follow-up to #297 / #301 (DM half).
Cause (found with a debug log, not a debugger)
createPresence().onTurnStart (plugins/social/src/presence.js) takes targetOf(event), whose DM branch needs event.place === 'chat' && event.trigger?.from?.kind === 'remote'. In a live friend DM the turn.start event of the answering Bot has place: 'chat', a botId and a turnId, but no trigger field. targetOf returns undefined, onTurnStart returns early, and set_presence is never called (no beat ok / beat err either). The core feed (core/src/host/flybot-feed.js) fills trigger from entry.pending, which only the preceding user/message event sets (deliveredOf); for a friend's line that delivered record is evidently missing or comes after turn/start.
Repro (main a526c75, Node 24, Bot Social prod with presence)
Two fresh homes A and B (own DSH_HOME each, ports e.g. 3101/3102), both with a working model, flybot-social pointed at the Bot Social server.
B opens "A's Chief" and sends a line (for example "Name a tea house near West Lake").
While A's Chief works, poll B's flybot/social/typing (or watch B's chat): {"supported":true,"typing":[]} the whole time, and no is thinking… line.
To see the cause: log the event in onTurnStart on A. It prints {"place":"chat","botId":"session-…","turnId":"session-…#2"} with no trigger.
Expected
turn.start for a turn answering a friend's line carries trigger.from.kind === 'remote' with the friend's handle (or targetOf finds the friend another way, for example the Bot's open remote chat), so set_presence { to } goes out and B shows Name is thinking… until the reply or the held-approval line arrives.
Unit tests in plugins/social/test/presence.test.js feed targetOf a hand-built event with trigger, so they pass without the real feed shape. A live or feed-level test would catch this.
Fixed on main by #360 (commit b1c25d1): when turn.start has no trigger, presence waits for the friend's exchange.delivered on that Session within CLAIM_MS and then announces thinking. Covered by plugins/social/test/presence.test.js.
Activity
fix(social): a late friend line only claims a turn it started within …
Birfy commentedon Oct 19, 2026
Fixed on main by #360 (commit b1c25d1): when
turn.starthas notrigger, presence waits for the friend'sexchange.deliveredon that Session within CLAIM_MS and then announces thinking. Covered byplugins/social/test/presence.test.js.docs(readme): claim friend-DM thinking line (follows ThinkFlowLab#360 /