Repository navigation
fix(chat): find a queued card's knowledge envelope by its send mark - #32334
Conversation
727248d to
6bd8187
Compare
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks: the fix carries the envelope mark the send already records, reuses the existing What this change shipsInventory (7 items) — 7 justifiedIntent: a message queued with knowledge attached shows only what the user typed on its queue card; this is a FIX (#24011).
[FIRST-PRINCIPLES-REVIEWED] f7de20f Description read[DESCRIPTION-READ] c6f00713441962cb52ba8261737c5e648f2cc5f7dbf57e5e58366602c0da6206 That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the queue card now uses the envelope mark the send already records, through the same Notes
[DESIGN-REVIEWED] f7de20f Description read[DESCRIPTION-READ] ba168b69131900c5240e567bb36873652e2cd2e3d3c7dd2f960ebabc1a4da82d 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 |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS No new control is added. The queue card's text changes, and screenshots show every state: with a mark, with the close marker in the knowledge, the editor, and no mark. Notes
[UX-REVIEWED] f7de20f Description read[DESCRIPTION-READ] e670881ba7c0279be7344f55adf698809377c9a919cd72164a97afc78c1ca958 That sha256 names everything this verdict read: the PR description, plus the 8 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 |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 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: |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
buluoray
left a comment
There was a problem hiding this comment.
🤖 Kiro Crew Auto-Pipeline [operator: buluoray]:
APPROVE at 6bd8187.
What it does for users: a message sent with knowledge attached while the agent is busy now shows only what the user typed on its queue card, even when a knowledge item holds the close marker on its own line, and the editor opens on those typed words. The card finds the envelope by the length and hash the composer recorded at send time instead of parsing the text.
Evidence
- Gateway: knowledge_meta (dashboard/chat_delivery.py:1595) keeps only the bounded mark ({len, hash}) and refuses malformed shapes; it is stamped on the queue entry and its queue_push frame (chat_delivery.py:1387), on the slot-detail view (chat_delivery.py:1718), on the requeued steer, the sub-agent hold, the responsive send and the steer take-back. No knowledge text leaves meta.knowledge.
- Dashboard: QueueStack.tsx:82 asks the existing knowledgeEnvelopeEnd (utils/knowledgeEnvelope.ts:18), which hides the envelope only when the recorded length lands on a line end and the hash matches, so a typed copy of an envelope, or an edit that no longer matches, is shown whole. stripQuoteBlock already strips the blank lines after a quote, so the quote + knowledge case lines up with the mark. Cold hydration picks the mark up through the rest spread in store/chat/queue.ts, and the push path through queueEntryKnowledgeEnvelope.
- Tests: test_queue_knowledge_meta.py 4 passed; QueueStack.test.tsx, queue.knowledgeEnvelope.test.ts and SideChat.closedElsewhere.test.tsx 85 passed.
- Mutations (one at a time, tree clean after each): passing undefined as the mark in QueueStack.tsx reddened 10 tests, among them "hides exactly the recorded envelope when a knowledge item holds the close marker on its own line"; skipping meta.update(knowledge) in queue_for_next_turn reddened test_busy_slot_entry_frame_and_queue_view_carry_the_mark.
- CI: 90 success, 10 skipped, 1 failure. The failure is macOS Backend Tests shard 6, test_cloud_ssm_cov80.py::TestInstallCommandHint::test_deb_one_liner_reaches_sudo_only_on_a_matching_download (BSD sha256sum), which is not in this diff and is tracked as flaky in #32526. PR Readiness is green; UX, Design and First-Principles reviews PASS and both AI review lanes report no blocking findings. git merge-tree against current main is clean.
Source-only: the sub-agent hold path in chat_send.py and the steer take-back in steer_retract.py were read, not exercised by a test I ran.
Follow-ups (non-blocking)
- A queued entry restored from disk that was queued before this change has no mark, so after the upgrade its card shows the whole envelope until it drains, where main hid it by parsing. The PR body states this; it is transient and limited to entries already queued at upgrade time.
|
Hold: this head now conflicts with main. GitHub reports CONFLICTING, and a local merge-tree against 727392d conflicts in chat_send.py, chat_delivery.py, responsive_chat.py, store/chat/queue.ts and store/chat/wire.ts. Those files overlap with #31441, which merged after this head went green. Please rebase. A new head needs a fresh review. The change itself looks sound to me. The gateway keeps only the bounded {len, hash} mark ( KiroCrew/src/kiro_crew/dashboard/chat_delivery.py Line 1595 in 6bd8187 AI findings judged non-blocking
The red macOS shard 6 test (test_cloud_ssm_cov80.py, BSD sha256sum) is outside this diff and tracked in #32526. Reviewed SHA 6bd8187. — crew-pr-reviewer (r149) |
6bd8187 to
284cbd7
Compare
|
Rebased: main moved in src/kiro_crew/dashboard/chat_api/chat_send.py, src/kiro_crew/dashboard/chat_delivery.py, src/kiro_crew/dashboard/responsive_chat.py, website/src/store/chat/queue.ts, website/src/store/chat/wire.ts since this head went green (759bb96 -> 95695ba); CI re-running. [operator: bolichen97] |
|
[operator: bolichen97] The red
This PR touches neither file. #32606 re-pins both. This PR waits for it, then rebases onto it and re-runs CI. |
A send that waits in the queue lost the knowledge envelope mark the composer records on meta.knowledge.envelope, so the queue card guessed the envelope from the wire text: it showed the whole text when a knowledge item held the close marker on its own line, and hid a typed copy of an envelope as if it were real. The gateway now keeps that mark, bounded and nothing else, on the queue entry as meta.knowledgeEnvelope (busy, hold, responsive and requeued steer paths), and sends it on queue_push and the slot-detail queue. The card finds the envelope with knowledgeEnvelopeEnd, and the text-parsing splitKnowledgeEnvelope is gone. Closes #24011
|
Rebased: main moved in docs/system-specs/modules/learn-cron-dashboard.md and the Backend shard 5 and 6 tests since this head ran (284cbd7 -> f7de20f, onto 752c0b9, which carries #32606); CI re-running. The rebase was clean and the patch is unchanged. Local gate, local GPT and local Opus review passed on this patch. |
284cbd7 to
f7de20f
Compare
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Approved at the author's request: PR Readiness passed on f7de20f, all five review lanes report no blocking finding on this head, no deep review of this head found a code defect, and no one else has an open change request.
…32334) A send that waits in the queue lost the knowledge envelope mark the composer records on meta.knowledge.envelope, so the queue card guessed the envelope from the wire text: it showed the whole text when a knowledge item held the close marker on its own line, and hid a typed copy of an envelope as if it were real. The gateway now keeps that mark, bounded and nothing else, on the queue entry as meta.knowledgeEnvelope (busy, hold, responsive and requeued steer paths), and sends it on queue_push and the slot-detail queue. The card finds the envelope with knowledgeEnvelopeEnd, and the text-parsing splitKnowledgeEnvelope is gone. Closes #24011 (cherry picked from commit 790b725) Backport note: the durable marker and the queued_work parameter that sit beside these lines on main come from feat #31441, which is not on release, so each of the six conflicts keeps release's side and adds only the knowledge envelope part: queue_for_next_turn takes only the knowledge parameter and stamps it on the push before release's own broadcast; the idle-hold push, responsive_chat.accept, queue.ts and wire.ts add only the knowledgeEnvelope field (no durable). The learn-cron-dashboard spec adds only the knowledge envelope paragraph, not the queue editor hold paragraph from #30549.
…32334) A send that waits in the queue lost the knowledge envelope mark the composer records on meta.knowledge.envelope, so the queue card guessed the envelope from the wire text: it showed the whole text when a knowledge item held the close marker on its own line, and hid a typed copy of an envelope as if it were real. The gateway now keeps that mark, bounded and nothing else, on the queue entry as meta.knowledgeEnvelope (busy, hold, responsive and requeued steer paths), and sends it on queue_push and the slot-detail queue. The card finds the envelope with knowledgeEnvelopeEnd, and the text-parsing splitKnowledgeEnvelope is gone. Closes #24011 (cherry picked from commit 790b725) Backport note: the durable marker and the queued_work parameter that sit beside these lines on main come from feat #31441, which is not on release, so each of the six conflicts keeps release's side and adds only the knowledge envelope part: queue_for_next_turn takes only the knowledge parameter and stamps it on the push before release's own broadcast; the idle-hold push, responsive_chat.accept, queue.ts and wire.ts add only the knowledgeEnvelope field (no durable). The learn-cron-dashboard spec adds only the knowledge envelope paragraph, not the queue editor hold paragraph from #30549.
Problem / Motivation
Goal: A message queued with knowledge attached shows exactly what the user typed on its queue card, found by the envelope mark the send recorded rather than guessed from the text.
The queue card hides the
[KNOWLEDGE CONTEXT ...]envelope that a knowledge-attached send carries, but a queued entry kept no record of where that envelope ends. The card guessed from the text, so when a knowledge item held the close marker on a line of its own the card showed the whole envelope, and a typed copy of an envelope was hidden as if it were real.Why it matters
Anyone who sends a message with knowledge attached while the agent is busy sees model-facing document text on the card instead of their own words when the knowledge quotes the close marker, and an edit then opens on that text. The guess also hides text the user typed when it looks like an envelope.
Not a goal
queue_edit: the card checks the mark against the entry's text, so a mark that no longer matches hides nothing.meta.knowledge(titles, item text) on a queue entry.What changed (motivation → approach → change)
The composer already records the envelope's length and hash on
meta.knowledge.envelopeat send time, and sent bubbles use it to hide exactly that envelope. A queued send dropped it: the gateway copies only a fixed set of meta keys onto a queue entry, and the card fell back to parsing the text.chat_delivery.knowledge_meta)meta.knowledge, on the queue entry asmeta.knowledgeEnvelope, for every queued send: busy slot, sub-agent hold, responsive send, and a steer the turn never tookqueue_pushframe and each slot-detailqueue[]itemstore/chat/wire.ts,queue.ts)QueueStack.tsx)knowledgeEnvelopeEnd; the text parsersplitKnowledgeEnvelope(pages/chat/useKnowledgeFetch.ts) and its test are deletedThe mark has its own key, not
meta.knowledge: the drain copies an entry's meta onto the user row, and a row'smeta.knowledgedraws the knowledge chip from the full record, which no queue entry keeps. The spec (learn-cron-dashboard.md), the i18n lint comment that named the deleted helper, and the queue-card capture harness (website/scripts/) follow the change.Backwards compatibility
Compatible: every queue entry and frame keeps its shape; the mark is one optional key that older clients ignore.
Reader: website/src/components/QueueStack.tsx:splitQueuedContent -- chat -- the one caller of the deleted
splitKnowledgeEnvelope; it reads the mark instead | website/src/test/QueueStack.test.tsxReader: a queue entry restored from disk that was queued before this change -- chat -- it has no mark, so its card shows the whole text until it drains, as any unmarked text does | website/src/test/QueueStack.test.tsx "keeps a typed copy of an envelope whole"
Tests
test/test_queue_knowledge_meta.py:knowledge_metakeeps only the bounded mark and refuses malformed ones; a busy-slot send's entry,queue_pushframe and queue view carry the mark and no knowledge text; a steer the turn never took requeues with the mark on its entry and frame.website/src/test/QueueStack.test.tsx: rows carry the mark a real send leaves; with the mark, the card hides exactly the envelope even when a knowledge item holds the close marker on its own line, and the edit puts it back; with no mark, a typed envelope copy is shown whole with no chip. Both fail with the fix reverted.website/src/store/chat/queue.knowledgeEnvelope.test.ts: the mark rides thequeue_pushcard and cold hydration; a malformed mark is dropped.website/src/test/SideChat.closedElsewhere.test.tsx: a side-chat card carries no mark (side chat sends no knowledge), so its editor opens on the whole text; the hand-back it pins is unchanged.Proof: not provable -- frontend test (prove.py runs Python only)
Manual verification
Ran
website/scripts/capture-23632-queue-knowledge-envelope.mjsagainst a production build of the SPA with fixture data: the marked card shows the typed line with the knowledge chip, the close-marker case does too, the editor opens on the typed line, and an unmarked copy shows the whole text. The frames below are from that run.Screenshots / video
Queued knowledge send, the card shows the typed line and the knowledge chip (light):
A knowledge item that holds the close marker on its own line: the mark still names the real end, so the card shows only the typed line (light, then dark). On main this card showed the whole envelope:
Editor and unmarked text
The editor opens on the typed line alone:
The same text with no recorded mark, as a typed copy of an envelope would be, is shown whole with no chip:
Related Issues
Closes #24011
Sibling sweep
Swept: git grep -nE "quote=quote_meta|_hold_meta.update(quote_meta|**quote_meta(" -- src/kiro_crew/dashboard
Sibling: src/kiro_crew/dashboard/chat_api/chat_send.py -- changed here
Sibling: src/kiro_crew/dashboard/responsive_chat.py -- changed here
Sibling: src/kiro_crew/dashboard/steer_retract.py -- changed here
Sibling: src/kiro_crew/dashboard/chat_turn/steer_queue.py -- changed here
Sibling: src/kiro_crew/dashboard/chat_turn/queue_drain.py -- not affected -- the queue_pop rebuild and the drained row draw no queue card
Sibling: src/kiro_crew/dashboard/channel_handoff.py -- not affected -- a channel message carries no knowledge envelope
Pattern harvest
Not generalizable: the queue entry copies an allowlist of send meta keys, and this one key was missing from it.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)