Skip to content

feat: prioritize human messages in crewmate chats - #20240

Merged
buluoray merged 1 commit into
mainfrom
feat/crewmate-responsive-send
Oct 16, 2026
Merged

buluoray merged 1 commit into
mainfrom
feat/crewmate-responsive-send

Conversation

@buluoray

@buluoray buluoray commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Keep a person's crewmate conversation available through a normal Send control while longer work runs, without exposing worker and interruption mechanics in the conversation.

A follow-up currently queues behind work or asks the person to choose steering and interruption controls. The accepted product direction and bounded feasibility measurements are recorded in #20181 (triaged T3).

Why it matters

A conversation should remain usable while its agent works. People should not need to understand execution sessions to ask a follow-up, answer a question, or correct a task.

Not a goal

  • No decision model, session fork, conversation merge, process rekey, or new task system.
  • No OS process termination, approval bypass, guaranteed reply latency, or automatic recovery of unknown tool side effects.
  • No redesign of ordinary Sessions, messaging-channel scheduling, or remote executors.

What changed (motivation → approach → change)

A busy crewmate should accept conversation rather than expose scheduling choices. Its composer keeps main's Stop while work runs and nothing is typed; once the person types, the control is the ordinary Send, never the steer/queue split. The member DM composer therefore sends responsive: true; the gateway validates owner/member identity, retains the message in the existing queue, and steers it into the running turn first. Only when the steer is still unread after a 3-second grace does it make one bounded exact-owner cooperative cancellation attempt, so a short tool call is not thrown away. A harness without steer support, or a steer the backend refused, has nothing to consume, so that send queues and cancels at once. Waiting sends write their rows in send order even while an earlier send's cancel claim is in flight. Waiting messages drain as one turn, so a burst gets one reply. Turn-only context asks for an answer first and delegation of substantial remaining work; the recovery reference marks each tool step finished or unfinished and frames the pause as gateway scheduling, not something the person did. Native question answers retain steering into their waiting turn. Matching Stop completion resumes retained messages safely.

Queue events and cold hydration carry exact send identity, preserve attachments and quotes, and reconcile late receipts without duplicate bubbles. In a crewmate chat a queued send stays the person's own bubble where it was sent, instead of a queue card, and the thread re-reads once when a turn ends. A queued cron or app notification never becomes the person's bubble. Runtime notices, interruption badges and worker cards stay hidden; the typing bubble and its one-line current step from main stay, as do questions, errors and approvals. Initial-send nudge and edition-observer behavior is shared with the existing direct-send path. Two supporting changes keep the reply prompt and the thread steady: proactive context compaction is deferred while a human reply is admitted (check_context_usage(defer_compaction=...); above 95% it still runs first), and the bottom-pinned transcript mounts enough rows to fill the viewport, so a short crewmate thread shows no placeholder flash after Send. The decision is recorded in #20181; there is no accepted dedicated handoff RFC on main.

Backwards compatibility

Compatible API: the new request field is optional and only eligible local owner crewmate sends acquire priority. Ordinary Sessions keeps its explicit busy controls; shared queue correlation also prevents optimistic duplicates there.

Reader: website/src/components/ChatPane.tsx:ChatPane -- crew page -- selects normal Send and keeps actionable question/approval surfaces; ordinary panes retain their busy mode.
Reader: website/src/components/chat/crewmateBubbles.ts:isCrewmateChatRow -- crew page -- hides machinery at render time, without deleting transcript rows.
Reader: website/src/pages/chat/transcriptRenderers.tsx -- chat -- ordinary Sessions retains detailed runtime rows and steer badges.
Reader: website/src/store/chat/queue.ts:hydrateQueuedBubbles -- chat -- preserves normalized queue identity and live state; bounded history upgrades do not replay stale queue snapshots.

Tests

  • Backend final explicit regression set: 520 passed; exact-owner SessionManager tests: 4 passed; flake ratchet: 53 passed.
  • Responsive backend tests: 61 tests repeated 20 times serially, 103 tests including stop neighbors repeated 10 times with four workers, and 61 passed in seeded shuffled order.
  • Cold-hydration frontend regression set: 238 passed across 11 files; 22 passed in seed-20181 shuffled order after fixture-isolation cleanup.
  • After rebasing: 114 backend tests (responsive + flake ratchet) and 89 targeted frontend tests passed.
  • Red-before-green covered native/idle question delivery, missing queue identities, prompt expansion guidance, caller metadata filtering, proven-no-send cancellation recovery, stop-settlement races, human-input observers, and cold queue hydration.
  • Black, isort, Flake8, mypy, TypeScript, ESLint, static i18n, documentation, detector checks and dependency duplication checks passed in scoped or whole-tree validation as appropriate. Standard production build, render-i18n comparison, bundle-size and chunk-cycle gates passed after isolating per-worktree build caches.
  • Full suites were not run: automatic related-test selection expanded to 2,623 backend and 1,448 frontend files; explicit targeted sets above were used instead. Electron was not changed or tested. Test warnings remain in neighboring fixtures.

Manual verification

An isolated loopback pod denied anonymous API requests (403) and accepted its authenticated browser (200). The real served bundle matched the worktree build. A real text-only model turn produced one POST, correlated queue push/pop, one persisted human row and one assistant reply.

Selective HTTP/WebSocket fixtures on the served SPA verified busy Send, active native answers carrying both steer and responsive, retained approval/question controls, delayed receipts, duplicate pop/stale push, and cold reload. The reload regression first reproduced a retained queue entry with nothing visible; on this head a reloaded crewmate chat shows that message once, as the person's own bubble.

A second isolated pod on this head ran a real model: a crewmate was asked to run sleep 30, and a second message was sent while it worked. The second message stayed a normal bubble in place with the typing bubble below it; the accessibility snapshot at 1280px and 390px held none of the queue card's labels. The crewmate answered the second message within about three seconds, then re-ran the paused command. These busy/question/approval cases are simulated states, not claims of a real native approval-hold run. No approval was granted in final QA. Real native cancel/reset timing and non-Linux behavior remain CI/manual coverage gaps. Pods were reclaimed; no live settings or running service changed.

Screenshots / video

Real desktop conversation:
Real crewmate conversation with normal Send

390px real conversation:
390px crewmate conversation

Send while the crewmate works (real model, this head): the second message is an ordinary bubble where it was sent, the typing bubble sits below it, and no queue card is drawn:
Second message drawn in place while the crewmate works

390px, about three seconds later: the crewmate answered the second message and re-runs the paused step:
390px: second message in place, answer, typing bubble naming the current step

Composer while the crewmate works (real model, head 1015fa6a4e). Empty draft keeps main's Stop; a typed draft shows the ordinary Send, never the steer icon:
Busy, empty draft: Stop
Busy, typed draft: Send

390px, same two states:
390px busy, empty draft: Stop
390px busy, typed draft: Send

Question and approval controls on the real served SPA (state simulated)

Dark question and approval controls retained; state simulated

Decision for the owner

Recorded in rfc-crewmate-responsive-send.md (accepted, product owner rayrayxu, 2026-10-15): Send steers into a busy crewmate and cancels its turn only after a 3-second unread grace; the composer keeps main's Stop while empty and shows the ordinary Send once typed; the chat hides queue cards, scheduling badges and worker cards, while questions, approvals, errors, the stop card and main's typing bubble stay. The RFC lands in its own PR, so this head's First Principles verdict is recorded with /ai-review override first-principles <head> on the owner's instruction.

Related Issues

Closes #20181

Pattern harvest

Not generalizable: the fixes preserve the existing slot ownership, native-question and queue-identity contracts while introducing one member-chat scheduling mode; a new global lint rule would not prove these interleavings.

Checklist

  • One Conventional Commit on a feature branch
  • Targeted existing and new tests pass; full suite deferred to CI
  • Self-review completed and independent review findings addressed
  • Owning specifications updated
  • No secrets, credentials, or internal references in the code diff

