Repository navigation
feat(threads): reply threads ship behind dashboard.crewmate_threads, off by default - #13162
Conversation
Design Review (Fable 5) — ✅ PASSDesign-level review of Design-Verdict: PASS Verify paired #12815 gates its thread calls on the flag: off, these routes answer [DESIGN-REVIEWED] 8300f1b |
GPT 5.6 Review — ✅ no blocking findingsGPT 5.6 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
First Principles Review (Fable 5) — 🟡 CONCERNSPremise-level review of First-Principles-Verdict: CONCERNS The descriptor-leak test rewrite rides along on an unlinked flake claim, narrowing a process-wide pin to fds targeting Not justified as shipped
What this change shipsInventory (7 items) — 6 justifiedIntent: make the already-merged reply-threads API invisible until an operator opts in, per the crewmates-launch decision — an ADDITION (a gate around an existing feature).
[FIRST-PRINCIPLES-REVIEWED] 8300f1b |
Opus 5 Review — ✅ no blocking findingsReviewed Review detailsNothing blocks; two claims the diff adds describe behaviour the code does not have. FINDING — src/kiro_crew/dashboard/handlers/core.py:2464 — the added comment states "the Settings toggle under Crewmates is the only dashboard door to it", but no such control exists: FINDING — src/kiro_crew/dashboard/chat_threads.py:392 — [OPUS-REVIEWED] 8300f1b Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
…'s base Squash of feat/crewmate-chat-bubbles (3389aeb) and feat/reply-threads-flag (0f708d3) on main 5c23469, so this PR's own commit is reviewed on top of both. Also carries, ahead of #12923, the fix for its roster read racing a message that lands mid-read (handlers/members.py, its test). Merge those PRs first; this commit then disappears from the diff.
0f708d3 to
3bebc1a
Compare
…'s base Squash of feat/crewmate-chat-bubbles (d51fad4) and feat/reply-threads-flag (3bebc1a) on main a118ae7, so this PR's own commit is reviewed on top of both. Also carries, ahead of #12923, the fix for its roster read racing a message that lands mid-read (handlers/members.py, its test). Merge those PRs first; this commit then disappears from the diff.
3bebc1a to
52ea063
Compare
…'s base Squash of feat/crewmate-chat-bubbles (665b68d) and feat/reply-threads-flag (52ea063) on main f1f891b, so this PR's own commit is reviewed on top of both. Also restates one recency comment in history_projection.py (an Opus finding on this PR, in #12923's code) until #12923 takes it. Merge those PRs first; this commit then disappears from the diff.
52ea063 to
bb776fd
Compare
GPT 5.6 Review —
|
…crewmate_threads, off by default The three /api/chat/threads routes answer the anti-enumeration 404 and ws.broadcast_thread_reply sends no chat.thread_reply frame while the flag is off; read live from the config watcher's snapshot, so a toggle takes effect on the next request. The key is PATCH-able from the dashboard so the Settings switch in the frontend PR can write it.
bb776fd to
8300f1b
Compare
…'s base Squash of feat/crewmate-chat-bubbles (665b68d) and feat/reply-threads-flag (52ea063) on main f1f891b, so this PR's own commit is reviewed on top of both. Also restates one recency comment in history_projection.py (an Opus finding on this PR, in #12923's code) until #12923 takes it. Merge those PRs first; this commit then disappears from the diff.
W4's feat/crewmate-chat-bubbles head 955d1f5, cherry-picked onto main e183a46 with four additive conflicts kept both ways (feature-map row, crew-mode section, ChatPane renderer options, transcriptRenderers option types). #13162 (threads flag) is in main and is dropped from the carry. Not this PR's review surface; merges with #12923.
* chore: carry #12923 (bubbles) as this stack's base W4's feat/crewmate-chat-bubbles head 955d1f5, cherry-picked onto main e183a46 with four additive conflicts kept both ways (feature-map row, crew-mode section, ChatPane renderer options, transcriptRenderers option types). #13162 (threads flag) is in main and is dropped from the carry. Not this PR's review surface; merges with #12923. * feat: reply threads on crewmate chat messages (ui) Under a bubble that has replies, a footer: the faces of who took part, "N replies" in accent, "Last reply 2h ago" muted. Every bubble's hover action row, the user's included, gets "Reply in thread". Either opens the thread in the right side panel: the parent quoted as one bubble, a hairline reply count, the replies as small bubbles on the grouped-corner rule (crewmate left, user right-aligned), a typing row while the crewmate replies, and a one-line Reply composer. The main chat stays visible beside it; closing hands the panel's tabs back. Only a crewmate's chat offers threads: the Members page hands ChatPane a ThreadHooks set the assistant and user rows read off the render context; every other surface draws neither footer nor action. Stored replies and the per-slot footer data are React Query reads; the reply in progress streams through a small live store fed by chat.thread_reply frames.
…crewmate_threads, off by default (kirodotdev#13162) The three /api/chat/threads routes answer the anti-enumeration 404 and ws.broadcast_thread_reply sends no chat.thread_reply frame while the flag is off; read live from the config watcher's snapshot, so a toggle takes effect on the next request. The key is PATCH-able from the dashboard so the Settings switch in the frontend PR can write it.
* chore: carry kirodotdev#12923 (bubbles) as this stack's base W4's feat/crewmate-chat-bubbles head 955d1f5, cherry-picked onto main e183a46 with four additive conflicts kept both ways (feature-map row, crew-mode section, ChatPane renderer options, transcriptRenderers option types). kirodotdev#13162 (threads flag) is in main and is dropped from the carry. Not this PR's review surface; merges with kirodotdev#12923. * feat: reply threads on crewmate chat messages (ui) Under a bubble that has replies, a footer: the faces of who took part, "N replies" in accent, "Last reply 2h ago" muted. Every bubble's hover action row, the user's included, gets "Reply in thread". Either opens the thread in the right side panel: the parent quoted as one bubble, a hairline reply count, the replies as small bubbles on the grouped-corner rule (crewmate left, user right-aligned), a typing row while the crewmate replies, and a one-line Reply composer. The main chat stays visible beside it; closing hands the panel's tabs back. Only a crewmate's chat offers threads: the Members page hands ChatPane a ThreadHooks set the assistant and user rows read off the render context; every other surface draws neither footer nor action. Stored replies and the per-slot footer data are React Query reads; the reply in progress streams through a small live store fed by chat.thread_reply frames.
Problem / Motivation
Reply threads on crewmate chat messages (#12797, the API half of RFC screen 07 in
docs/request-for-change/rfc-crewmates-launch.md) merged with no switch: the three/api/chat/threadsroutes and thechat.thread_replyframe are live for every install as soon as the frontend ships. The launch decision is that threads are a flagged feature, off by default, so an install that has not opted in exposes nothing of it.Why it matters
A feature nobody turned on should not answer on the wire. Off, a caller must not even be able to tell it exists.
What changed (motivation → approach → change)
dashboard.crewmate_threadsFalse, label "Reply threads on crewmate chat messages"chat_threads.threads_enabled()ws.broadcast_thread_replyconfig/sections.pyaddsDashboardConfig.crewmate_threadswith its metadata label and help;config/loader.pyreads it (bool(...), defaultFalse).handlers/core.pylistsdashboard.crewmate_threadsin_EDITABLE_CONFIGas a bool, so the Settings toggle the frontend PR adds can PATCH it; without that entry the schema would publish a label for a setting whose write is refused.dashboard/chat_threads.py:threads_enabled()reads the config watcher's snapshot (a plain attribute read) and falls back to a load off the loop only before the watcher has one, so a toggle takes effect on the next request with no restart. Each of the three handlers (api_chat_threads_summary,api_chat_thread_detail,api_chat_thread_reply) calls it before anything else and, off, answers_feature_off():404 {"error": "not found", "code": "slot_not_found"}, byte for byte the app-isolation refusal, so "threads are off" and "no such slot" are the same answer and the feature's presence is not enumerable. Nothing is read, stored or started.dashboard/ws.py:broadcast_thread_replyreturns before building a frame when the snapshot is absent or the flag is off. The routes already refuse before a turn starts; this covers the one turn that was running when the flag went off, whose frames are dropped while its stored reply stays in the sidecar and is served again once the flag is back on. The flag hides threads; it never deletes them.Frontend half: #12815 draws the Reply in thread control and the panel only when the flag is on and carries the Settings toggle. Out of scope, named for the reader: there is no crewmate parent flag in config today (Crew Members is a client-side preview flag), so the toggle nests under a "Crewmates" heading in the settings UI rather than under a parent config key; whether crewmate features should share a parent flag is a separate decision.
Spec: a Flag paragraph in the reply-threads section of
docs/system-specs/modules/history.md.Backwards compatibility
Behaviour change by design: an install that never set the key now has threads OFF. Nothing ships the frontend yet, so no user loses a control they had. The sidecar file and the stored replies are unaffected; a key set to
truerestores everything as merged.Tests
test/test_chat_threads.py: an autouse fixture primes the live snapshot with the flag ON (every existing test is about the feature when on);test_threads_off_hides_the_routes_and_sends_no_frameprimes it OFF and checks all three routes answer the anti-enumeration 404 with the app refusal's exact body, no turn runs, nothing is stored,broadcast_thread_replysends nothing, and turning it back on serves the same request and frame;test_the_flag_is_off_by_default_and_editable_from_the_dashboardpins the default and the_EDITABLE_CONFIGentry;config-baseline.jsonregenerated for the new key.test_a_failed_sidecar_staging_leaks_no_descriptornow counts only descriptors pointing at the.threadsdirectory, not every descriptor in the process -- unrelated handles opening and closing in a shared xdist worker made it flake on shard 8.Manual verification
N/A — API-only; the frontend PR carries the Settings toggle and its screenshots.
Known red not from this PR:
Backend Tests (Windows) (4)fails ontest/test_diag_procs.pyCPU-rate timing (a different test each run:test_an_unchanged_process_still_gets_its_rate,test_the_gil_hint_can_fire_through_the_read_path), tracked in #13134; this PR touches no diag code.Screenshots / video
N/A — no UI in this PR.
Related Issues
Follow-up to #12797; paired with #12815. CrewMates launch screen 07 (reply threads).
Checklist
history.md)