Repository navigation
fix: name the running reply's own project after a reload - #31229
Conversation
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the server already knows which directory the running turn is in, so having it publish that reading fixes the cause, the new fields are additive, and older gateways still get the old snapshot. [DESIGN-REVIEWED] cd7fa62 Description read[DESCRIPTION-READ] 25f9426e30731f15e9e18b523c6a7a16cbf80afcc0bdfe86f584f811e32d1ea9 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 |
7f0961c to
5279646
Compare
5279646 to
38ba16a
Compare
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing blocks: the diff adds no control or string, only feeds the server's project into the existing tooltip and badge. The blind reader read the reload state (shot-02) correctly and was sure of it. Notes
[UX-REVIEWED] cd7fa62 Description read[DESCRIPTION-READ] db1db5d6e5e00e6f4f3efdf627002075c342349c229a5d03f4daab24ebc90edb That sha256 names everything this verdict read: the PR description, plus the 17 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 |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. The fix is aimed at the cause the description names: until now only the server knew the running turn's directory. Every new field has at least one real consumer. Notes
What this change shipsInventory (6 items) — 5 justifiedIntent: after a reload or reconnect mid-reply, the project chip's tooltip names the directory the running reply actually works in. This is a FIX (#20352).
[FIRST-PRINCIPLES-REVIEWED] cd7fa62 Description read[DESCRIPTION-READ] f7659417b0d2625b331d92967c4c5b70f5d552f4137752162fbe40e4988107d4 That sha256 names the PR description this verdict read. 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: |
38ba16a to
0f75aff
Compare
|
CI fix: |
0f75aff to
27cc8d0
Compare
27cc8d0 to
c75a575
Compare
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Thanks for the rebase. On head 63c6281, one item from the earlier review still blocks merge.
Earlier review:
- Stacked commit ahead of #31080: fixed. #31080 merged, and this head is now one commit on top of main.
- Visual evidence: still open. See item 1.
- The attached frames do not show the reload path this PR changes (
website/capture/project-chip-mid-turn.tsx:53). All 8 frames come from this capture page, and this PR does not change it. Its<ChatInput>passesisRunning,projectLockedandproject, but neverturnProjectorturnProjectFallback. It also models the pick as a click in the same session, not as a remount. WithturnProjectundefined, the new branch inuseStagedProjectnever runs, so the frames show what main already renders. The UX review on this head also says it cannot evaluate. It names three gaps: the tooltip after a reload onto a staged pick, the pending badge after a reload (full and compact), and no false badge after a hidden-scratch fallback. Fix: add a?reload=1mode that mountsChatInputwithprojectset to OtherRepo andturnProjectset to KiroCrew. Add a?fallback=1mode with a scratchproject, aturnProject, andturnProjectFallbackset. The page already prints the chip's accessible name, so the tooltip text appears in the frame even though a native tooltip does not. Attach frames of the reload case before (main) and after (this head), full and compact, plus the fallback frame. Then re-run the UX review on the current body.
Optional:
- The fallback flag on the deferred-reset re-pin (
src/kiro_crew/dashboard/chat_turn/turn_admission.py:1175) has no test. Changingbool(_fallback)toTruekeeps every test green. Asserting thatturn_project_fallbackis false intest_deferred_reset_turn_describes_the_reused_process_directorywould pin it. - The Proof line still names head 7f0961c and lists registry tests. If you re-run it on this head and include
test_summary_names_the_turn_project_after_a_mid_reply_pick, it will show the tests that fail without the fix. - The Backwards compatibility line says one summary key and one prop, but the diff adds two of each (
turn_project,turn_project_fallback,turnProject,turnProjectFallback). The fallback paragraph could also say that a real pick shows no pending badge after a reload.
63c6281 to
c8b1de1
Compare
|
Follow-up on the 11-14 22:15Z review, now on head c8b1de1 (still one commit, same base). Blocking: the frames did not show the reload path. Fixed.
Optional items, all done:
Local on this head: 40 backend tests and 19 vitest tests pass; tsc, eslint, black and the line-cap check are clean. Re-requesting your review; the UX lane re-runs on the current body. |
c8b1de1 to
955114b
Compare
|
Head 955114b, in answer to the Opus review on c8b1de1 and the brand gate.
|
a8c1794 to
8a48660
Compare
|
Head 8a48660, in answer to the GPT 6.1 review on a8c1794 (also rebased onto current main earlier, patch-id unchanged, to clear a Semgrep red that came from the stale base).
|
|
Thanks for the follow-ups. On head 8a48660 the review found no blocking issue in this diff. Merge waits only on a red PR Readiness, and that red comes from main. Earlier review items:
What the review checked on this head: the turn pin is written after the claim at all three admission sites. Red checks: Backend Tests shards 2 and 8 (Linux), shards 2 and 5 (Windows) and Coverage Gate fail in Done well: the server pins the running turn's directory and tags the pin with its turn generation, so a pin left over from an earlier turn can never name the current one. Optional:
|
Withdrawn: every item in this review is fixed or answered on the current head (see the follow-up comment). Other holds on this PR are listed there.
The slot summary now carries turn_project, the directory the running turn's process works in, pinned at session claim with its turn generation (the reused process's cwd under a deferred reset), and turn_project_fallback for a hidden-scratch fallback. The composer prefers it over its start-of-response snapshot, so a reload, reconnect or move between running chats after a mid-reply pick names the reply's project, not the pick. Closes #20352.
8a48660 to
cd7fa62
Compare
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
On head cd7fa62 the review found nothing that blocks merge. This head is the same patch as 8a48660 rebased onto current main, and PR Readiness passes.
Earlier review items:
- Stacked commit ahead of #31080: fixed. #31080 merged, and this head is one commit on top of main.
- Visual evidence: fixed. The capture page has
?reload=1and?fallback=1modes, the before and after frames are attached, and the UX and Design reviews pass on this head. - Reload-path frames: fixed, as above.
What the review checked on this head: the turn pin is written at all three admission sites (start of turn, hidden-scratch fallback, deferred reset). _running_turn_pin returns null for another turn generation or a slot that is not running. With no turnProject, useStagedProject behaves as it does on main. Each pin site and the newest pending-baseline rule has a test that fails when its line is reverted. The new field is registered in the facade, running-readers and golden tables and in the spec. Done well: the pin carries its turn generation, so a pin left over from an earlier turn reads as null and never as wrong data.
Optional:
- The Proof line still names a8c1794, and the pending-baseline rule in
stagedProject.tsx:102changed after that. It also cites abool(_fallback)mutation that does not appear inturn_admission.py. Re-running the listed tests on cd7fa62 and updating the line is a body edit only. - No test covers the slot-to-composer wiring (
ComposerDockView.tsx:703,ChatPane.tsx:1423). One case inChatPage.composerDock.test.tsxwithproject: B, turn_project: Awould catch a dropped prop. slot._turn_project_pinis written three times inturn_admission.py(1139, 1175, 1183). A single write after the deferred-reset block would be simpler, and it would also close a short window where a summary names the staged pick.
Builds on #31080, which has merged; this diff is the single fix commit on top of main.
Problem / Motivation
Goal: After a reload or reconnect mid-reply, the composer's project chip tooltip names the project the running reply actually works in, not a project picked while it ran.
Start a reply in project A, pick project B while it runs, then reload the page. The chip's tooltip says the current reply finishes in B. The reply's kiro-cli process is still in A.
ChatInputtakes its start-of-response snapshot from the slot's liveproject, which already follows the pick, so any remount during the reply reads the pick.Why it matters
The mid-reply note exists so a user who switches projects knows which directory the running reply's file links and edits belong to. After a reload, reconnect or a move between running chats, it states the wrong directory, which is the exact confusion the note is meant to prevent.
Not a goal
What changed (motivation → approach → change)
Symptom: a remount takes the start-of-response snapshot from
project, which a mid-reply pick has already moved. Root cause: the browser has no authoritative reading of the running turn's directory; only the server knows it.Change: turn admission (
src/kiro_crew/dashboard/chat_turn/turn_admission.py) pins(turn_generation, project)on the slot when the turn claims its session, and re-pins the reused process'scwdwhen a reset is deferred (sub-agents attached). The pin is a new_ChatSlotfield (src/kiro_crew/dashboard/state_parts/chat_slot.py, initialised inslot_turns.py).src/kiro_crew/dashboard/slot_projection.pypublishes it asturn_project, null unless a turn is running in the generation the pin was taken in, so a pin from an earlier turn never names the current one. On the frontend,ChatSlot.turn_project(website/src/types/index.chat.ts) is passed bywebsite/src/pages/chat/page/ComposerDockView.tsxas the newturnProjectprop (website/src/components/chat-input/props.ts), andwebsite/src/components/ChatInput.tsxpasses it into #31080'suseStagedProject(website/src/components/chat-input/stagedProject.tsx), which prefers it over its local snapshot, keeping the snapshot only while the server has no reading (older gateway, or a turn not yet claimed). Both the mid-reply note and the pending badge therefore follow the server's reading, so after a reload onto a staged pick the chip still shows the pick as pending. The new slot field is listed in the facade, running-readers and spec tables.Backwards compatibility
Compatible:
turn_projectandturn_project_fallbackare new optional summary fields; an older gateway omits both and the composer falls back to its existing snapshot.Removes nothing: the diff only adds a slot field, two summary keys and two optional props (
turnProject,turnProjectFallback).Tests
test/test_chat_runner_mid_turn_project.py::test_summary_names_the_turn_project_after_a_mid_reply_pick: after a mid-reply pick the summary'sturn_projectstays the claimed directory whileprojectfollows the pick.test/test_chat_runner_mid_turn_project.py::test_turn_project_pin_from_another_generation_names_no_turn: a pin from an earlier turn generation reads as null.test/test_chat_slot_facade_contract.py,test/test_state_parts_facade.py,test/test_slot_running_readers.py: the new slot field and summary key are registered in the facade contracts and the running-readers table.website/src/test/ChatInput.turnProject.test.tsx: remount onto a mid-reply pick names the turn project and still shows the pending badge; aturn_projectarriving after mount (reconnect) is taken; a fresh turn in B reports B with no pending badge; moving between running chats names each chat's own turn project; the snapshot stays while the server has no reading.Proof: run on head a8c1794:
test/test_chat_runner_mid_turn_project.py(includingtest_summary_names_the_turn_project_after_a_mid_reply_pick,test_summary_names_the_fallback_directory_after_a_hidden_scratch_projectandtest_deferred_reset_turn_describes_the_reused_process_directory, which now also pinsturn_project_fallbackfalse: changingbool(_fallback)toTruefails it),test/test_chat_slot_facade_contract.py,test/test_slot_running_readers.py,test/test_state_parts_facade.pyandtest/test_turn_golden.py(40 passed), plusChatInput.turnProjectandChatInput.stagedProjectvitest (19 passed).Local gate: black, subprocess-encoding, isort, flake8, mypy, comment-history, brand-name and file-line-cap pass;
npm run buildpasses;tsc --noEmitpasses; the frontend related set (572 files, 15,079 tests) passes on the rebased head. Backend related set: 59,765 passed. The backend reds are outside this diff and fail the same way at the merge-base on this host, so they were deselected:src/kiro_crew/apps/builtins/file_explorer/tests/test_server.py,test/test_design_tweak_backend.pyandtest/test_design_tweak_devproc.py(403 on the/local/homepath ancestry);test/test_crew_image_build_plan.pyandtest/test_mcp_slim_entry.py(libffi in subprocesses);test/test_dashboard_gallery_approvals.py(PlatformCompositionError in this sandbox);test/test_docker_entrypoint.py(libffi, two tests);test/test_living_ui_harness.py::test_the_dashboard_mode_reruns_under_the_runtime_python;test/test_find_ui_auto.py(the "Continue with GitHub" auto-tier path);test/test_kas_bundle.py::TestSpawnRoute(two tests),test/test_native_skill_projection.py::test_launch_record_resources_match_the_alias_file_kiro_cli_loadsandtest/test_auto_improvement_members.py::test_assignments_build_real_context_from_only_their_private_store.Hidden-scratch fallback: when the chat stores a hidden scratch folder, the turn runs in the default folder, so
turn_projectdiffers fromprojectwith no pick made. The pin keeps the stored scratch folder the turn fell back from, and the summary publishesturn_project_fallbackonly whileprojectstill names it.useStagedProjectthen keeps the stored project as its pending baseline, so no false "Starts next message" badge appears. A pick made over the scratch folder movesproject, the flag drops, and the pick is pending, also after a reload (vitest caseshows the pick as pending after a reload that follows a pick over a scratch fallback, and the projection unit test). The split-paneChatPanecomposer now gets both fields too. Tests:test_summary_names_the_fallback_directory_after_a_hidden_scratch_projectand theshows no pending pick when the turn fell back from a hidden scratch foldervitest case.Manual verification
N/A — unit coverage sufficient: the backend tests drive a real turn admission with a mid-reply pick, and the frontend tests remount the composer with the slot summary a reload produces. Not reproduced against a live reload.
Screenshots / video
The real
ChatInputproject chip with a reply running, rendered from a local capture page (website/capture/project-chip-mid-turn.tsx) with every/apicall stubbed, so no gateway was involved. One script starts vite in-process and drives it (website/scripts/capture-project-chip-pending.mjs). The page prints the chip's accessible name under the composer, because a native tooltip does not paint.Reload onto a staged pick (
?reload=1): the chat's project is already the pick (OtherRepo), as after a reload mid-reply, and the server reports the running reply's project (KiroCrew). Before is currentmain(no server reading: the chip names the pick as the reply's project and shows no badge), after is this head.Hidden-scratch fallback (
?fallback=1): the chat stores a scratch folder, the reply runs in KiroCrew, nobody picked anything. After: no badge, "This reply finishes in KiroCrew."Mid-reply pick in the same session (unchanged by this PR, from #31080), dark:
Related Issues
Closes #20352
Follow-up to #17729, part of #7263.
Sibling sweep
Swept: git grep -nE "turnStartProject|turn_project|useStagedProject" -- src/ website/src/
Siblings:
useStagedProjecthas two client readers, the main composer (ComposerDockView) and the split-pane composer (ChatPane); both now receiveturn_projectandturn_project_fallback. The server-side_turn_projectreaders already use the turn's own directory.Pattern harvest
Not generalizable: a client-side snapshot of server state that a remount retakes from already-moved state is specific to this staged-pick flow.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)