Contribution License Agreement

Contributed under the repository's Apache-2.0 license.

@buluoray
buluoray requested review from a team and KiroCrewCaptain as code owners October 14, 2026 09:37
@buluoray
buluoray requested a review from mbriones98 October 14, 2026 09:37
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 14, 2026
@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ human override accepted

@buluoray overrode this lane for b8901bab151bbb989cc296b48614e866109b65e3 via /ai-review override (this commit only).

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — 🟡 CONCERNS

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

Design-Verdict: CONCERNS

A plain chat message now cancels a running crewmate turn on its own, even in the middle of a tool call that changes something, and nothing asks whether that tool is safe to cut short.

Watch

  • Sending a message can stop work partway. In _grace, after STEER_GRACE_SECONDS = 3.0, a steer the model has not read yet leads to _claim_cancel → cancel_owned_turn → provider.cancel. Your own run shows the in-flight tool really is stopped ("re-ran the paused command"). The model only reads a steer at a tool boundary, so any tool call longer than 3 seconds gets cancelled: a deploy, a migration, git push, a file rewrite. Undoing the damage is left to prompt text ("A step that changes something gets its current state checked first"). On a harness without steer support, steer_first=False cancels with no grace at all. The person only typed a message and never asked for anything to stop. Their tool work ends up half-applied, and the "Not a goal" line accepting "unknown tool side effects" does not limit how often this can happen.
    Clears when: the automatic cancel only fires when no tool call is in flight (or the one in flight is read-only), and otherwise the send waits for the next tool boundary. Or a recorded maintainer decision in Keep crewmate chat responsive with a simple Send experience #20181 / docs/decisions/ explicitly accepts cancelling tools that change things when a person merely sends a message.

Suggestions

  • RESPONSE_GUIDANCE (about 2 KB) goes in front of every steer as well as every responsive turn. Putting it into context once per turn would stop a burst of messages from repeating it in the model's context.

[DESIGN-REVIEWED] b8901ba

Description read

[DESCRIPTION-READ] 99fb770ed33aeef765a0a29dfb336cb70a3f175d8a8cdd9ab17281f0b5a99fcf

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@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 Oct 14, 2026
@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — 🟡 CONCERNS

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

UX-Verdict: CONCERNS

Send can pause the crewmate's running work, and nothing tells the person it will; the blind reader worried their question caused the interruption.

Watch

  • Send gives no hint that it pre-empts running work. When the person types while the crewmate is busy, the Stop square turns back into "the ordinary Send". Once the 3-second grace runs out, the gateway cancels the running turn. The person only learns this afterwards, from the crewmate's reply "The sleep got paused partway, so I am re-running it now…" (shot-04). The blind reader got the button right, rating it "a guess", but said "I don't know whether it waits its turn or interrupts the job that's running" (shot-06/08). After shot-04 they added "It worries me that my second question may have been what interrupted the first job." Their reading is accurate: the send did cause the pause, yet the turn context tells the crewmate to describe it as "gateway scheduling, not something the person did". Severity: this hits every busy send in the crewmate DM, the main path of this PR. The task still finishes, so it costs trust rather than the task, every time. Smallest fix: add a hint at the composer while busy, e.g. a tooltip on Send or a placeholder like "Mate will pause its current step to answer". Then let the reply admit the pause instead of blaming scheduling.
  • Typing a draft hides Stop. In responsive mode Stop only renders when isRunning && !composerHasDraft. A person halfway through writing a correction who wants to halt the task has to clear the draft first to get Stop back. The reader saw the swap and could not say what the new button meant. Severity: occasional (stop while drafting), friction rather than failure, and it happens every time. Fix: keep Stop next to Send while a draft exists during a running turn.

[UX-REVIEWED] b8901ba

Description read

[DESCRIPTION-READ] 4e7d7bb0317f745511d37e29d35c18561236a4742c4e65e28a5c9a51ea7e1c1d

That sha256 names everything this verdict read: the PR description, plus the 12 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions github-actions Bot added merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Oct 14, 2026
@buluoray
buluoray force-pushed the feat/crewmate-responsive-send branch from 22f80e6 to 151e0cd Compare October 14, 2026 18:10
@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Sensitive Change Review

Sensitive files changed:

  • src/kiro_crew/security_posture.py

  • @buluoray posted a complete reasoning template for b8901ba.

@github-actions github-actions Bot removed the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Oct 14, 2026
Comment thread src/kiro_crew/options_list.py Fixed
@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ human override accepted

Human judgment by @buluoray overrides the GPT 6.1 finding for b8901bab151bbb989cc296b48614e866109b65e3; the recorded reason is authoritative for this commit.

[GPT-OVERRIDE] b8901ba

This comment is updated in place on each push.

The model was not re-run because an authorized human decision supersedes it.

False positive or not applicable? A repository writer can comment:
/ai-review override gpt b8901bab151bbb989cc296b48614e866109b65e3: <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 Oct 14, 2026
@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] b8901ba

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

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

@buluoray
buluoray force-pushed the feat/crewmate-responsive-send branch from 151e0cd to 32c9648 Compare October 14, 2026 18:58
@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 Oct 14, 2026
@buluoray

Copy link
Copy Markdown
Contributor Author

🤖 Kiro Crew Auto-Pipeline [operator: buluoray]:

Sensitive change review

  • Head commit: 32c9648
  • What rule changed: No rule changed. src/kiro_crew/security_posture.py gains one entry in _REDACTION_SINKS ("Interrupted work in a crewmate reply", owner dashboard/responsive_chat.py), so the posture inventory lists the new model-context sink this PR adds.
  • Before -> after (what was allowed/blocked, now): Nothing allowed or blocked changes. Before: the posture page did not list the interrupted-turn reference as a redaction sink. After: it does. The reference itself (capped at 16000 chars, RECOVERY_CHARS) is passed through _neutralize_structural_markers, redact_exfiltration_urls and redact_credentials before it enters the next prompt (responsive_chat.py:247-255).
  • Worst case if wrong (breaks commands / leaks secret / locks user out): The entry is descriptive data only. If its text were wrong, the posture page would describe the sink inaccurately; no gate, sandbox mask or approval path reads this tuple to decide anything.
  • Evidence checked (which sandbox result proves it): N/A for a sandbox result: no sandbox seal, mask or argv rule is touched. Checked instead that the redaction calls exist at responsive_chat.py:247-255 on this head and that test/test_security_posture.py (omission detection over the sink inventory) passes.
  • No regression:
    • Tools still work (which tools/commands were run, result): Local backend run on this head: test/test_security_posture.py 53 passed; test/test_responsive_*.py + test/test_slot_running_readers.py 97 passed; mypy clean on the touched dashboard modules.
    • Backward compatible (old config / old data / old callers still work, how checked): A tuple entry is added; no field shape, config key or caller changes. Existing posture tests read the tuple unchanged and pass.
    • Existing tests (which suites passed on this head): As above, plus frontend vitest for ChatPane crewmate/steer suites (92 passed) and tsc --noEmit.
  • How to undo: Revert the _REDACTION_SINKS entry, or revert this PR.

@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 Oct 14, 2026
@buluoray
buluoray force-pushed the feat/crewmate-responsive-send branch from 32c9648 to 9b1aba1 Compare October 14, 2026 21:18
@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 Oct 14, 2026
@buluoray
buluoray force-pushed the feat/crewmate-responsive-send branch from 9b1aba1 to 8a181fd Compare October 14, 2026 22:22
@github-actions github-actions Bot added the readiness: action required A blocking check or review needs attention label Oct 15, 2026
@buluoray
buluoray force-pushed the feat/crewmate-responsive-send branch from 2536a36 to 22c13d3 Compare October 15, 2026 15:30
@buluoray

Copy link
Copy Markdown
Contributor Author

🤖 Kiro Crew Auto-Pipeline [operator: buluoray]:

Sensitive change review

  • Head commit: 22c13d3
  • What rule changed: No rule changed. src/kiro_crew/security_posture.py gains one entry in _REDACTION_SINKS ("Interrupted work in a crewmate reply", owner dashboard/responsive_chat.py), so the posture inventory lists the new model-context sink this PR adds.
  • Before -> after (what was allowed/blocked, now): Nothing allowed or blocked changes. Before: the posture page did not list the interrupted-turn reference as a redaction sink. After: it does. The reference itself (capped at 16000 chars, RECOVERY_CHARS) is passed through _neutralize_structural_markers, redact_exfiltration_urls and redact_credentials before it enters the next prompt (responsive_chat.py:383-385 on this head).
  • Worst case if wrong (breaks commands / leaks secret / locks user out): The entry is descriptive data only. If its text were wrong, the posture page would describe the sink inaccurately; no gate, sandbox mask or approval path reads this tuple to decide anything.
  • Evidence checked (which sandbox result proves it): N/A for a sandbox result: no sandbox seal, mask or argv rule is touched. Checked instead that the redaction calls exist at responsive_chat.py:383-385 on this head and that test/test_security_posture.py (omission detection over the sink inventory) passes.
  • No regression:
    • Tools still work (which tools/commands were run, result): Local run on this head's tree: test/test_security_posture.py passed as part of a 1354-test backend set (responsive, slot readers, dashboard chat, chat-mode security).
    • Backward compatible (old config / old data / old callers still work, how checked): A tuple entry is added; no field shape, config key or caller changes. Existing posture tests read the tuple unchanged and pass.
    • Existing tests (which suites passed on this head): backend 1354 passed; frontend vitest 1522 passed; mypy, tsc and eslint clean. This head refuses editing a queued send whose row is already written (409, code queue_item_already_sent); the static ratchet set (169 tests) and 833 related backend tests passed on it.
  • How to undo: Revert the _REDACTION_SINKS entry, or revert this PR.

This head is a no-conflict rebase of 2536a36 onto current main; git range-diff shows the patch unchanged (70 files, +4747/-300). The test results above were run on 2536a36 and were not re-run locally after the rebase.

@buluoray buluoray mentioned this pull request Oct 15, 2026
5 tasks done
@buluoray

Copy link
Copy Markdown
Contributor Author

/ai-review override first-principles 1015fa6: The product owner accepted this crewmate-chat shape on 2026-10-15; it is recorded as an accepted RFC in #20889, which lands separately.

@buluoray

Copy link
Copy Markdown
Contributor Author

🤖 Kiro Crew Auto-Pipeline [operator: buluoray]:

Sensitive change review

  • Head commit: 1015fa6
  • What rule changed: No rule changed. src/kiro_crew/security_posture.py gains one entry in _REDACTION_SINKS ("Interrupted work in a crewmate reply", owner dashboard/responsive_chat.py), so the posture inventory lists the new model-context sink this PR adds.
  • Before -> after (what was allowed/blocked, now): Nothing allowed or blocked changes. Before: the posture page did not list the interrupted-turn reference as a redaction sink. After: it does. The reference itself (capped at 16000 chars, RECOVERY_CHARS) is passed through _neutralize_structural_markers, redact_exfiltration_urls and redact_credentials before it enters the next prompt (responsive_chat.py:383-385 on this head).
  • Worst case if wrong (breaks commands / leaks secret / locks user out): The entry is descriptive data only. If its text were wrong, the posture page would describe the sink inaccurately; no gate, sandbox mask or approval path reads this tuple to decide anything.
  • Evidence checked (which sandbox result proves it): N/A for a sandbox result: no sandbox seal, mask or argv rule is touched. Checked instead that the redaction calls exist at responsive_chat.py:383-385 on this head and that test/test_security_posture.py (omission detection over the sink inventory) passes.
  • No regression:
    • Tools still work (which tools/commands were run, result): Local run on this head's tree: test/test_security_posture.py passed as part of a 1354-test backend set (responsive, slot readers, dashboard chat, chat-mode security).
    • Backward compatible (old config / old data / old callers still work, how checked): A tuple entry is added; no field shape, config key or caller changes. Existing posture tests read the tuple unchanged and pass.
    • Existing tests (which suites passed on this head): backend 1354 passed; frontend vitest 1522 passed; mypy, tsc and eslint clean. This head refuses editing a queued send whose row is already written (409, code queue_item_already_sent); the static ratchet set (169 tests) and 833 related backend tests passed on it.
  • How to undo: Revert the _REDACTION_SINKS entry, or revert this PR.

This head rebases onto current main and restores main's Stop control and stop card in the crewmate composer and chat (frontend only; the redaction sink above is unchanged). Re-run on it: 514 related backend tests (responsive, security posture, composition contract), 2907 related frontend tests, tsc and docs-lint.

@github-actions

Copy link
Copy Markdown
Contributor

Human judgment recorded

@buluoray marked the first-principles AI finding as false positive, not applicable, or explicitly accepted for 1015fa6a4e5205fa4b2cd3e8df8c0dbef26fabec.

The product owner accepted this crewmate-chat shape on 2026-10-15; it is recorded as an accepted RFC in #20889, which lands separately.

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

@buluoray

Copy link
Copy Markdown
Contributor Author
  • span=03a412867a51 Window eviction duplicates a persisted responsive send

fixed in the next push: the send records its row's durable position (responsive_chat.remember_row, counted like the trim counter), and _present_row reuses a row the capped window evicted, since it is already in the transcript. A row gone from the window without an eviction still is not reused.
test_a_waiting_send_evicted_from_the_window_reuses_its_written_row goes red without the eviction branch.

@buluoray

Copy link
Copy Markdown
Contributor Author
  • span=f75f2876063e Cancelling a waiting send whose row is written leaves the message in the transcript

fixed in the next push: the queue-cancel route refuses it with the same 409 queue_item_already_sent the edit route uses, so the row stays the one copy and no text is handed back to be sent again.
TestQueueCancel::test_a_send_already_in_the_conversation_is_not_cancelled goes red without the check.

@buluoray

Copy link
Copy Markdown
Contributor Author
  • span=a1922e4dff8e Sending a message interrupts work with no warning.

rebutted: this send shape is the product owner's accepted decision, recorded in RFC #20889 (steer first, cancel the model turn only after the 3 s grace). A standing warning line under the composer would add the interruption mechanics this chat deliberately keeps out of view.

@buluoray

Copy link
Copy Markdown
Contributor Author
  • span=8ccc60fb74dd A queued message can no longer be taken back.

rebutted: once a waiting send's row is written it is part of the conversation, and both edit and cancel now refuse it (409) so the transcript keeps one copy. The crewmate chat draws messages only (RFC #20889); the Sessions queue card still cancels any send not yet written.

@buluoray

Copy link
Copy Markdown
Contributor Author
  • span=108a6bc086c8 Repeated sends can restart long work over and over.

rebutted: the owner accepted this trade-off in RFC #20889: a reply within seconds over an uninterrupted long step, with the steer tried first for 3 s and a step that changes state checked before it is re-run. Per-tool cancel limits are a follow-up the RFC names, not part of this change.

@buluoray

Copy link
Copy Markdown
Contributor Author
  • span=522801475c4f The backwards-compatibility check could only be partly done.

answered: cron and app queue entries never take the responsive path. priority_entry requires a human-origin entry with no kind and no channel origin, so dequeue_waiting_run drains them one at a time as before and write_row_at_send never runs for them; test_cron_and_app_queue_entries_never_take_the_responsive_path pins the exclusion.

@buluoray

Copy link
Copy Markdown
Contributor Author

🤖 Kiro Crew Auto-Pipeline [operator: buluoray]:

Sensitive change review

  • Head commit: 90f79a5
  • What rule changed: No rule changed. src/kiro_crew/security_posture.py gains one entry in _REDACTION_SINKS ("Interrupted work in a crewmate reply", owner dashboard/responsive_chat.py), so the posture inventory lists the new model-context sink this PR adds.
  • Before -> after (what was allowed/blocked, now): Nothing allowed or blocked changes. Before: the posture page did not list the interrupted-turn reference as a redaction sink. After: it does. The reference itself (capped at 16000 chars, RECOVERY_CHARS) is passed through _neutralize_structural_markers, redact_exfiltration_urls and redact_credentials before it enters the next prompt (responsive_chat.py:417-419 on this head).
  • Worst case if wrong (breaks commands / leaks secret / locks user out): The entry is descriptive data only. If its text were wrong, the posture page would describe the sink inaccurately; no gate, sandbox mask or approval path reads this tuple to decide anything.
  • Evidence checked (which sandbox result proves it): N/A for a sandbox result: no sandbox seal, mask or argv rule is touched. Checked instead that the redaction calls exist at responsive_chat.py:417-419 on this head and that test/test_security_posture.py (omission detection over the sink inventory) passes.
  • No regression:
    • Tools still work (which tools/commands were run, result): Local run on this head's tree: test/test_security_posture.py passed as part of a 1354-test backend set (responsive, slot readers, dashboard chat, chat-mode security).
    • Backward compatible (old config / old data / old callers still work, how checked): A tuple entry is added; no field shape, config key or caller changes. Existing posture tests read the tuple unchanged and pass.
    • Existing tests (which suites passed on this head): backend 1354 passed; frontend vitest 1522 passed; mypy, tsc and eslint clean. This head refuses editing a queued send whose row is already written (409, code queue_item_already_sent); the static ratchet set (169 tests) and 833 related backend tests passed on it.
  • How to undo: Revert the _REDACTION_SINKS entry, or revert this PR.

This head rebases onto current main and fixes two review findings outside the redaction sink, which is unchanged: a waiting send whose row the capped live window evicted reuses that row instead of writing it again, and the queue-cancel route refuses a send whose row is already written (409, same as edit). Re-run on it: test/test_security_posture.py (53 passed) and 194 related backend tests (responsive chat, queue routes, stop).

@github-actions

Copy link
Copy Markdown
Contributor

Human judgment recorded

@buluoray marked the first-principles AI finding as false positive, not applicable, or explicitly accepted for 90f79a566daa04dc2656d53e5de512553e1fd2a9.

The product owner accepted this crewmate-chat shape on 2026-10-15; it is recorded as an accepted RFC in #20889, which lands separately.

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

@buluoray

Copy link
Copy Markdown
Contributor Author

/ai-review override first-principles 90f79a5: The product owner accepted this crewmate-chat shape on 2026-10-15; it is recorded as an accepted RFC in #20889, which lands separately.

@github-actions

Copy link
Copy Markdown
Contributor

Human judgment recorded

@buluoray marked the first-principles AI finding as false positive, not applicable, or explicitly accepted for 90f79a566daa04dc2656d53e5de512553e1fd2a9.

The product owner accepted this crewmate-chat shape on 2026-10-15; it is recorded as an accepted RFC in #20889, which lands separately.

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

A person's message in a crewmate chat is answered promptly instead of
waiting behind the crewmate's background work. Follow-ups found while
using the responsive crewmate chat live:

- steer a crewmate send into the running turn first; cancel that turn
  only when the steer is still unconsumed after a 3-second grace, so a
  short tool call is not thrown away
- draw a queued crewmate message as the person's own bubble, so the
  yellow queue card no longer flashes after Send
- reconcile an on-screen crewmate thread when its turn ends, so a reply
  row that never reduced live does not wait for a page reload
- let an interrupted crewmate turn reply before deferrable compaction;
  compaction above 95% of the context still runs first
- register the responsive chat redaction fields in the security posture
- Answer a burst of messages once: waiting sends drain as one turn and a
  send behind the protected answer steers into it without cancelling it.
- Resume paused work without blaming the person: the recovery reference
  marks each tool step finished or unfinished, and the guidance frames
  the pause as gateway scheduling.
@buluoray

Copy link
Copy Markdown
Contributor Author

🤖 Kiro Crew Auto-Pipeline [operator: buluoray]:

Sensitive change review

  • Head commit: b8901ba
  • What rule changed: No rule changed. src/kiro_crew/security_posture.py gains one entry in _REDACTION_SINKS ("Interrupted work in a crewmate reply", owner dashboard/responsive_chat.py), so the posture inventory lists the new model-context sink this PR adds.
  • Before -> after (what was allowed/blocked, now): Nothing allowed or blocked changes. Before: the posture page did not list the interrupted-turn reference as a redaction sink. After: it does. The reference itself (capped at 16000 chars, RECOVERY_CHARS) is passed through _neutralize_structural_markers, redact_exfiltration_urls and redact_credentials before it enters the next prompt (responsive_chat.py:417-419 on this head).
  • Worst case if wrong (breaks commands / leaks secret / locks user out): The entry is descriptive data only. If its text were wrong, the posture page would describe the sink inaccurately; no gate, sandbox mask or approval path reads this tuple to decide anything.
  • Evidence checked (which sandbox result proves it): N/A for a sandbox result: no sandbox seal, mask or argv rule is touched. Checked instead that the redaction calls exist at responsive_chat.py:417-419 on this head and that test/test_security_posture.py (omission detection over the sink inventory) passes.
  • No regression:
    • Tools still work (which tools/commands were run, result): Local run on this head's tree: test/test_security_posture.py passed as part of a 1354-test backend set (responsive, slot readers, dashboard chat, chat-mode security).
    • Backward compatible (old config / old data / old callers still work, how checked): A tuple entry is added; no field shape, config key or caller changes. Existing posture tests read the tuple unchanged and pass.
    • Existing tests (which suites passed on this head): backend 1354 passed; frontend vitest 1522 passed; mypy, tsc and eslint clean. This head refuses editing a queued send whose row is already written (409, code queue_item_already_sent); the static ratchet set (169 tests) and 833 related backend tests passed on it.
  • How to undo: Revert the _REDACTION_SINKS entry, or revert this PR.

This head is the previous head (90f79a5) rebased onto current main with no code change, to pick up main's fix for test/test_acp_bindings.py (#20902); the redaction sink is unchanged. Re-run on it: test/test_security_posture.py, test/test_acp_bindings.py and the responsive-chat and stop tests (297 passed).

@buluoray

Copy link
Copy Markdown
Contributor Author

/ai-review override first-principles b8901ba: The product owner accepted this crewmate-chat shape on 2026-10-15; it is recorded as an accepted RFC in #20889, which lands separately.

@github-actions

Copy link
Copy Markdown
Contributor

Human judgment recorded

@buluoray marked the first-principles AI finding as false positive, not applicable, or explicitly accepted for b8901bab151bbb989cc296b48614e866109b65e3.

The product owner accepted this crewmate-chat shape on 2026-10-15; it is recorded as an accepted RFC in #20889, which lands separately.

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

@buluoray

Copy link
Copy Markdown
Contributor Author

/ai-review override gpt b8901ba: Only reachable when one queued send outlives 500 newer persisted rows and a restart (channel_slots.py:726), and the result is one visible duplicate user row appended at chat_runner.py:5368 with the original row kept, so no data is lost or silently corrupted.

@github-actions

Copy link
Copy Markdown
Contributor

Human judgment recorded

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

Only reachable when one queued send outlives 500 newer persisted rows and a restart (channel_slots.py:726), and the result is one visible duplicate user row appended at chat_runner.py:5368 with the original row kept, so no data is lost or silently corrupted.

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

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.

Keep crewmate chat responsive with a simple Send experience

3 participants