Repository navigation
fix(hooks): fire SessionLaneChanged when a new chat inherits a lane - #36132
Conversation
Sensitive Change Review
|
UX Review (Opus 5.5) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. The fix calls the existing dispatcher, permit gate and confirming save ( What this change shipsInventory (5 items) — 5 justifiedIntent: when a person starts a chat inside a folder whose tags include a board lane, their
[FIRST-PRINCIPLES-REVIEWED] 88ef828 Description read[DESCRIPTION-READ] d310458754687b88a4033cd5905cf868be1511e9a1c1c129123190ca3699e8ab 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 create route now calls the tag routes' existing dispatcher, permit gate and confirming save, so it adds no new mechanism. Notes
[DESIGN-REVIEWED] 88ef828 Description read[DESCRIPTION-READ] 7fd2cbe4dc7b90a1d621c253c307e0fcdab3eaa05b82aa9f9f7b7cd55668b6ff 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 |
Code change approver recommendation: ApproveWhy: the decider estimates a 12% chance that this change introduces a defect, within the 12% limit for approving on its own, and every check passes. The create route now records (prior_tags, new_tags) under tags_write_lock only when inherited folder tags were actually appended to a new slot. When they were, it saves through the tag routes' confirming _persisted_tag_write, and after the create block's last refusal it dispatches through the existing dispatch_session_lane_changed_bulk. The dispatcher's existing gate (_lane_dispatch_is_permitted) lets only the dashboard user fire it, so agent, app and member creates stay silent, and it fires only when status tags change, so label-only folders stay silent too. The save behaves the same as before: with best_effort=True a failure is swallowed and the slot marked dirty; in confirming mode _persisted_tag_write catches the error and marks it dirty itself, so the periodic flush still retries. The only new effect is that a failed save holds the hook back. The new tests go through the real create route: a lane folder fires once with the lane in An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit |
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: |
756662f to
f3470e6
Compare
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: |
f3470e6 to
62208c5
Compare
|
Rebased: main moved in src/kiro_crew/dashboard/chat_api/slot_create.py, src/kiro_crew/dashboard/chat_tags.py and test/test_reply_format_once.py since this head went green (2f7e9f2 -> fb49a0c); CI re-running. Backend Tests shard 8 (Linux and Windows) was red only on |
|
|
[operator: bolichen97] The two red checks on this head are main's, not this PR's. The fix is #36457 (tracked in #36458). This PR waits for it: once it merges, the branch is re-synced onto it and CI runs again. No code change here. |
62208c5 to
47c8e67
Compare
47c8e67 to
732e909
Compare
|
[operator: bolichen97] Rebased onto current main to resolve the merge conflict in |
732e909 to
fcff8bc
Compare
|
[operator: bolichen97] Rebased onto current main; it applied cleanly and the change itself is the same diff as before. The red checks on the previous head were On the new head the related tests (473 across the hook, slot-create and folder-tag modules) and the formatting, lint and type checks pass locally, and the new test still fails with the fix reverted. |
|
[operator: bolichen97] The red The fix is #39479 (for #39478). This PR waits for it with no push, and its failed jobs re-run once that fix lands. |
fcff8bc to
f1cc4a7
Compare
|
Rebased: main moved in docs/system-specs/modules/memory-skills-hooks.md and src/kiro_crew/docs/steering-and-hooks.md since this head went green (3b4e971 -> 3688176); CI re-running. The new base carries #39479, the fix for the [operator: bolichen97] |
A new chat filed into a folder copies the folder's tags. When one of them is a status tag the session lands in that board lane, but the create route never reached the dispatcher the two tag routes call, so a hook keyed on entering the lane never ran for it. The create route now dispatches the inherited change through dispatch_session_lane_changed_bulk, after its last refusal and only once its save has confirmed, the same placement the tag routes use. The dispatcher's status-only diff and permit gate decide the rest. Closes #31614
f1cc4a7 to
88ef828
Compare
|
Rebased: main moved in .github/workflows/codeql.yml, .github/actions/gh-rate-limit and src/kiro_crew/dashboard/chat_api/slot_create.py since this head was pushed (3688176 -> ed4b40c); CI re-running. The only reds on the previous head were both CodeQL Analyze jobs failing to upload results on the shared API rate limit (and PR Readiness folding them). Main has since made that upload wait for the rate-limit reset, so this rebase picks that fix up. The change itself is unchanged (identical patch); the related backend tests pass locally on the rebased head (535 passed), with black, isort, flake8 and mypy clean on the touched files. [operator: bolichen97] |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
I reviewed head 88ef828 on its merits. The create route now calls the same lane dispatcher, permit gate and confirming save that the two tag routes use. It fires only for a brand-new session that actually inherited a folder tag, and only after the create has passed its last refusal and its save has committed. The related tests pass on this head: the emitter module, the folder-create, folder-tag and tag-route suites, and the facade mirror guards. The new tests are meaningful: removing the dispatch fails the fire-once test, and removing the confirmed-save guard fails the save-failure case. The remaining ordering window against a concurrent retag is the same one the existing tag routes already have, and the event is informational, so nothing blocks.
Problem / Motivation
Goal: A new session filed into a folder whose tags include a board lane fires
SessionLaneChanged, so a hook keyed on entering that lane sees it.SessionLaneChangedfires from the two dashboard tag routes,PUT /api/chat/slots/{slot}/tagsandPOST /api/chat/slots/{slot}/drop. A new chat created inside a folder copies that folder's tags, and when one of them is a status tag the session lands in that lane with no event. The owning spec records it as a known gap.Why it matters
Anyone who files new chats into a folder that carries a lane (a "Triage" folder whose chats start in a Triage lane) never sees their hook run for those chats. A hook keyed on entering the lane silently misses every session that started there, so an automation built on the event has to keep polling the board anyway.
Not a goal
surface_channel_session): it has no dashboard caller, so what authorizes a fire there is still undecided.What changed (motivation → approach → change)
A new session in a lane-tagged folder entered that lane without the event, because the create route copies the folder's tags itself and never reached the dispatcher the tag routes call.
The create route now calls that same dispatcher,
dispatch_session_lane_changed_bulk, with the tags the session held before the copy and after it. The dispatcher already fires only for a change in status tags and already refuses a caller that is not the dashboard user, so a label-only folder, an already-open session addressed by name (which inherits nothing) and an agent's create stay silent with no new check.It fires at the same point the tag routes do: after the create has passed its last refusal and its save has confirmed. When the create inherited a tag, its save takes the tag routes' confirming mode (
_persisted_tag_write), so a save that failed fires no hook at all; the periodic flush still retries the save. The owning spec and the hook events table insteering-and-hooks.mdlist the create as the third emit site.Backwards compatibility
Compatible: a create that inherits no status tag behaves exactly as before; one that does now also fires the hook a person registered for that lane.
Removes nothing: the diff only adds a dispatch call and switches one save to its confirming mode, which keeps the same retry on failure.
Tests
test/test_session_lane_changed_emitter.pydrivesPOST /api/chat/slotswith the vocabulary built by the real tag route:added;Determinism: the new class passed 20 runs at
-n0and 10 at-n 4 --dist loadgroup --max-worker-restart=2besidetest_session_lane_changed_event.pyandtest_chat_slot_create_folder.py, and the whole module passed in a shuffled order (seed 9539, 19 ids).Proof: PROVEN test/test_session_lane_changed_emitter.py::TestANewSessionInheritingAFolderLane::test_inheriting_a_folder_lane_fires_once (head fcff8bc)
Manual verification
On Ubuntu 24.04.5 LTS, an isolated gateway (a throwaway
KIROCREW_HOME, a loopback port) driven over HTTP as the dashboard user, with one enabledSessionLaneChangedhook that appends its payload to a file:mainPOST /api/chat/slotsinto a folder carrying a lane and a plain tagPOST /api/chat/slotsinto a folder carrying only the plain tagPUT /api/chat/slots/<slot>/tagswith the lane (control)The payload the fixed build delivered for the first row:
Related Issues
Closes #31614
Sibling sweep
Swept: git grep -n "slot.tags.append|.tags = list(" -- src/kiro_crew/dashboard/
Sibling: src/kiro_crew/dashboard/channel_slots.py -- not affected -- channel first-filing (
surface_channel_session) and folder backfill (backfill_channel_folder) are deliberately silent: no dashboard caller, so the permit gate has no answer yet (RFC closing order step 2)Sibling: src/kiro_crew/dashboard/session_directive_apply_slot.py:551 -- not affected -- an agent's own tag directive, and an agent's move fires nothing by contract
Sibling: src/kiro_crew/dashboard/chat_fork.py:649 -- not affected -- fork emission is an open question in the RFC, not a recorded emit site
Pattern harvest
Not generalizable: a single writer of
slot.tagsthat predates the event; the RFC's choke point is the structural fix for the class.Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)