Repository navigation
fix(dashboard): alias slots share one project directory - #25899
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS The root cause is fixed in the right place: aliases now hold one shared project cell, so the existing writers and rollbacks need no per-alias changes. Notes
[DESIGN-REVIEWED] e8cfc7e Description read[DESCRIPTION-READ] 44a865fd39251c09d00a86557e2387ff32a1c687c505c074474654b558060967 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 |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS The fix removes the cause: aliases now share one project cell. The remaining work (other join sites, other per-session fields) is deferred to #7497, which the description says. Notes
What this change shipsInventory (7 items) — 7 justifiedIntent: two tabs on one conversation keep one project directory, so saving one tab never erases the directory the other tab set. This is a FIX (#13099).
[FIRST-PRINCIPLES-REVIEWED] e8cfc7e Description read[DESCRIPTION-READ] dd2d7ee4626cea328d53e205bbd38bb037c781b739e1d9511ecd4b0bc5997050 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: |
6409967 to
355bccb
Compare
|
|
Rebased: main moved in files this PR imports or shares a directory with ( |
355bccb to
a8f841a
Compare
|
The three red tests on this head ( |
a8f841a to
cc2df4f
Compare
|
self-added: yes
|
cc2df4f to
cbc0ddc
Compare
|
self-added: yes
|
|
cbc0ddc to
f86625b
Compare
f86625b to
104af98
Compare
104af98 to
e8cfc7e
Compare
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Approved on behalf of the watch holder (bolichen). Design and First Principles pass on this head, UX skipped or pass, no conflict, no open change request.
Problem / Motivation
Goal: Two chat tabs that share one conversation also share one project directory, so saving one tab never erases the directory the other tab set.
Two live slots that resolve to one transcript (aliases) also run one session and one working directory. Yet each held its own
projectcopy. A blank alias's forced save wroteproject: ""over the directory its peer had just stored (#13099).Why it matters
A user who sets a project in one tab of a shared conversation loses it as soon as the other tab saves. The next restore comes back with no project, so turns run in the wrong directory without warning.
Not a goal
memory_store,agent_kind,autocompact_pct,turn_timeout_secs) into the binding."".What changed (motivation → approach → change)
Root cause:
projectis per-session state, but it lived in a per-slot cell.Approach: aliases hold the SAME cell. A new
TranscriptBindingobject holdsproject, and_ChatSlot.projectis now a property over it. A new slot starts with a private binding.bind_transcript(state, slot)(new,dashboard/transcript_binding.py) runs inget_or_create_slotonce the slot's history key is final. It adopts a live alias's binding (the live peer wins), copies the value when a slot leaves a group, and otherwise leaves it alone. It also runs at the end ofmetadata_codec.apply, after the link row, so tabs restored or resumed from disk rejoin their alias group. A joiner or a disk seed fills a peer that never chose a directory, and arms the deferred reset when that moves a running session.Because the cell is shared, the existing writers need no change:
slot.project = xwrites the group's value, and each_CommitTokenrollback (slot.project is token) skips a peer's newer write and restores the group otherwise.Two places had to follow the sharing:
channel_slots.pysurface) and restore read (slot_persistence/metadata_codec.py_read_project)_CommitTokenrollbacks (chat_api/agent_switch.py,chat_api/session_relaunch.py)rollback_projectrestores the directory and whether it was chosen, still only while the token is the valuechat_api/session_relaunch.py,crewmate_worktree_scope.py,handlers/members_thread.py,session_directive_apply_slot.py)arm_project_resetarms the reset on every live alias, andbind_transcripthands a still-pending reset to a slot that joins, so no alias's next turn reuses the process in the old directoryBackwards compatibility
Compatible: a slot that never aliases keeps a private binding and behaves exactly as before; every caller still reads and writes
slot.projectas a string.Removes nothing: no key, field, route or check is removed;
projectis still read and written under the same name and persisted the same way.Tests
test/test_alias_slot_shared_project.py(new) pins: the #13099 repro (a blank alias's save keeps the peer's directory); a clear on one alias stays a clear; a joining slot adopts the live peer; a slot on its own transcript keeps its own value; leaving a group copies the value; both rollback outcomes across aliases, and a rollback restoring the unchosen state while a concurrent clear stays a choice; disk seed and restore read do not overwrite a chosen shared directory or clear, but still seed a lone slot or an unseeded alias; a project change arms the reset on every alias (helper and theset_projectdirective), and a slot that joins while that reset waits inherits it; thecopy.copyedit-resend and rewind paths never writeproject; two tabs restored throughmetadata_codec.applyrejoin one binding.test/test_state_parts_facade.py: the slot inventory now lists_bindingand theprojectproperty.test/test_cleared_project_not_resurrected.pypasses unchanged (a real clear still writes"").Determinism: the new file passed 10 of 10 repeats and in a shuffled order.
Proof: PROVEN test/test_alias_slot_shared_project.py::test_blank_alias_save_keeps_peer_project, test/test_alias_slot_shared_project.py::test_a_joining_slot_adopts_the_live_peers_directory, test/test_alias_slot_shared_project.py::test_a_rollback_with_no_peer_write_restores_the_group, test/test_alias_slot_shared_project.py::test_a_restore_read_does_not_overwrite_a_shared_binding, test/test_alias_slot_shared_project.py::test_the_set_project_directive_arms_the_peer (head e8cfc7e)
Manual verification
N/A — unit coverage sufficient: the change is in-memory slot state and its two persistence readers, which the tests drive through the real
DashboardState,get_or_create_slotand_save_slot_to_history.Related Issues
Part of #13099
Refs #7497
Sibling sweep
Swept: git grep -nE ".linked_session_key = |.channel_origin = " -- src/kiro_crew
Sibling: src/kiro_crew/dashboard/state_parts/slot_directory.py -- changed here
Sibling: src/kiro_crew/dashboard/channel_slots.py -- tracked in #7497
Sibling: src/kiro_crew/dashboard/chat_api/resume.py -- changed here -- joins through metadata_codec.apply
Sibling: src/kiro_crew/dashboard/cron_inject.py -- tracked in #7497
Sibling: src/kiro_crew/dashboard/handlers/cron_runs.py -- tracked in #7497
Sibling: src/kiro_crew/dashboard/workflow_inject.py -- tracked in #7497
Sibling: src/kiro_crew/dashboard/slot_persistence/metadata_codec.py -- changed here
Pattern harvest
Rule candidate: review-prompt
Pattern: per-session state stored once per slot, so alias slots on one transcript hold divergent copies
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)