Repository navigation
feat(spec-builder): keep the paste chip on the stored user message - #31799
Conversation
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. Every item exists to close #21147, and the backend keeps only What this change shipsInventory (4 items) — 4 justifiedIntent: a long paste sent from Spec Builder's chat keeps its chip after it is stored and after a reload. This is a FIX for a gap left by #21100, though it is titled
[FIRST-PRINCIPLES-REVIEWED] bae7f04 Description read[DESCRIPTION-READ] a9a0f01309234a56dc6d64784726234314c45d624781067605650b1769a60212 That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS No design-level concerns: the change reuses the host's Notes
[DESIGN-REVIEWED] bae7f04 Description read[DESCRIPTION-READ] 7629666126eff02f8b21bd8b5c0381badb9c6e5981cd1d48ee7c84b3adac9372 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 Nothing blocks. This PR only passes data through: it reuses the chat's existing paste chip, and the before and after screenshots show the stored message keeping that chip after a reload. Notes
[UX-REVIEWED] bae7f04 Description read[DESCRIPTION-READ] 25df6d9c002f2458463012305a1bc58e1afcbe6e811f6ea98ce69ef7368e6ccb That sha256 names everything this verdict read: the PR description, plus the 6 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 |
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: |
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: |
Spec Builder's chat sends through its own message endpoint, which took only the text. A long paste collapsed into a chip in the composer showed as a chip while the send was in flight, then turned into its full text once the stored row landed, and stayed that way after a reload. The page now forwards the embed's collapsed pastes as meta.pastes, and the endpoint stores them on the user row the way POST /api/chat does, so the transcript folds the text back into its chip. A message sent while the spec's agent is still working carries them on its queue entry, which the drain writes on the row. A message with no pastes sends and stores exactly what it did before. Closes #21147
a324b26 to
bae7f04
Compare
[operator: bolichen97] |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Approved for the on-call. Review lanes pass on bae7f04, no conflict, no open change request.
Port every backend change the built-in took after the snapshot this repository was ported from, so an adopted user runs them: - put a popped worker slot back only onto a free key (kirodotdev/KiroCrew#31829) - keep pasted blocks and the send id on the stored user row, queued or not, with the id checked by the host (kirodotdev/KiroCrew#31799, kirodotdev/KiroCrew#23167) - find a decision answer folded into a merged queue-drain row by every folded id, so it is not dispatched twice (kirodotdev/KiroCrew#33324) - refuse a name, slot key or hash ending in a newline (kirodotdev/KiroCrew#34740) - deliver a restored note hold above the next turn's row on a gateway without the chat slot seam (kirodotdev/KiroCrew#36128) - move the earlier decision record only as a regular file with one name, and settle an empty one when there is none, so a file planted at the old location later is never imported (kirodotdev/KiroCrew#33589) The test dependency moves to Kiro Crew af94fac51f so the new host names resolve where the suite runs; the tests the built-in added with these changes come along.
Port every backend change the built-in took after the snapshot this repository was ported from, so an adopted user runs them: - put a popped worker slot back only onto a free key (kirodotdev/KiroCrew#31829) - keep pasted blocks and the send id on the stored user row, queued or not, with the id checked by the host (kirodotdev/KiroCrew#31799, kirodotdev/KiroCrew#23167) - find a decision answer folded into a merged queue-drain row by every folded id, so it is not dispatched twice (kirodotdev/KiroCrew#33324) - refuse a name, slot key or hash ending in a newline (kirodotdev/KiroCrew#34740) - deliver a restored note hold above the next turn's row on a gateway without the chat slot seam (kirodotdev/KiroCrew#36128) - move the earlier decision record only as a regular file with one name, and settle an empty one when there is none, so a file planted at the old location later is never imported (kirodotdev/KiroCrew#33589) The test dependency moves to Kiro Crew af94fac51f so the new host names resolve where the suite runs; the tests the built-in added with these changes come along. Co-authored-by: KiroCrewCaptain <312312717+KiroCrewCaptain@users.noreply.github.com>
Port the page changes the built-in took after the snapshot this repository was ported from: - forward the chat embed's collapsed pastes and send id with a spec chat message, so the stored row keeps each paste chip and the embed reconciles a send by identity (kirodotdev/KiroCrew#31799, kirodotdev/KiroCrew#23167) - keep every write button focusable while its own request runs: it reads aria-disabled and ignores the press instead of turning natively disabled (kirodotdev/KiroCrew#33001, kirodotdev/KiroCrew#33808) The committed bundle is rebuilt from the source. Co-authored-by: KiroCrewCaptain <312312717+KiroCrewCaptain@users.noreply.github.com>
Problem / Motivation
Goal: A long paste sent from Spec Builder's chat keeps its
[ Paste #N · M lines ]chip in the stored user message, after a reload too.Since #21100, the embedded chat collapses a long paste into a chip and hands the block to the host's
onSendasmeta.pastes. Spec Builder's composer sends through its own message endpoint, which took only{ text }. So the bubble showed the chip while the send was in flight, then turned into the full multi-line text once the stored row landed, and stayed expanded after a reload.Why it matters
Spec Builder is where people paste the long things: stack traces, logs, requirement drafts. Without the chip, one paste turns the spec's conversation into a wall of text, and the same message looks different in Spec Builder than in the main chat.
Not a goal
meta.sendIdormeta.filesfrom Spec Builder'sonSend. The issue asks for the paste chip only.meta.pastesback into the chip.What changed (motivation → approach → change)
The stored user row lacked the paste blocks, so the transcript had nothing to fold the expanded text back into a chip with.
Spec Builder now does what the main chat does: the page forwards the embed's collapsed pastes, and the endpoint keeps them on the user row.
spec-builder/api.ts,components/SpecDetail.tsx,components/ChatColumn.tsx)onSend'smeta.pastesgoes toPOST /api/apps/spec-builder/specs/{name}/messageasmeta: { pastes }, the documented host shape. A send with no paste posts exactly the body it did before.orchestration/messages.py,runtime.py)meta.pasteslist rides the turn's user row asmeta.pastes, the wayPOST /api/chatstores it. A message sent while the spec's agent is still working carries the list on its queue entry, which the drain writes on the row. A message without one appends the same row it always did. Decision answers are unchanged.Backwards compatibility
Compatible:
metais optional on the wire, so older clients and every send without a paste keep their exact request and stored row.Removes nothing: the change only adds an optional field to one request and one row.
Tests
test_routes_coverage_lifecycle.py::TestHandleMessage::test_the_collapsed_pastes_ride_the_user_row: runs the real message handler and turn relay (the host chat runner stubbed). A message posted withmeta.pastesstores those blocks on its user row; a message without one stores a row with nometa. The shared fake slot'sappendnow keeps themetait is given.test_routes_coverage_workers.py::TestDispatchTurn::test_a_busy_slot_queues_the_message_meta_with_the_turn: a turn relayed to a busy slot queues itspasteson the entry'smeta. It fails with the queued branch reverted (KeyError: 'pastes').SpecBuilderSpecDetailCoverage.test.tsx: a chat send carrying pastes posts them asmeta.pastesbeside the text and the creation identity; the plain-send test asserts nometais sent.Proof: PROVEN src/kiro_crew/apps/builtins/spec_builder/tests/test_routes_coverage_lifecycle.py::TestHandleMessage::test_the_collapsed_pastes_ride_the_user_row[True] (head 19258737ebf1)
Determinism: the backend test 20/20 green at
-n0and 10/10 at-n 4 --dist loadgroup --max-worker-restart=2besidetest_routes_turn_lock.pyandtest_turn_provenance.py; all 77 ids of its file green in a shuffled order (seed 13383). The queued-entry test 20/20 green at-n0and 10/10 at-n 4 --dist loadgroup --max-worker-restart=2beside the rest ofTestDispatchTurn; all 97 ids of its file green in a shuffled order (seed 21147). The frontend file 10/10 green, and green with--sequence.shuffle --sequence.seed=14730.Ran: all of
src/kiro_crew/apps/builtins/spec_builder/tests/,test/test_core_spec_builder_decoupling.py,test/test_transcript_derivation_seam.py,test/test_chat_follow_default_slot_kinds.py,test/test_channel_persist_agent_metadata.py(1161 passed,-n 4) and the flake-pattern ratchet (66 passed), andsrc/apps/spec-builder/plusChatEmbed.longPaste.test.tsxin vitest (241 passed).tsc -p tsconfig.app.json, mypy, flake8, isort, black, eslint and the diff-scoped gates are clean.Manual verification
Captured with the real Spec Builder
ChatColumnandspecApiin a dev server, against a fetch stub that stores the user row the way each backend does (main: text only; this PR: text plus the postedmeta.pastes). A 13-line paste was pasted, sent, and the page reloaded so the stored row was read back. The capture asserted the chip on this PR's row and the full text on main's.Screenshots / video
The stored message after a reload, dark theme.
Before (main): the paste comes back as its full text.
After: the stored message keeps the chip.
The composer before the send (same on both)
Related Issues
Closes #21147
Refs #21100
Touches the same Spec Builder send seam as #23167 (it forwards
meta.sendId); whichever lands second rebases.Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributed under the project's Apache-2.0 license.