Skip to content

Friend DM never sends presence: turn.start has no trigger, so no 'is thinking…' for DM replies (#297 follow-up) #332

Closed

Description

@Birfy

Summary

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/platform features, 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)

  1. 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.
  2. A: Chief → Sharing → Invite to this Bot. B: Add friend → paste the link. Wait about 20 s for the grant to sync (a message sent right after joining is refused, see Accepting an invite briefly publishes the joiner's (unshared) Bot on the inviter's home: dead 'no longer shared with you' chat opens on load; friend invisible in Social #303).
  3. B opens "A's Chief" and sends a line (for example "Name a tea house near West Lake").
  4. 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.
  5. 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.

Notes

  • README (PR docs(readme): re-record every demo on the current UI #329) now says the thinking line shows in face rooms and that the DM one is not shown yet.
  • 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.

Activity

  1. Birfy commented on Oct 19, 2026

    @Birfy
    CollaboratorAuthor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions