Skip to content

A read-only window's composer still writes: Send to a Bot, and a multi-pick Send creates a room - #2501

Merged
Birfy merged 1 commit into
ThinkFlowLab:mainfrom
HugoXK:dev/2-newchat-send-readonly
Nov 5, 2026
Merged

Birfy merged 1 commit into
ThinkFlowLab:mainfrom
HugoXK:dev/2-newchat-send-readonly

Conversation

@HugoXK

@HugoXK HugoXK commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #2499

Owner: Dev-2
Reviewer: Birfy
Written-by: FlyBot Dev-2
Claim-Id: 6d33e6a7139c42a98d694733c9a2bbc4
Risk tier: T1

What changes

In a window that holds the team read-only, the new-chat composer no longer reaches the host with a write. sendMessage (new-chat.js) returns before send (one pick) and before create-room + send (several picks, no admin), so neither the Send button nor Enter writes; openBot keeps the session open — a read — and drops the set-flags unhide and the typed line, so pressing a picker row writes nothing. The composer puts the host's own sentence (hostText(roster.readOnly), .bt-hint.bt-read-only, role="status") where the Send button was, drawn once: when the group form already shows that line for its own Create, the composer does not repeat it. The pickers stay a preview, and a writable window sends exactly as before.

openBot's send path is included because the issue's acceptance asks for it ("openBot's send path is covered by the same lock; opening a session may stay possible (it is a read)"). The group-creation paths from #2496, service.js and core/src/host/** are untouched.

Red first

core/test/composer-send-readonly.test.js (new, 223 lines), committed alone at 9872270ff on the clean base 7f724a07:

not ok 1 - a read-only window sends nothing when one Bot is picked and Send is pressed
    no write action reaches the host
  + 0: 'send', 'scout', 'hello there'
not ok 2 - a read-only window creates no room when several Bots are picked and Enter is pressed
    no create-room and no send
  + 0: 'create-room', ['scout', 'third']; 1: 'send', 'r-new', 'hello there'
not ok 3 - a read-only window sends nothing when a picker row is pressed with a line typed
    the picker row writes nothing
  + 0: 'send', 'chief', 'hello there'
ok 4 - a writable window still sends once from the composer
# tests 4
# pass 1
# fail 3

Case 4 is the control: the writable window sends once, then opens the session; several picks make the room and then send the line. After the fix the same file is 4/4.

What I ran at 240f0154 (TZ=UTC, clean tree, tree 363abfa443)

  • npm run build (core) then node scripts/ds-bot-patches.mjs generate — a second generate left git status --porcelain empty.
  • node scripts/ds-bot-patches.mjs check — ok ds-bot/ = Fei2411/DeepSeek-Bot@2b10c70, ok 10 patches apply cleanly in order, ok core/ equals ds-bot/ + patches/ds-bot/.
  • TZ=UTC ARCH_DOCS_BASE=7f724a07c97955f893963cd1fa329c9c4c97f3fd npm run verify — exit 0. Segment counts, each # fail 0: core 2910 passed, plugins/social 577, plugins/tree 137, plugins/timeline 141, plugins/workflow 440, .github/scripts + policy 671, test:interop 37, test:live-e2e 26 — 4939 tests, 0 failed. Lint: 0 errors (warnings only, none in the files this PR touches); build-client.mjs --check and ds-bot-patches check/canonical green in the same run.

What I did not run

  • The host smoke test and a live service on port 8787 — this change is client-only (core/src/client/**), no host code.

Files

8 files, +2986/−2466 (git diff --numstat 7f724a07...240f0154), tree 363abfa443:

  • core/src/client/new-chat.js (+11/−5) — the send path and the composer's read-only line, hand-written.
  • core/test/composer-send-readonly.test.js (+223) — new, hand-written.
  • docs/subsystems/core-client.md (+1) — the bullet after Settings and the New… menu still offer group creation in a read-only window #2496's.
  • changelog.d/2499-composer-send-readonly.fixed.md (+1) — new fragment.
  • core/client.js (+6/−3), patches/ds-bot/0003-flybot-api-client.patch (+33/−3), patches/ds-bot/0008-client-bundle.patch (+2488/−2455), patches/ds-bot/files/test/composer-send-readonly.test.js (+223) — generated by build + generate, never hand-edited. patches/ds-bot/0012-room-membership.patch does not change: this file's mirror lands in 0008.
{
  "pr": 2501,
  "claim": "Dev-2",
  "issue": 2499,
  "summary": "In a read-only window the new-chat composer no longer writes: sendMessage returns before send and create-room, openBot keeps the session open but drops the unhide and the typed line, and the composer draws the host's own sentence where the Send button was, once. The pickers stay a preview and a writable window sends exactly as before.",
  "files": [
    "core/src/client/new-chat.js",
    "core/test/composer-send-readonly.test.js",
    "docs/subsystems/core-client.md",
    "changelog.d/2499-composer-send-readonly.fixed.md"
  ],
  "checks": { "ran": "TZ=UTC ARCH_DOCS_BASE=7f724a07 npm run verify (plus npm run build and ds-bot-patches generate/check)", "result": "green", "at": "240f015465478008da1cfed2fc4e0d6c29d7f3a5" },
  "next": "none — ready for review"
}

Pressing Send in a locked window reached the host with `send` (one pick) or
`create-room` + `send` (several), and pressing a picker row with a line typed
sent it — each answered `bot/read-only` only after the write. The composer now
draws the host's own sentence where the Send button was, and both paths return
before the write; opening a session stays a read.
@HugoXK
HugoXK marked this pull request as draft November 5, 2026 04:40
@HugoXK
HugoXK marked this pull request as ready for review November 5, 2026 04:53
@HugoXK

HugoXK commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

Queue request — please take this tip to the merge queue.

  • Head 240f015465478008da1cfed2fc4e0d6c29d7f3a5, base 7f724a07c97955f893963cd1fa329c9c4c97f3fd, Fixes #2499.
  • enqueue-guard on this tip: enqueue #2501: no "…" and the gate passes — decision enqueue A read-only window's composer still writes: Send to a Bot, and a multi-pick Send creates a room #2501, and it records no PASS needed: computed tier T1.
  • Tip state: non-draft, mergeable: true / clean, maintainer_can_modify: true, 18 check runs = 18 success + 0 cancelled, 0 failure.
  • tests-ok is green on this exact tip.
  • FlyBot Test's independent advisory is PASS at the same tip (240f0154): verify 4939 passed / 0 failed, red-first 4/1/3 on base 7f724a07, and each of the three write entries reddens alone when its own half is reverted. Advisory only, as usual for T1.
  • FlyBot Dev-2 is standing by and will not push a new tip; the branch is dev/2-newchat-send-readonly in HugoXK/FlyBot.

@Birfy
Birfy added this pull request to the merge queue Nov 5, 2026
Merged via the queue into ThinkFlowLab:main with commit 00b2fb0 Nov 5, 2026
19 checks passed
@Birfy
Birfy deleted the dev/2-newchat-send-readonly branch November 5, 2026 05:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A read-only window's composer still writes: Send to a Bot, and a multi-pick Send creates a room

2 participants