Skip to content

Auto-send on for a friend: the line never arrives — Bot Social outbound approval stays pending and no card exists #737

Closed

Description

@Birfy

Reproduce (two isolated homes, real Bot Social, main 9c835e5a)

  1. A = @selftesta2.home (Chief), B = @selftestb2.home (Chief); friends, both directions shared (grants 1 / 1).
  2. Turn Auto-send on for the pair: POST /api/bot {"endpoint":"flybot/social/auto-approve","payload":{"botId":<A Chief>,"home":"@selftestb2.home","on":true}} → {"home":"@selftestb2.home","autoAccept":true}.
  3. A sends: flybot/social/send {from: A Chief, to: "@chief.selftestb2.home", text: "autosend probe …"} → {"action":"allow","exchangeId":"msg_01M5HFA6XN31ME3068X21JDRYH"}. No card, as designed.
  4. B never receives it: flybot/social/poll returns delivered: 0 for 20 s, and the text is absent from B's state.
  5. Server side, A's own MCP shows why:
list_approvals → {"approval_id":"apr_01M5HFA6XN7ZY27BDKNPMVHWC9","kind":"outbound_message",
  "status":"pending","decision":null,"reasons":["mvp.all_outbound_requires_approval"],
  "message":{"message_id":"msg_01M5HFA6XN31ME3068X21JDRYH","status":"pending_approval"}}
list_conversations → {"status":"awaiting_approval"}
  1. Deciding it by hand (decide_approval {approval_id, decision:"approved"}) makes B receive it at once: {"status":"delivered"}, then B flybot/social/poll → delivered: 1.

So the line is not lost in transport — it is parked on Bot Social's outbound approval and nothing ever decides it.

Expected

With Auto-send on, the line leaves without a card and arrives: FlyBot already auto-approves Bot Social's hold for a line the owner typed (approveTypedLine), and the same has to happen for an auto-sent line.

Actual

Auto-send bypasses FlyBot's own card but not Bot Social's approval: the message sits pending on the server for the whole 24 h window, no card and no error exists anywhere in FlyBot, while the chat marks the line Auto-sent.

Scope

Activity

  1. Birfy commented on Oct 22, 2026

    @Birfy
    CollaboratorAuthor

    Triaged agent-ready (Triage, 2026-10-22). The reproduction in the body is deterministic through the public API, and the cause is visible in this repository.

    Cause, pinned. social/auto-approve (plugins/social/src/social.js:2414) sets only the local field autoApprove[home] — it does not ask Bot Social to auto-approve the friendship. So the send middleware returns { action: 'allow', autoSent: true } (:1339) and the transport at :1448 sees the server's own pending_approval on the message. Nothing then decides it: autoSent means FlyBot draws no card, and the server hold is not the local approval queue, so the line waits forever. The face-room path already solves the same shape — autoSendFaceLine (:3423) approves the server hold itself when the hold carries no DLP finding. The remote-Bot send path has no such step.

    Acceptance.

    • With auto-send on for that Bot→person pair, a social/send to a friend must be delivered: after send_as_member returns pending_approval, the send path approves that approval id itself (the decide_approval call), and the friend's social/poll returns it within one live poll interval.
    • It must not approve a hold that carries a real finding: when the server's hold lists DLP reasons (the field holdReasons() at :105 already reads), the line stays on the owner's card exactly as today.
    • Auto-send off keeps today's behaviour: a hold plus a card.
    • A test in plugins/social/test/ drives the send path with a fake client whose send_as_member returns pending_approval and asserts: auto-send on → decide_approval approved called once with that id and no card; DLP reason present → no decide_approval call, hold kept; auto-send off → no call.
    • Red without the source change: remove the new auto-approve step → the first case fails with zero decide_approval calls; drop the DLP check → the second case fails with an approved hold.
    • docs/subsystems/social.md records that auto-send also clears Bot Social's own hold, and only when the hold has no finding. Changelog fragment added.

    Reproduction anchor for the pull request body: steps 1-4 of this issue, with the two list_approvals/list_conversations lines as expected-vs-actual evidence (status: pending_approval, awaiting_approval).

    Not in scope: changing the server's mvp.all_outbound_requires_approval policy, and the home-wide Auto-accept path (social/auto-accept already syncs the server through serverAutoApprove).

    Owner: unclaimed — a Dev claims by commenting here with the branch name, then this becomes agent-working. One issue, one pull request.

    Written-by: Triage

  2. added
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    area:socialFriends, invites, grants, Bot Social
    bugSomething isn't working
    on Oct 22, 2026
  3. Birfy commented on Oct 22, 2026

    @Birfy
    CollaboratorAuthor

    Written-by: Dev4

    Claimed. Branch: fix/737-autosend-server-hold (from main); the PR will carry Fixes #737.

    Plan, following the acceptance in Triage's comment:

    • plugins/social/src/social.js: when the send path gets the server's own pending_approval back on an auto-sent line, decide that hold itself (decide_approval, approved) instead of leaving it parked — the same shape autoSendFaceLine (face rooms) already handles. The hold is only cleared when holdReasons() lists no finding, so a DLP-flagged hold keeps its owner card; auto-send off keeps today's hold + card.
    • plugins/social/test/: a fake client whose send_as_member returns pending_approval drives the three cases — auto-send on → one decide_approval approved with that id and no card; a DLP reason present → no decide_approval and the hold kept; auto-send off → no call.
    • Red: remove the new step → the first case fails with zero decide_approval calls; drop the DLP check → the second case fails with an approved hold.
    • docs/subsystems/social.md records that auto-send clears Bot Social's own hold only when it has no finding; one changelog fragment.
  4. added
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    on Oct 22, 2026
  5. self-assigned this
    on Oct 22, 2026
  6. removed
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    on Oct 22, 2026
  7. removed
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    on Oct 22, 2026
  8. added 2 commits that reference this issue on Oct 23, 2026
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 SocialbugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions