Skip to content

feat(members): steer-only composer for Crew Members DM threads - #8852

Merged
CrysisDeu merged 1 commit into
mainfrom
feat/members-chat-steer-only
Sep 10, 2026
Merged

CrysisDeu merged 1 commit into
mainfrom
feat/members-chat-steer-only

Conversation

@CrysisDeu

@CrysisDeu CrysisDeu commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The Crew Members page's DM composer has no queue concept anymore. While a member is working, a send goes straight into its running turn as a steer: the composer keeps the plain Send button — no Steer/Queue split, no Queue option, no queue stack — and a confirmed steer renders as an ordinary message (no "Steered into the running turn" badge). The main chat (ChatPage) is untouched and keeps its Steer/Queue split button.

Includes #8942 (merged into this branch): the draft/recovery hardening that review surfaced here (per-slot draft parking on member switch/unmount, routing late send/upload results to the slot they belong to, upload-failure attribution through the ErrorNotice banner, demoted-steer queue binding, unconfirmed-receipt restore for busy sends) was reviewed on its own stacked PR and now rides in this single commit — see Draft / recovery hardening below.

Declared side change — split view (⌘D): ChatPane previously passed no steer path to ChatInput, so a busy split-view pane showed the warn-coloured queue-only button. Wiring the steer path is a ChatPane change, and split view is ChatPane's other host, so it now shows the same Steer/Queue split button as the main chat (Enter = Steer by default, per-slot preference honoured). Deliberate: split-view panes are the main chat's own sessions side by side. Pinned by its own test and frames.

Why

User's product call (session 576 diagnosis):

crew member page 应该是 steer by default,和一个人聊天是没有 queue 这个概念的,发出去一并处理。

