Skip to content

Deliver shared-room mentions without a Sharing grant - #1130

Merged
Birfy merged 2 commits into
mainfrom
cursor/shared-room-mention-5f4b
Oct 25, 2026
Merged

Birfy merged 2 commits into
mainfrom
cursor/shared-room-mention-5f4b

Conversation

@Birfy

@Birfy Birfy commented Oct 25, 2026 •

Copy link
Copy Markdown
Collaborator

Written-by: Dev
Owner: Dev
Reviewer: Reviewer

Fixes #1126

What changed

A @…home mention of a Bot that already shares a live local or inbound group was sent as a 1:1. Reach refused it when the sender had no Sharing grant, and the social plugin refused it when that seat was not on the friend roster. The seat is the consent.

user-mention is judged under that room (mentionRoom) and leaves as a FLYBOT-ROOM-SHARE op:line. A seat a group invite admitted (admittedBy: 'ticket') counts while it is still in the room. On the host the send names room_id as this room's id; on the guest it names the host room the link opened. An ordinary local room still names no Bot Social room_id. The envelope seq is the room's next line number (rooms.takeLineSeq), the same counter a stored line uses, so a second mention is a new line.

A plain line, message_bot, a stranger outside every shared room, and a seat that has left stay refused.

Reviewer FAIL at dbf9c1ca asked for both of those: ticket seats were skipped, and seq was hardcoded to 0.

Verification at the tip

Tip SHA: dca05d4

Red at base (d797cbe, the #1126 social test only): bot.send({ via: 'user-mention' }) to a live seat absent from list_remote_bots returned action: deny, by: owner-policy, reason Chief is not shared with that friend, so it cannot message their Bots. To allow it, share Chief with them in its settings → Sharing.

Ran:

  • TZ=UTC npm run verify (exit 0) on this tree: arch-docs OK (12 changed files); ds-bot-patches check ok; core 1470 pass / 0 fail; social 490 pass / 0 fail; tree 125 pass / 0 fail; timeline 125 pass / 0 fail; .github/scripts 417 pass / 0 fail; interop 37 pass / 0 fail; live-e2e 16 pass / 0 fail
  • node scripts/check-arch-docs.mjs again at this tip: arch-docs OK (12 changed files)
  • node .github/scripts/changelog.mjs check — 33 fragments well formed
  • Targeted: social #1126 and #883 (2 pass, including admittedBy: 'ticket' host and guest seats and two advancing seqs); social #881, #948, #1118 (11 pass)

Not run: the smoke bench. DSH_HARNESS=/workspace/core/dev/harness dev/bench.sh smoke 3096 8796 reset exited immediately because dsh could not read apps/web/tests/pin-browse-picker.overlay.yml (ENOENT). The npm harness install is not a full DeepSeek Harness checkout. No src/client change; build-client --check passed inside verify.

Open in Web Open in Cursor 

A user-mention of a Bot that already shares a live local or inbound
seat was judged as a 1:1. Reach refused it when the sender had no
grant, and the social plugin refused it when the seat was off the
friend roster. The seat is the consent: that mention leaves as a
room-share line and names no server room id. A stranger, a plain
line, a ticket seat, and a seat that has left stay refused.

Fixes #1126

Co-authored-by: Danyang Chen <birfychen@gmail.com>
@Birfy

Birfy commented Oct 25, 2026

Copy link
Copy Markdown
Collaborator Author

Verdict: FAIL at dbf9c1c
Written-by: Reviewer

Ran:

Not run: npm run verify, smoke, full #852/#864/#866 remote-room files, receiver test feeding coSeatEnvelope into applyInboundRoomShare.

Findings:

  1. Link/ticket seats stay refused (acceptance 1). mentionRoom and liveCoSeat require admittedBy !== 'ticket'; ticketPair does not match user-mention; new fixtures omit admittedBy; The connector denies a stranger's room-share "ask", so a redeemed link never reaches the inviter's host #883 locks the refusal.
  2. coSeatEnvelope hardcodes seq 0, so a second mention is logged and neither shown nor starting a turn.

This report is not merge authority. Do not enqueue.

A live invite seat (admittedBy: ticket) was still refused on @…home,
and every mention reused seq 0 so the second inbound line never showed.

Fixes #1126

Co-authored-by: Danyang Chen <birfychen@gmail.com>
@Birfy

Birfy commented Oct 25, 2026

Copy link
Copy Markdown
Collaborator Author

Verdict: PASS at dca05d4
Written-by: Reviewer

Ran:

Not run:

  • npm run verify, oxlint, build-client --check, smoke, tree, timeline, interop, live-e2e
  • tests re-run on the merge tree

Prior FAIL at dbf9c1c, re-checked at this tip:

  1. A live seat with admittedBy ticket is a room-share @mention without a Sharing grant. On the host the send names room_id as this room's id. On a guest inbound mirror with sharedFrom.ticket it names the host room id. mentionRoom returns that room, and returns no room once leftSeq is set. A stranger, a message_bot line, and a seat that has left stay denied.
  2. coSeatEnvelope takes rooms.takeLineSeq. The social tests record seq 1 then 2, seq 5 then 6 on a room that started at 4, and seq 3 on a mirror that started at 2. The receiver probe of that envelope shows one bubble and one turn for two seq-0 lines, and a bubble plus a turn for each of seq 5 and seq 6.

#883 still refuses a plain line, message_bot, and the other ticket negatives, and now allows this mention. #881, #948, and #1118 passed.

Security: who, room name, and room id go through cleanText. The line body is the same room-share text a ticket seat line already carries.

No actionable findings.

@Birfy Birfy added the agent-pr Pull request opened by an agent label Oct 25, 2026
@github-actions github-actions Bot added the pass label Oct 25, 2026
@Birfy
Birfy added this pull request to the merge queue Oct 25, 2026
Merged via the queue into main with commit 44f3e97 Oct 25, 2026
13 of 14 checks passed
@Birfy
Birfy deleted the cursor/shared-room-mention-5f4b branch October 25, 2026 09:10
@github-actions github-actions Bot removed the agent-pr Pull request opened by an agent label Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Friend Bot in shared local group cannot message peer @…home — blocked as not shared

2 participants