Skip to content

A friend's Bot added to a local group shows the raw FLYBOT-ROOM-SHARE envelope on its approval cards #847

Closed

Description

@Birfy

What is wrong

Adding a friend's Bot to a local group chat (not a face-to-face room) makes the host send a FLYBOT-ROOM-SHARE envelope through send_as_member. Bot Social holds that envelope as an ordinary outbound message, and the approval card prints the envelope itself:

Waiting for approval
Chief → SelfTest B2
FLYBOT-ROOM-SHARE {"v":1,"op":"join","roomId":"session-e2439f82-0c89-4bba-a7d7-7d60572c19fd","name":"You, Chief, Chief","inviterName":"a friend","inviterHome":"","inviterHandle":"@chief.selftesta2.home","invitedHandle":"@chief.selftestb2.home","seq":0}
Show more   Approve  Reject  Auto-send from now on

The wire format, a local session-… id and "inviterName":"a friend" all reach the person. shownHoldText (plugins/social/client.js:1040, used at :1706) only understands the FLYBOT-FACE-HUMAN marker, so a room-share envelope passes through untouched.

Reproduce (real UI, two isolated homes, main be48393b)

  1. Both homes are friends with grants in both directions (run.mjs establishes this).
  2. Home A: sidebar + → New group chat → pick A's Chief as admin → pick B's Chief (Chief (SelfTest B2)) as the second member → Create group chat.
  3. Home A: open the 1:1 chat with Chief (SelfTest B2) (the group's own chat and the Inbox show nothing).
  4. Eight cards are waiting, all reading the raw envelope above: one op: "join" plus one per room line.

Expected

One plain sentence per card, and no wire format or local ids:

  • op: "join" → Invite Chief (SelfTest B2) to the group "You, Chief, Chief"
  • op: "line" → Group message to SelfTest B2: <the line's text>

The person who clicked "Add member" already consented to sharing that room (docs/subsystems/social.md:187: "via: 'room' / via: 'room-share' skip the social outbound hold (the add-to-group click is consent)"), so the invited home should see the group without a second approval. Today the invite never leaves until the inviter clicks Approve once per envelope — the host could clear Bot Social's blanket hold for these sends the way it already does for a face-room line (autoSendFaceLine, #737, holdIsBlanket() allow-list), which keeps a flagged line on its card.

Impact

docs/subsystems/social.md:187 promises "the Bot's owner sees the group as soon as they are added". Measured: B's state.json had no inbound-share room at all, B's sidebar had no "Shared room from …" row, so the promised as-soon-as-added experience does not happen — the invite sits in A's 1:1 chat behind a JSON card, and each later group line adds another one.

Evidence

  • Screenshot: reports/shots/lr-a-bchat.png (self-test workspace), eight cards read out of the DOM.
  • flybot/social/status on A reported the hold as {kind: "outbound_message", status: "pending", blanketHold: true, reasons: []} with that envelope as text; flybot/approvals (local holds) was empty, so the card comes from Bot Social's hold, not a local one.
  • B's state.json: 11 rooms, none with origin: "inbound-share".

Activity

  1. added
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    area:socialFriends, invites, grants, Bot Social
    area:uiWeb/desktop UI and copy
    bugSomething isn't working
    on Oct 23, 2026
  2. Birfy commented on Oct 23, 2026

    @Birfy
    CollaboratorAuthor

    Triage

    Confirmed on 7936fdf7, with one correction to the root cause: FlyBot's own hold is already skipped for these sends. plugins/social/src/social.js:1354 returns undefined for via: 'room' / via: 'room-share', so docs/subsystems/social.md:187 is accurate about the local hold. The cards in the report are Bot Social's pending_approval (flybot/social/status → blanketHold: true), and sendOut deliberately leaves the platform hold on room sends alone (:1474 and :1480 exclude room / room-share; the comment at :1472-1473 says "the friend's owner decides those"). So the defect is: nobody ever clears Bot Social's hold on the invite envelope, and its text is printed raw.

    Two halves, both in this issue:

    1. Clear the platform hold on the room-share envelope when it is a blanket hold with no finding — the same way a face-room line is cleared (holdIsBlanket() allow-list, Auto-send on for a friend: the line never arrives — Bot Social outbound approval stays pending and no card exists #737). The click that added the Bot is the owner's consent (social.md:187), and A local room has no invite of its own: no link to hand over, only a picker of Bots the account already knows #852's expected "one owner decision covers the invite, not one approval per room line" is the same decision. A hold that carries a finding (reasons non-empty, or an attachment) keeps its card.
    2. Humanize the card text. shownHoldText (plugins/social/client.js:1040, used at :1706) only understands FLYBOT-FACE-HUMAN; it must render Invite Chief (SelfTest B2) to the group "You, Chief, Chief" for op: "join" and Group message to SelfTest B2: <the line> for op: "line" — never the JSON, never a session-… id.

    Acceptance

    1. After Add member on a local group, with grants in both directions, A's 1:1 chat shows no raw-envelope card for the join, and B's state.json gains an origin: "inbound-share" room plus a Shared room from <owner> row within one inbox poll — with A clicking nothing.
    2. A line typed in A's group after that reaches B and a reply comes back. A line that is held with a finding still shows a card, and that card reads a plain sentence.
    3. Negative control: forcing the new allow-list branch off puts the cards back, i.e. the new test fails — otherwise it is not pinning the clear.
    4. An inbound-share projection forwarding a line home (room-membership.js:967-986) is untouched: it keeps carrying the original inviter. A user-created group shared to a friend's Bot names its inviter "a friend" #848 edits shareInviter, which that path calls at :985; the two must not fight.
    5. The face-room path is unchanged: via: 'room' line holds that exist today keep their behaviour (#258 reasoning), and the face-room suites stay green.

    Sequence

    This is the repair. #852 (a link to hand over) builds on it and must not re-implement hold clearing. Land #847 first, then #848, then the #852 plan.

    Labels: bug, area:social, area:ui, agent-ready.

  3. Birfy commented on Oct 23, 2026

    @Birfy
    CollaboratorAuthor

    Dev2 claim

    Written-by: Dev2

    Starting on 7936fdf7. Branch: fix/847-room-share-hold.

    Plan for the two halves in this issue (no code pushed yet):

    1. Clear the platform hold. The blanket-hold allow-list path that clears a face line (autoSendFaceLine, social.js:3498, reached at :3486 only when outbound.human is false) is the one to extend: an outbound FLYBOT-ROOM-SHARE text sent by sendShareTo should clear a hold only when holdIsBlanket() is true and there is no finding; a hold with reasons or an attachment keeps its card. via: 'room' / 'room-share' stays out of the generic sendOut auto-send branches (:1474, :1480), since those decide a friend's line, not the invite envelope.
    2. Humanize the card. shownHoldText (client.js:1046, used at :1706) learns the FLYBOT-ROOM-SHARE marker next to FLYBOT-FACE-HUMAN: op: "join" → Invite <label> to the group "<name>", op: "line" → Group message to <label>: <line text>; unknown ops and unparseable JSON keep the current fallback.

    Tests: a client test that renders the join and line cards through shownHoldText (red first, with the marker unknown), and a plugin test that drives a blanket hold on a room-share send and asserts it is cleared while a hold with a finding stays. Negative control for both: disable the new branch and they go red.

  4. added
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    on Oct 23, 2026
  5. self-assigned this
    on Oct 23, 2026
  6. removed
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    on Oct 23, 2026
  7. Birfy commented on Oct 23, 2026

    @Birfy
    CollaboratorAuthor

    PR opened: #854 at a5d00f7 (branch fix/847-room-share-hold, base edb9b7cd).

    Written-by: Dev2

    Both halves of the ticket are in it: the blanket-hold clear on the room's envelope autoSendRoomEnvelope, and the card sentence in shownHoldText. The six evidence columns are in the PR body.

  8. removed
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    on Oct 23, 2026
  9. Birfy commented on Oct 23, 2026

    @Birfy
    CollaboratorAuthor

    The client-side workaround this ticket shipped is tracked upstream so it can be retired: Birfy/bot-social#45 — either do not hold a room-context send on the blanket rule alone, or expose a machine-readable hold_reason so a client only auto-decides blanket_outbound.

    Written-by: Chief

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

Metadata

Metadata

Assignees

Labels

area:socialFriends, invites, grants, Bot Socialarea:uiWeb/desktop UI and copybugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions