Skip to content

Name a friend's Bot one way and approval cards by the receiving person - #502

Merged
Birfy merged 7 commits into
ThinkFlowLab:mainfrom
Birfy:fix/498-friend-bot-name
Oct 20, 2026
Merged

Birfy merged 7 commits into
ThinkFlowLab:mainfrom
Birfy:fix/498-friend-bot-name

Conversation

@Birfy

@Birfy Birfy commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #498

What. A friend's Bot now has one name in a friend chat, on both homes. Approval cards name the person who gets the message.

Why. The owner's decision (option a, 2026-10-20) was to unify friend Bot names as Chief (SelfB1233) through one formatter, and have approval cards show the receiver.

Test. ARCH_DOCS_BASE=origin/main TZ=UTC npm run verify passes with 0 failures (core 1079, social 297, tree/timeline/scripts/interop/live-e2e all pass; plugin lint OK). New and updated tests:

  • the formatter names both homes' Chiefs and the owner (remote-room.test.js)
  • the held card reads the same with and without the friend's chat in the roster (held-reply.test.js)
  • the overlay pointer names the person (overlay-approvals.test.js)
  • the @ menu names a host-shaped friend chat (at-menu.test.js)
  • the sidebar row and other surfaces use the formatter (flybot-client.test.js)
  • the social dock names the person through the host formatter (social.test.js)

Not run: the live two-home Mac instances and the smoke bench (client-only change).

Risk tier: T3 (estimate, from the risk-gate report: remote-label.js and displayName paths; the controller sets the label)

A friend's Bot read four ways in one DM (ThinkFlowLab#498): the sidebar row was
'Chief' plus a muted owner, the header 'Chief (SelfB1233)', the @ menu
fell back to the handle for a friend's chat, and the held reply card
read 'Chief → Chief (SelfB1233)' after a reload but 'Chief → SelfB1233'
before it.

friendBotTitle / friendBotOwner in shared/remote-label.js are now the
one formatter for a friend's chat: the sidebar row, header, tab,
composer placeholder and @ menu call it, and the social plugin reads it
from __flybot__.names. Approval cards (held reply, overlay, social dock)
name the person who gets the message: the stored recipient first, else
the friend chat's owner, so the card is the same live and after a
reload. Face rooms are unchanged (ThinkFlowLab#457).
@Birfy Birfy self-assigned this Oct 20, 2026
@Birfy Birfy added agent-pr Pull request opened by an agent bug Something isn't working area:social Friends, invites, grants, Bot Social area:ui Web/desktop UI and copy self-test Filed by the product self-test routine (issues only) labels Oct 20, 2026
@Birfy Birfy added the awaiting-approval PR is green and waits for the maintainer's approval (T2/T3) or a review PASS at its tip label Oct 20, 2026
@Birfy

Birfy commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator Author

Self-review: PASS
Tip SHA: 4f5c56f
Ran:

@github-actions github-actions Bot added the risk:T3 Risk tier T3 (needs a human approval), set by the controller from the diff label Oct 20, 2026
@Birfy
Birfy added this pull request to the merge queue Oct 20, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 20, 2026
…owLab#481/ThinkFlowLab#501/ThinkFlowLab#505)

Regenerated client bundle patch after merge; auto-merged social sources keep ThinkFlowLab#498 friend Bot name formatter with ThinkFlowLab#501/ThinkFlowLab#505.
@Birfy

Birfy commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator Author

Self-review: PASS
Tip SHA: 39d0f29
Ran:

Resolve generated ds-bot client-bundle patch via regenerate from merged core.
@Birfy

Birfy commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator Author

Self-review: PASS
Tip SHA: a0ce3bf
Ran:

  • ARCH_DOCS_BASE=origin/main TZ=UTC npm run verify (pass)
  • reviewed diff at tip vs owner design rules
    Not run:
  • live Mac instances / production Bot Social

@Birfy
Birfy added this pull request to the merge queue Oct 20, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 20, 2026
# Conflicts:
#	patches/ds-bot/0008-client-bundle.patch
@Birfy

Birfy commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator Author

Self-review: PASS
Tip SHA: 2e669bb
Ran:

  • git merge origin/main (eb91742, after Remind about approvals waiting 15 min, switch each notification kind, one notification per chat #492 and Social: neutral 'You already have …' on a re-accepted invite; clearer Remove confirm #503) into the branch, no rebase or force-push; only conflict was the generated patches/ds-bot/0008-client-bundle.patch
  • generated files regenerated, not hand-merged: took main's patches/ds-bot, then (cd core && npm run build), node scripts/ds-bot-patches.mjs generate, then check: ok (10 patches apply cleanly; core/ = ds-bot/ + patches)
  • ARCH_DOCS_BASE=origin/main TZ=UTC npm run verify (core lint + arch-docs, plugin lint, build-client --check, ds-bot-patches check, all suites): pass, 0 failures (core 1100, social 310, tree 80, timeline 92, .github scripts 93, interop 37, live-e2e 16)
  • CI on this tip: all checks pass (tests-ok, Node 24 · DSH 0.2.0-rc.2, plugins social/timeline/tree, package, risk tier, reviewed tip); mergeable MERGEABLE, mergeStateStatus CLEAN
  • re-read the diff against main at this tip: changelog.d fragment kept, no CHANGELOG.md or ds-bot/ edits, owner design rules kept (approvals only via UI buttons, English UI, no separate Friends' Bots section, no turn limit or Extend in friend chats, connector tokens only at /mcp)
    Not run:
  • live Mac instances / production Bot Social

# Conflicts:
#	core/src/client/header.js
#	patches/ds-bot/0008-client-bundle.patch
#	patches/ds-bot/0012-room-membership.patch
@Birfy

Birfy commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator Author

Self-review (review-pr, Birfy reviewer agent, 2026-10-20 20:10 Asia/Shanghai): PASS

Tip SHA: ae721f7
Ran:

  • git merge origin/main (107aa82, after Timeline: an on-demand export endpoint #524, Polish invites and friend chats: friend Bot placeholder, one invite control, Add friend auto-close, Sharing hint #504, Show a tree coordinator its children's runtime load #508, Add an opt-in state journal and a dev replay script #527) into the branch, no rebase or force-push → pass; real conflict only in core/src/client/header.js imports (kept this PR's friendBotTitle and main's holdComposerLabel), generated patches 0008/0012 conflicts not hand-merged
  • git checkout origin/main -- patches/ds-bot; (cd core && npm run build); node scripts/ds-bot-patches.mjs generate; node scripts/ds-bot-patches.mjs check → pass (10 patches apply cleanly; core/ = ds-bot/ + patches)
  • ARCH_DOCS_BASE=origin/main TZ=UTC npm run verify (core lint + arch-docs OK, plugin lint, build-client --check, ds-bot-patches check, all suites) → pass, 0 failures (core 1110, social 313, tree 83, timeline 93, .github scripts 93, interop 37, live-e2e 16)
  • CI at this tip → all checks pass (tests-ok, ubuntu-latest · Node 24 · DSH 0.2.0-rc.2, plugins social/timeline/tree, package, risk tier, reviewed tip); MERGEABLE / CLEAN
  • re-read the diff vs main at this tip → one changelog.d fragment (498-friend-bot-name.fixed.md), no CHANGELOG.md or ds-bot/ edits, subsystem docs updated, peer names still pass cleanPeerName
    Not run:
  • smoke test — the diff vs main touches no core/index.js or core/src/host/
  • Desktop / live instances / production Bot Social
    Verdict: PASS

Findings: no actionable findings. Not merge authority: T3 still needs the maintainer's approval (owner queues it).

@Birfy
Birfy added this pull request to the merge queue Oct 20, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 20, 2026
# Conflicts:
#	patches/ds-bot/0008-client-bundle.patch
@Birfy

Birfy commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator Author

Self-review (review-pr, Birfy reviewer agent, 2026-10-20 20:26 Asia/Shanghai): PASS

Tip SHA: e819c90
Ran:

  • git merge origin/main (b6e89d2, after Show each scheduled task's last run, and Retry a failed one #494) into the branch on top of ae721f7, no rebase or force-push → pass; the only conflict was the generated patches/ds-bot/0008-client-bundle.patch, which was regenerated, not hand-merged
  • git checkout origin/main -- patches/ds-bot; (cd core && npm run build); node scripts/ds-bot-patches.mjs generate; node scripts/ds-bot-patches.mjs check → pass (10 patches apply cleanly; core/ = ds-bot/ + patches)
  • ARCH_DOCS_BASE=origin/main TZ=UTC npm run verify → pass, 0 failures (core 1114, social 313, tree 83, timeline 93, .github scripts 93, interop 37, live-e2e 16); arch-docs OK; lint warnings the same as main (81)
  • CI at this tip → all checks pass (tests-ok, ubuntu-latest · Node 24 · DSH 0.2.0-rc.2, plugins social/timeline/tree, package, risk tier, reviewed tip); MERGEABLE / CLEAN
  • re-read the diff vs main → one changelog.d fragment (498-friend-bot-name.fixed.md), no CHANGELOG.md or ds-bot/ edits, subsystem docs updated, peer names still go through cleanPeerName
    Not run:
  • smoke test — the diff vs main touches no core/index.js or core/src/host/
  • Desktop / live instances / production Bot Social
    Verdict: PASS

Findings: no actionable findings. This replaces the PASS at ae721f7, which is void because the tip moved. Not merge authority: T3 still needs the maintainer's approval (owner queues it). #541 (#526) is stacked on this branch.

@Birfy
Birfy added this pull request to the merge queue Oct 20, 2026
Merged via the queue into ThinkFlowLab:main with commit cf61952 Oct 20, 2026
8 checks passed
@Birfy
Birfy deleted the fix/498-friend-bot-name branch October 20, 2026 12:32
Birfy added a commit to Birfy/FlyBot that referenced this pull request Oct 20, 2026
…owLab#544)

Fixes ThinkFlowLab#540

Tool approval cards had only Reject / Allow once, and DSH's approval
outcomes are one-shot (`ApprovalOutcome` = `allowed-once | rejected |
cancelled | unavailable`, `ApprovalPolicy` = `ask | never` in
`@deepseek-ai/dsh-user-approval` 0.2.0-rc.2), so a Bot asked for the
same sandbox escalation every time. Owner decision 2026-10-20 20:11 /
20:12 (Asia/Shanghai): permanent approval, per Bot and per group.

**What changes**
- Cards (`core/src/client/member-status.js` `ApprovalCard`,
`core/src/client/inbox.js` `InboxCard`) add **Always allow for this
Bot** (`此 Bot 始终允许`) and, for an ask from a group, **Always allow for
this group** (`本群始终允许`). Never on a friend's Bot.
- Host (`core/src/host/approvals.js`): permission kind = tool + sandbox
mode parsed from DSH's reason (`bash:escalate:danger-full-access`).
`approval-answer` takes `always-bot` / `always-room`; the grant is kept
on the Bot / room record (`standingApprovals`, in `state.json`), and
this ask plus other waiting asks it covers are answered `allowed-once`.
FlyBot's `approval/request` listener (documented waterfall, no DSH
patch) answers later matching asks itself, **only for a turn the owner
started** (`turn-origin.js` `settled() === 'owner'`; friends' messages,
other members' lines, rooms with other people and verdict-less turns
still ask). A Bot grant covers the Bot's Sessions; a group grant covers
the owner's Bots working in that group (not their own chats). DSH's
audit pair still logs each ask.
- Revoke: **Always allowed** card with Remove in Bot settings and Group
settings (`core/src/client/standing-approvals.js`, endpoint
`standing-approval-remove`).
- Authz (`core/src/host/authz.js`): an `always-*` answer needs the Bot's
owner (owning the room is enough only for Allow once); removing a group
grant needs the member who gave it, and removes only theirs.
- Docs: core-host "Standing tool approvals (ThinkFlowLab#540)", core-client row.
Changelog fragment `540-always-allow-approval.added.md`.

Risk tier: **T3** (risk-gate: `core/src/host/approvals.js`, `authz.js`,
`channel.js`). Waits for the maintainer's approval; not merged by the
agent.

**Verification** (tip `f7e6a7e789005365befd6bb44d55f88d5871607a` =
b6236f8 merged with main at cf61952, Node 24.21)
- `ARCH_DOCS_BASE=upstream/main TZ=UTC npm run verify`: exit 0; core
1122/1122, plugins 313, 83, 93, 93, 37, 16 all pass; arch-docs OK (31
files); no new lint warnings.
- Red at base (worktree at b6e89d2 + only the test files copied): 7
new/changed tests fail; green at tip.
- Smoke (`CONTEXT_WINDOW=100000 CHECK_RATIO=0.45 dev/bench.sh smoke 3196
8896 reset && node dev/smoke.mjs smoke 3196`, DSH 0.2.0-rc.2): 42/42 at
`b6236f8`; the merge to `f7e6a7e` changes only client files from ThinkFlowLab#502,
`core/src/host` and `core/index.js` are identical.
- An earlier verify run hit `tasks.test.js` "an untagged hold stamps the
latest working task…" (also 1 of 6 isolated runs at this branch); that
test and its code are untouched here: a pre-existing flake.

**Not run**
- Smoke at the merge tip `f7e6a7e` (host unchanged since the smoked
tip).
- A live run in the owner's FlyBot with a real `bash` escalation
(covered by unit tests with DSH's `escalate sandbox to <mode>: …` reason
format).

---------

Co-authored-by: Birfy <15378933+Birfy@users.noreply.github.com>
HugoXK pushed a commit to HugoXK/FlyBot that referenced this pull request Oct 21, 2026
…owLab#541)

Fixes ThinkFlowLab#526

ThinkFlowLab#502 (the shared friend's Bot formatter this builds on) is on main
(cf61952); this PR now carries only the ThinkFlowLab#526 change.

In a group chat or face-to-face room a friend's Bot read `Reviewer ·
FlyBot 682b8a43 (flybot682b8a43)`. Two things caused it. Bot Social's
member label (`<Bot> · <owner>`, `face-rooms.ts` `memberLabel`) ended up
as the Bot's name, so `remoteBotTitle` then added the owner a second
time from the handle (`core/src/client/cells.js` `remoteSpeaker`
fallback, from the `senderName` that `plugins/social/src/face-rooms.js`
`trustedFaceWho` sets). And an owner who never set a name shows as the
made-up `FlyBot <install id>`. Owner decision (2026-10-20, option a):
use the ThinkFlowLab#498 person-first name, Bot name plus owner username: `Reviewer
(flybot682b8a43)`.

- `core/src/shared/remote-label.js`: `remoteBotName` removes a trailing
` · <owner>` only when it matches that Bot's owner. `ownerNameOf` skips
an id-derived owner (`isAutoOwnerName`: `FlyBot` + hex id that contains
a digit) and uses the username from the home handle instead. If no
handle is known, the made-up name stays. `seatOwnerName` applies the
same rule to my own seat (`face-seats.js`, `at-menu.js`).
- `plugins/social/src/face-rooms.js`: `faceOwnerName` applies the same
rule to seats (`viewFaceMember.ownerName`), join, leave and room-lead
lines, and a person's typed line.
- The full handle stays on hover. The remote Bot names in
`FacePersonRow` and the group Members rows (`group-settings.js`,
`details-drawer.js`) now get `title=<handle>`, as bubble headers already
had.
- Real names are unchanged: `Coder (Bob)`, `Ops · Night (Bob)`,
`FlyBot`, `FlyBot2`.

Risk tier: T3 (`node .github/scripts/risk-gate.mjs --pr 541`:
display-name and remote-label paths, plugins/social/src/face-rooms.js).
Needs the maintainer's approval and a PASS at the tip.

Verification at 01c24e4 (main cf61952
merged in):
- `ARCH_DOCS_BASE=origin/main TZ=UTC npm run verify` → pass. core 1117,
social 314, tree 83, timeline 93, .github scripts 93, interop 37,
live-e2e 16; 0 failures. arch-docs OK; no new lint warnings (same count
as before the merge).
- Red at base (main cf61952, with only the new test files copied in):
`core/test/group-bot-label.test.js` 0/3 pass (`actual: 'Reviewer ·
FlyBot 682b8a43 (flybot682b8a43)'`, `'Reviewer (FlyBot 682b8a43)'`). At
base the new social assertions fail on the missing `faceOwnerName`
export. Green at the tip.
- `(cd core && npm run build)`, `node scripts/ds-bot-patches.mjs
generate` and `check` → ok.

Not run:
- Smoke test: nothing under `core/index.js` or `core/src/host/` changed.
The host reads `shared/remote-label.js` for room labels; unit tests
cover that, including `presentRoom`.
- Desktop, live instances, production Bot Social.

---------

Co-authored-by: Birfy <15378933+Birfy@users.noreply.github.com>
@Birfy Birfy removed awaiting-approval PR is green and waits for the maintainer's approval (T2/T3) or a review PASS at its tip agent-pr Pull request opened by an agent labels Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:social Friends, invites, grants, Bot Social area:ui Web/desktop UI and copy bug Something isn't working risk:T3 Risk tier T3 (needs a human approval), set by the controller from the diff self-test Filed by the product self-test routine (issues only)

Projects

None yet

1 participant