A member DM is a conversation with one named member — the chat projection of a crew member (#8614) — not an operator console. Talking to a person has no "queue this and wait until they finish, then they'll listen" step, so offering that choice inside a DM presents console mechanics in a chat. This PR is the "chat, not console" consistency close-out for Crew DM.

Diagnosis (confirmed in code): MembersPage mounts ChatPane; ChatPane mounted ChatInput with only onSend/onStop and no canSteer/onSteer, so ChatInput fell through to the queue-only button. chatSlice already reconciles a slot-scoped optimistic steer bubble by sendId, so no backend or store change is needed.

What changed

  • ChatInput — new busyMode?: 'split' | 'steer-only' (default 'split'). steer-only while busy: the idle Send button stays in place (aria-label "Send", accent, ↑), click/Enter = onSteer, and the persisted per-slot Queue preference is not consulted (no Queue to have picked). Without a steer path it still degrades to the queue button, like split mode. Stop states keep their precedence.
  • ChatPane — wires the steer path through the chat-core transport: sendTurn({ steer: true, meta: { sendId } }) with the same optimistic-bubble + receipt policy as ChatPage's steerMutation (refused/transport-error → drop bubble, error row, restore; response-late → drop + restore + warn notice unless the echo already reconciled; steered → echo owns the row; demoted → resolveOptimisticSteer). Attachments ride inlined via prepareSendPayload (steer channel is text-only, as ChatPage). A pane busy only because sub-agents run sends with the steer flag (doSend(…, steerNow)), same rule as ChatPage. Passes canSteer/onSteer/busyMode to ChatInput; busyMode is a pass-through prop, default 'split', decided by the host.
  • MembersPage — mounts ChatPane with busyMode="steer-only".
  • Steer badge — transcriptRenderers gains hideSteerBadge (a same-id user entry over the SDK row, drawn by the same ChatPageMessageContent.renderUserContent — paste chips, inline images, file cards — one prop different); ChatPane sets it from busyMode === 'steer-only'; UserMessage.hideSteerBadge skips the badge/tint/entrance ring and (after rebasing over fix(dashboard): give pending and requeued steers their own treatment #9037's pending/requeued treatments) the muted "Steering…" pulse and the "turn ended before this applied" note — all three are the steer/queue vocabulary this surface exists to hide. Default surfaces are unchanged. No other surface changes.
  • Refused send copy — the server's reason is framed instead of shown bare: "Couldn't send this message: {{error}}. Your text is back in the composer." New key pages.chatPage.send_failed_with_error_restored in en.manual.json + 11 locales (line-anchored, each locale's punctuation) + en-XA regenerated. The shared delivery_unconfirmed notice now says "check the conversation above" (English only; the other locales already said "conversation").
  • Dead key — pages.chatPage.dismiss_upload_error lost its last reference when main moved the pane's upload banner to ErrorNotice; removed from all locales + en-XA so the dead-key ratchet stays at baseline.
  • QueueStack in steer-only: rendered on server state only — a steer-only host never asks for a queue, but a message the server did park stays visible and cancellable.
  • No ChatPage.tsx changes.
  • Capture harness DRY — scripts/lib/members-fixtures.mjs now exports routeMembersApi(page, slotDetail, { members }), the gateway-free Members-page API stub; capture-members-steer-only.mjs and main's capture-members-selection-quote-ask.mjs (which had copied the same route block) both use it, clearing the jscpd clone the merge ref reported.
  • ChatPane.selectionActions.test.tsx (main's) gains the __resetPaneDraftsForTests() beforeEach the other ChatPane suites use: every case mounts the same slot, and the pane now parks its composer on unmount, so one case's Quote text rode into the next.

Draft / recovery hardening (from #8942)

ChatPane's composer is pane-local state, while its host can rebind the same instance to another slot (Members switches slotKey on member click, no key) or unmount it with sends and uploads in flight. Anything that resolves late — a refused or unconfirmed send, a finished or failed upload, a steer the server demoted to the queue — used to land on whatever was on screen, or nowhere. Every late result is now routed to the slot it belongs to: its live composer, its parked draft, or its transcript.

  • utils/chatPaneDrafts.ts (new) — the pane's per-slot draft store (createSlotDraftStore on pane-owned sessionStorage keys mc-pane-drafts / mc-pane-file-drafts, 256 KiB cap, write-through in-memory mirror so a refused persist still hands the draft back for the tab's life). takePaneDraft (read + clear) and subscribePaneDraft let the pane showing a slot own the one live copy and receive late arrivals.
  • Attachments on a steer — doSteer carries the ordered non-image file list on the optimistic bubble's and the POST's meta.files (the [attached_file N] index the transcript chip resolves through; the echo merges meta onto the bubble), so a filename containing spaces renders as a whole chip instead of the renderer's whitespace-bounded fallback. Pinned in ChatPane.steerOnly.test.tsx.
  • Attachments on a steer-flagged send — main now inlines every pane send's attachments via prepareSendPayload ([insider regression] Crew Members DM does not render attached images in the transcript #9433) and carries meta.files through the busy-slot queue (fix(chat): carry attachment lists through the busy-slot queue #9486), so the sub-agents-only busy path (doSend(…, steerNow)) gets the same wire shape as doSteer and ChatPage for free; this PR only pins it for the steer-flagged path (test below) and keeps the raw file list as the restore / cancel-stash payload.
  • ChatPane — parks the outgoing slot's composer on rebind and unmount (in a layout effect, so slotKeyRef and the park/take move in the same commit as the slotKey prop — a refusal resolving between commit and a passive effect would otherwise restore into the old slot's ref and be overwritten), takes the incoming slot's parked draft, subscribes to late arrivals; restoreIntoComposer(text, files, forSlot) merges a recovery for an off-screen slot into that slot's parked draft; a busy send with no optimistic bubble whose receipt never arrives restores the draft with the delivery-unconfirmed notice (only an echo carrying the send's own sendId counts as delivered); uploads carry their originating slot — paths stage into that slot's live or parked composer, a failure shows as an ErrorNotice banner while that slot is on screen and otherwise lands in that slot's transcript as an error row; a demoted steer binds { raw, files, sent } to its queue_id in queuedSendStash so cancelling the card restores text and re-stages files.

Tests (run in CI)

  • src/test/ChatInput.test.tsx — busyMode="steer-only" block: plain send button, no split/caret/Queue/Send-options; click and Enter call onSteer not onSend; persisted Queue preference ignored; soft_pending still falls back to onSend; idle sends normally; no steer path → queue button; default busyMode is the split button.
  • src/test/ChatPane.steerOnly.test.tsx (new) — busy DM: steer-only-send present, no split/queue, Enter calls sendChat(…, steer=true) with { sendId }, slot-scoped { steer, optimistic } bubble, no queue card, composer cleared; idle DM sends with no steer flag; default pane (split view) keeps the Steer/Queue split and its Steer fires the same steer flag; refused steer drops the bubble, appends the framed error row, restores the text; a confirmed steer shows no badge in steer-only and keeps the badge in the default mode.
  • src/pages/members/MembersPage.test.tsx — the ChatPane stub echoes busyMode; the thread test asserts steer-only.
  • src/test/ChatPane.dirSend.test.tsx — two assertions updated to the framed refusal copy.
  • src/test/ChatPane.draftRecovery.test.tsx (new, 12 cases) + src/test/chatPaneDrafts.test.ts (new, 4 cases) — sub-agents-only busy + response-late restores and warns; sub-agents-only busy + attachment inlines [attached_file 1] path into the steer-flagged wire text and stashes the raw file for cancel-restore; an identical queue card does not stand in for the unconfirmed send; a demoted steer binds pre-send state to its queue card; rebinding parks the draft; a refusal after a member switch restores into the SENDING member; late upload success/failure after a switch lands on the member it was picked in; on-screen failure renders through ErrorNotice and is dismissible; refusal after close + reopen reaches the new pane; upload failure after unmount lands in the transcript; park/take, sessionStorage not localStorage, mirror survives a refused write, subscriber scoping.

Local gates: tsc -b, eslint, i18n-check, jscpd clean.

Screenshots

Capture harness: website/scripts/capture-members-steer-only.mjs (asserts each frame's state before writing; --expect=before photographs the base commit). Entries capture/members-page.tsx (?busy=1, runtime frame hooks) and capture/chatpage-scroll-shell.tsx (?scene=busy) gained the busy scenes.

Members DM, radar working — before (queue-only button) after (plain Send, steers)
before after
Split view (⌘D) pane — NEW: Steer/Queue split button (was queue-only) ChatPage — unchanged split button
split view ChatPage

After pressing Send while the member is working:

Optimistic bubble, composer cleared Server steer echo confirmed — plain message, no badge
post-send confirmed

Steer failure states:

Refused steer (409) — framed error row, draft restored, bubble withdrawn Receipt never arrived — delivery-unconfirmed notice, draft restored
refused unconfirmed

Server-parked message on the steer-only surface — queue card still shown and cancellable:

queue card

Draft / recovery frames (from #8942):

Refused upload while the member is on screen — ErrorNotice banner, draft intact Same refusal landing after switching to another member — no banner over fixer; error row in radar's transcript on return
banner transcript row

Per-member draft parking (webm): 12-member-switch-draft-parking.webm — type for radar, switch to fixer (empty composer), type for fixer, back to radar (radar's text is back).

Recordings of the composer's idle → busy transition (webm; the capture container has no full ffmpeg, so no GIF — the script prints the ffmpeg command, per the repo's other recording scripts):

Out of scope / follow-ups

  • Pre-existing (main, doSend and ChatPage send): queuedSendStash is bound after the HTTP receipt, so a queue_push that arrives first exposes a cancel that restores text without attachments. Closing it needs queue_push to carry the send's sendId (backend).
  • Server refusal reasons ("slot agent mismatch") are backend-owned strings; making them plain language is a backend copy task.
  • ChatPage's two refusal sites keep send_failed_with_error: they restore into the slot's draft store, so the pane's "back in the composer" sentence would be false after a session switch; own wording under the P5 pass.
  • doSteer and ChatPage.steerMutation are two copies of one receipt policy; folding them into a chat-core helper is a P5-adjacent refactor with the ChatPage side of the edit.

@CrysisDeu
CrysisDeu requested review from a team and patrigao September 6, 2026 00:43
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Sep 6, 2026
@github-actions

github-actions Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Fable 5) — ✅ PASS

Design-level review of 19101643784069edc613917ceb1f38102db5042e — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

A real product call (DM ≠ console), solved at the right seams — host-decided prop, shared chat-core transport, failure paths routed to the owning slot.

[DESIGN-REVIEWED] 1910164

@github-actions

github-actions Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5) — 🟡 CONCERNS

Premise-level review of 19101643784069edc613917ceb1f38102db5042e — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

All verification is done. The change inventory checks out: temp-screenshots/ is a documented convention (README requires committed review media), the draft-hardening rides in with provenance (#8942, plus tests that fail on base), chatPaneDrafts reuses the existing createSlotDraftStore mechanism with a stated reason for its own keys, and the dead-key removal is ratchet maintenance. Two things survived the kill-filter: the split-view rider's justification is the symmetry form the contract forbids, and busyMode is a two-variant enum with exactly one explicitly constructed variant.

First-Principles-Verdict: CONCERNS

The split-view steer button rides in on "panes are the main chat's sessions side by side" — symmetry, with no named person who needed it.

Not justified as shipped

  • Item 3 — rides along, symmetry-form justification: "split-view panes are the main chat's own sessions side by side" argues from the twin; nobody is named as failing to steer from a busy split pane. The steer wiring for steer-only would work gated to that host.

What this change ships

Inventory (10 items) — 9 justified

Intent: make messaging a working crew member behave like a chat with a person — a send goes into their running turn, with no queue mechanics. ADDITION (a capability the pane never had), with declared riders. More than 10 items exist (QueueStack server-state rule, steerNow flag, capture busy scenes, test isolation); the 10 most user-visible are kept.

  1. Members DM while busy: plain Send button, send steers into the running turn — justified
  2. Confirmed steer in a DM shows as an ordinary message (no badge, pulse, or requeued note) — justified
  3. Split view (⌘D) busy panes gain the Steer/Queue split button (was queue-only) — rides along, symmetry-justified only
  4. Switching members parks and restores each member's typed draft and attachments — rides along
  5. A late refusal/upload result lands on the member it belongs to, not whoever is on screen — rides along
  6. Refused sends say what happened and that the text is back (new key, 12 locales) — rides along
  7. "Delivery not confirmed" now says "conversation above" instead of "transcript" (English) — justified
  8. Dead locale key dismiss_upload_error removed everywhere — justified
  9. A message the server itself parked still shows a cancellable queue card on the DM — justified
  10. New capture harness + shared routeMembersApi fixture replacing a copied route block — justified

Watch

  • Item 3's only stated ground is the twin ("same Steer/Queue split button as the main chat"). The capability gap is real but unreported; if unjustified it is reversible by passing canSteer only from steer-only hosts.
    Clears when: a report or observed user needing steer from a split pane is named, or the wiring is gated to the Members host.

Subtractions

  • Replace the busyMode?: 'split' | 'steer-only' enum and the exported ComposerBusyMode type with steerOnly?: boolean — one variant is ever explicitly constructed (1 consumer: website/src/pages/members/MembersPage.tsx:1487; grep busyMode= over website/src, tests excluded).

[FIRST-PRINCIPLES-REVIEWED] 1910164

@github-actions

github-actions Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — ✅ no blocking findings

GPT 5.6 completed its review of 19101643784069edc613917ceb1f38102db5042e and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 1910164

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 19101643784069edc613917ceb1f38102db5042e: <one-sentence reason>

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 6, 2026
@github-actions

github-actions Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

Opus 4.8 Review — ✅ no blocking findings

Reviewed 19101643784069edc613917ceb1f38102db5042e — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 1910164

Verdict parsed from the review's SHA-scoped output markers for commit 19101643784069edc613917ceb1f38102db5042e.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 19101643784069edc613917ceb1f38102db5042e: <one-sentence reason>

@github-actions

github-actions Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Fable 5) — ✅ PASS

UX-level review of 19101643784069edc613917ceb1f38102db5042e — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

UX-Verdict: PASS

The busy DM composer reads as a plain, trusted Send — the blind reader used it "sure", every state is screenshotted, and both transitions ship recordings proving the button never swaps.

[UX-REVIEWED] 1910164

@CrysisDeu
CrysisDeu force-pushed the feat/members-chat-steer-only branch from e7bb0cc to 5755ddb Compare September 6, 2026 01:41
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Sep 6, 2026
@CrysisDeu

Copy link
Copy Markdown
Contributor Author

Round 2 — head 5755ddb2712a8ea08dfa8849734fae358ce11d8c. Dispositions per lane:

GPT 5.6 (BLOCKING, ChatPane.tsx:604 — sub-agents-only steer + response-late loses the draft) — fixed. doSend now tracks whether an optimistic bubble was minted; on response-late with no bubble and no echo yet (user row by sendId, queue card by wire text) it restores the text + files and appends the delivery-unconfirmed notice. Applies to the steer-flag path that was flagged and to the plain queued path, which had the same gap. Pinned by the new "sub-agents-only busy … response-late" test.

Frontend Lint (jscpd) — fixed. The roster fixture the two Members capture scripts shared is now one module, scripts/lib/members-fixtures.mjs.

UX Review (CONCERNS)

  • "Steered into the running turn" badge on every busy DM send — implemented in this PR: transcriptRenderers.hideSteerBadge (same-id user entry, same content renderer) wired from busyMode === 'steer-only'; UserMessage.hideSteerBadge skips badge, tint and entrance ring. Default mode keeps the badge (pinned both ways). Frame 04b shows the confirmed steer as a plain message.
  • Evidence gaps — added: post-send optimistic bubble (04), confirmed echo (04b), refused steer with restored draft (05), delivery-unconfirmed notice (06), and two recordings of the composer's idle→busy transition (07 Members: same Send element throughout; 08 split view: Send → Steer/Queue). The recordings are webm: the capture environment has no full ffmpeg (Playwright's bundled build has no GIF encoder), so the script follows the repo's other recording scripts and prints the exact ffmpeg command for a GIF.
  • Target glyph icon-only on the split button — no change. BusySendButton's fire half already carries title="Steer — act on this as soon as possible (Enter)" and aria-label="Steer"; the blind reader saw a static frame, where a tooltip cannot show. The split button is pre-existing ChatPage design now reaching a second host; changing its glyph or adding a text label is a BusySendButton decision for both hosts, out of this PR's scope.

First Principles (CONCERNS)

  • Split view silently gaining the split button — accepted and now declared in the PR body as its own item with its own justification (split-view panes are the main chat's sessions side by side; the queue-only button was the same missing-props defect the DM had). Frame 02's caption now reads "NEW", and the split-view test pins the new state explicitly rather than calling it unchanged.
  • "Drop the ComposerBusyMode enum, take steerOnly?: boolean" — kept as busyMode: 'split' | 'steer-only'. The prop names what the busy send does, and the two values are two nameable behaviours rather than a flag on one of them; a third mode (e.g. a queue-only host) would be a value, not a second boolean. This is also the shape the product owner asked for. One consumer today, but ChatPane reads it in two places (composer + transcript badge), so the name carries meaning beyond the single call site.

Design Review (PASS, suggestion) — hoisting doSteer's receipt ruling to share with ChatPage.steerMutation: agreed in principle, deferred. ChatPage.tsx is under active slimming (P5) and this PR was asked to leave it alone; a one-consumer helper would not remove the duplication. Filed in the PR body's follow-ups so the P5 pass picks it up with the ChatPage side of the edit.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: checking Automated validation is still running labels Sep 6, 2026
@CrysisDeu
CrysisDeu force-pushed the feat/members-chat-steer-only branch from 5755ddb to f03a44c Compare September 6, 2026 02:13
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Sep 6, 2026
@CrysisDeu

Copy link
Copy Markdown
Contributor Author

Round 3 — head f03a44c9543b87579cd336dd8c816054cfca7f9f.

GPT 5.6 (BLOCKING, ChatPane.tsx:553 — an older identical queue entry suppresses recovery) — fixed as suggested: doSend snapshots the slot's queue entries (by queueId, falling back to ts|content) before the POST, and on response-late a matching queue card counts as this send's echo only if it is new since the send. Pinned by the new test "an OLDER identical queue entry does not stand in for the unconfirmed send".

Frontend Lint (i18n strict, ChatInput.tsx 4 → 5) — fixed. The steer-only button's offline aria-label passed a literal 'Send' to offlineProps; it now passes i18nT('components.chatInput.send'). ChatInput's strict count is back to the base value.

UX Review (CONCERNS)

  • Raw server reason on a refused send — implemented: reportSendFailure frames it as "Couldn't send this message: {{error}}. Your text is back in the composer." (new key send_failed_with_error_restored, 13 locales + en-XA; the option-chip variant that does not restore keeps send_failed_with_error). Frame 05 recaptured.
  • Mid-transition red arrow in frame 05 — recaptured with a 400 ms settle after the error row lands; the control now reads as the purple Send it is.
  • Evidence gap, QueueStack on the steer-only surface — added frame 09: a server-parked message renders its queue card (cancellable) in the Members DM while the composer stays the plain Send.

First Principles — unchanged from the round-2 disposition: split-view change is declared as its own item; busyMode stays a named two-value prop (read in two places in ChatPane: composer + transcript badge) and is the shape the product owner asked for.

@CrysisDeu

Copy link
Copy Markdown
Contributor Author

CI did not schedule for head f03a44c (only the readiness/fork guards ran); closing and reopening to re-trigger the pull_request workflows.

@CrysisDeu CrysisDeu closed this Sep 6, 2026
@CrysisDeu CrysisDeu reopened this Sep 6, 2026
@CrysisDeu
CrysisDeu force-pushed the feat/members-chat-steer-only branch from f03a44c to 2905478 Compare September 6, 2026 02:41
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running labels Sep 6, 2026
@CrysisDeu
CrysisDeu force-pushed the feat/members-chat-steer-only branch from 2905478 to d1f5f9d Compare September 6, 2026 03:13
@bolichen97

Copy link
Copy Markdown
Contributor

@CrysisDeu This PR and #8947 are both yours and they collide, so the landing order matters. The audit read this branch at 0afdd12; the head has since moved to cfb189b, but the file list still contains the same three shared files, so the overlap below still holds.

Where it overlaps #8947:

The goals are independent (a steer-only busy composer here, Quote / Ask on selected text there) and neither PR implements any part of the other, so both should land.

Suggested order: take this one first, because it carries the bigger ChatPane.tsx rewrite, then rebase #8947 on top of it and add its prop to the already-updated mount line. Please note that #8613 is also yours and is a third claimant on that same MembersPage mount line and the same ChatPane props block, so it is worth choosing one order for all three rather than reconciling them pairwise. This PR needs a rebase onto main either way.

Posted from the 2026-09-08 open-PR relationship audit (read-only, one auditor per PR); reply here if any of this is wrong.

@CrysisDeu

Copy link
Copy Markdown
Contributor Author

Design Review "Watch" (steer receipt policy in three hand-synced copies) — tracked as #9457, which names all three sites (ChatPage.steerMutation, ChatPane.doSteer, ChatPane.doSend's steer-flagged branch), the rulings that must stay identical, and the proposed chat-core helper shape (adopt in ChatPane first, ChatPage under the P5 pass). Kept out of this PR so the product change stays reviewable on its own.

@bolichen97

Copy link
Copy Markdown
Contributor

Rebased onto main 1192049a by a maintainer as part of the 2026-09-08 open-PR audit. New head b4a9c294.

Conflicts: none, clean rebase (the branch was only 19 commits behind after your last update). No resolution decisions were made, so the diff is unchanged in intent: 46 files, +1783/-63.

Gates run locally: tsc --noEmit clean. vitest on the six test files this PR touches could not run in the audit sandbox because its shared node_modules is missing @excalidraw/excalidraw, which SketchDialog.tsx (main's file, untouched here) imports; that is an environment gap, not a finding. CI runs them.

Please review that the rebase result still matches your intent. A maintainer push makes the maintainer the last pusher, so under the repo's last-push rule a second approver is needed. Reply here if anything looks wrong.

@CrysisDeu

Copy link
Copy Markdown
Contributor Author

/ai-review override gpt b38cf75: On main the pane composer is component-local state, so collapsing split view lost the text outright; this PR parks it (sessionStorage + in-tab mirror, chatPaneDrafts.ts) and restores it verbatim when the pane remounts (ChatPane.tsx:177-179). Collapse shows an empty single-chat composer but nothing is lost within the tab. Unifying the pane and ChatPage draft stores is a ChatPage-side refactor, outside this PR's declared scope.

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Human judgment recorded

@CrysisDeu marked the gpt AI finding as false positive, not applicable, or explicitly accepted for b38cf7544f81511d642379f62c0de50229074998.

On main the pane composer is component-local state, so collapsing split view lost the text outright; this PR parks it (sessionStorage + in-tab mirror, chatPaneDrafts.ts) and restores it verbatim when the pane remounts (ChatPane.tsx:177-179). Collapse shows an empty single-chat composer but nothing is lost within the tab. Unifying the pane and ChatPage draft stores is a ChatPage-side refactor, outside this PR's declared scope.

This decision applies only to this commit. A new push requires a new judgment.

chenmingwei23
chenmingwei23 previously approved these changes Sep 9, 2026
@CrysisDeu

Copy link
Copy Markdown
Contributor Author

/ai-review override gpt 67198c7: The steer transport is text-only by design — ChatPage.steerMutation also POSTs meta { sendId } only (ChatPage.tsx:957, 5198-5200) and the backend persists no meta on a steer, so main's main-chat steers have this same residual today. The pane sends the SAME wire shape plus a client-side files index; the full path stays verbatim in the wire text and both cancel paths are guarded (fileTokens.ts:564-566). Persisting steer meta is a backend change outside this PR.

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Human judgment recorded

@CrysisDeu marked the gpt AI finding as false positive, not applicable, or explicitly accepted for 67198c72ad865fb899c283862d5336ad7aa679ca.

The steer transport is text-only by design — ChatPage.steerMutation also POSTs meta { sendId } only (ChatPage.tsx:957, 5198-5200) and the backend persists no meta on a steer, so main's main-chat steers have this same residual today. The pane sends the SAME wire shape plus a client-side files index; the full path stays verbatim in the wire text and both cancel paths are guarded (fileTokens.ts:564-566). Persisting steer meta is a backend change outside this PR.

This decision applies only to this commit. A new push requires a new judgment.

@CrysisDeu

Copy link
Copy Markdown
Contributor Author

/ai-review override gpt 6d867a0: StrictMode's setup→cleanup→setup replay is development-only; production builds never double-invoke effects. Even in dev nothing is lost: the first setup's functional setState (ChatPane.tsx:190-191) is queued before the replay and applies after it, so the parked text lands in the composer; the cleanup's write of empty refs only deletes a store entry the first setup had already taken. Verified against main.tsx:148 (StrictMode on) and the effect body.

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Human judgment recorded

@CrysisDeu marked the gpt AI finding as false positive, not applicable, or explicitly accepted for 6d867a099743b67d709365e5428d18b79fb21538.

StrictMode's setup→cleanup→setup replay is development-only; production builds never double-invoke effects. Even in dev nothing is lost: the first setup's functional setState (ChatPane.tsx:190-191) is queued before the replay and applies after it, so the parked text lands in the composer; the cleanup's write of empty refs only deletes a store entry the first setup had already taken. Verified against main.tsx:148 (StrictMode on) and the effect body.

This decision applies only to this commit. A new push requires a new judgment.

iamwhatever
iamwhatever previously approved these changes Sep 9, 2026

@bolichen97 bolichen97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First, the good news on the cross-PR question: this does not conflict with #9593. grep steerChat over the whole diff returns nothing — both steer paths already go through sendTurn({ … steer: true }) (ChatPane.tsx:788,857), which is the direction #9593 moves in, and the two file sets have zero overlap.

Second, the title oversells the restriction, and I mean that as reassurance rather than a complaint: with no turn in flight nothing is restricted at all. The entire steer-only block sits inside the isRunning || soft_pending || killing gate at ChatInput.tsx:4375, so an idle send renders the ordinary send button and fireComposer falls through to onSend() (ChatInput.tsx:1563,1586), starting a real turn. No disable, no error, no silent drop, no queue. "Steer-only" describes the busy affordance, not a composer that cannot start a turn.

The decision that belongs to you:

ChatPane.tsx:1335-1336 passes canSteer={busy} / onSteer={doSteer} unconditionally, so split-view (⌘D) panes flip from queue-only to the Steer/Queue split button — and since readBusySendMode defaults to 'steer' (BusySendButton.tsx:56,60), Enter-while-busy in a ⌘D pane now steers by default for every user who never explicitly chose Queue. That is a changed default on a second surface the title does not name, and First Principles made it their headline finding: "a changed default for existing users, justified only by symmetry with the main chat."

Three defects:

  1. ChatPane.tsx:164-165 — inputRef.current = input and pendingFilesRef.current = pendingFiles are assigned during render. A render React discards still mutates the ref, and the layout-effect cleanup at ChatPane.tsx:214 parks inputRef.current into the draft store, so under concurrent rendering it can park text that never committed. Low severity today since nothing puts this pane behind a transition or Suspense, but both refs are new here — this is a newly introduced pattern, not inherited.

  2. ChatInput.tsx:4462-4471 — the steerOnly disabled-send branch is unreachable from the only host that sets steer-only. It sits after onStop ? at 4458 and ChatPane.tsx always passes a truthy onStop, so a busy Members DM with an empty composer shows Stop, not a disabled Send. The comment's "same shape-stability rule" rationale does not apply to that host and the code never runs.

  3. chatPaneDrafts.ts:2467 (fileStore) is created with no maxEntries and no maxStoreBytes, while the sibling textStore sets both. Parked attachment paths accumulate in sessionStorage uncapped. Nit-level given paths are small and session-scoped, but asymmetric with the store it is paired to.

One thing a user is likely to notice that no test covers: hideSteerBadge removes the confirmed-steer badge, the "Steering…" pulse and the requeued note, and the button carries only aria-label="Send" with no title — so a landed steer is indistinguishable from an ordinary message, and the restriction is never explained on screen.

Two process notes for the owner rather than the author. The GPT 5.6 lane never ran on head 6d867a09 — you self-issued /ai-review override gpt at 14:07Z, so the only line-level correctness lane has no model verdict for the commit under review. I checked the override's reasoning and it is technically right (StrictMode's replay is dev-only, and in dev the first setup's functional setInput survives the cleanup), but an author-issued override on the lane that would have caught defect 1 is worth knowing about. Also: three advisory items on this head carry no ai-review-disposition comment at all — only prose "Round N" comments, the last from 2026-09-06 — and the branch is 1 ahead / 16 behind main with a head commit dated 2026-09-08, so CI's merge-ref result is three weeks of main out of date in commit terms.

A member DM is a conversation with one named member, not an operator
console. Talking to a person has no "queue this until they finish" step,
so while the member is working a send now goes straight into its running
turn: the composer keeps the plain Send button (no Steer/Queue split, no
queue stack) and a confirmed steer renders as an ordinary message (no
"Steered into the running turn" badge). The main chat keeps its split
button; split view (Cmd+D) gains it (it was queue-only, the same missing
props as the DM).

ChatInput gains `busyMode: 'split' | 'steer-only'` (default split).
steer-only renders the idle send button while busy and ignores the
persisted per-slot Queue preference, since there is no Queue to pick.
ChatPane wires the chat-core steer path (`sendTurn({ steer: true })`,
slot-scoped optimistic steer bubble, ChatPage's receipt policy) and
passes `canSteer`/`onSteer`/`busyMode` through; a sub-agents-only busy
pane sends with the steer flag like ChatPage does. transcriptRenderers
gains `hideSteerBadge`, wired by ChatPane from busyMode. MembersPage
mounts the pane with `busyMode="steer-only"`. A refused pane send
frames the server's reason (new key send_failed_with_error_restored,
13 locales + en-XA) instead of showing it bare.

Draft/recovery hardening surfaced by review (per-slot draft parking,
cross-member/unmount recovery routing, upload-failure attribution,
demoted-steer queue binding) landed via the stacked PR #8942 and rides
in this commit. In steer-only, `hideSteerBadge` also silences main's
"Steering..." pending pulse and requeued note -- same vocabulary.
The steer-only `user` row reuses ChatPageMessageContent.renderUserContent
(main's single owner of user-bubble content since #9433).

Tests (CI-run): ChatInput steer-only pins, ChatPane.steerOnly (busy DM
steers, idle sends plain, default pane keeps the split, refused steer
restores, badge hidden only in steer-only, framed refusal copy),
MembersPage asserts the host asks for steer-only. Capture harness,
frames and idle->busy recordings under temp-screenshots/members-steer-only.
@bolichen97

Copy link
Copy Markdown
Contributor

Sequencing note: #8947 (Quote / Ask in ChatPane) is being merged first per the maintainer's condition, since both touch the same ChatPane files. Please rebase onto main once it lands and ping; readiness re-runs on the new head.

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.

4 participants