Repository navigation
fix(dashboard): a failing slots flush no longer 500s a committed create - #30730
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS The fix is at the right level: the suspend block's exit flush, which every block shares. Its siblings are noted below but do not block. Notes
What this change shipsInventory (6 items) — 5 justifiedIntent: a slot create that has already committed should not be reported to its caller as failed. This is a FIX (#8745).
[FIRST-PRINCIPLES-REVIEWED] 272432b Description read[DESCRIPTION-READ] 5d19c2a7991bbbb5deee57c7f2b86551a0995fcfad795635da1452a901425e09 That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS The take-away check found no reader that breaks: no in-tree code catches a raise from the exit flush, and source-link unlink's Notes
[DESIGN-REVIEWED] 272432b Description read[DESCRIPTION-READ] 43aa74d8b91453b6f4c71e6632ca4d30358f6f0b67712f518b9ace25d3ce02bd 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 |
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: |
9b97e2b to
40c5201
Compare
|
[operator: bolichen97]
|
40c5201 to
02b7b20
Compare
02b7b20 to
5a93d8a
Compare
|
Rebased: main moved in docs/system-specs/modules/learn-cron-dashboard.md (same file) and its docs/system-specs/modules/ directory since this head went green (7ecc6c9 -> 2f20f5b); the new base also carries #30984, which fixes the server lazy-import count pin that failed Backend Tests shard 6 on main. The commit itself is unchanged (range-diff =). CI re-running. [operator: bolichen97] |
A slot create that had already committed answered 500 when the slots broadcast after it failed on the coalescing window's leading edge, while inside the window the same failure was only logged and the create answered 200. The caller's answer was decided by a timer. suspend_slots_push now logs a failing exit flush instead of raising it, so every block's caller is answered as when the trailing timer carries the failure, and the flush cannot hide the body's own exception. A committed resume or import publishes its final push through such a block, so neither turns into a 500 after it landed. A direct push_slots_update() still raises, so callers that audit and retry a failed publication keep that signal. Closes #8745
5a93d8a to
272432b
Compare
|
Rebased: main moved in src/kiro_crew/dashboard/chat_api/resume.py, src/kiro_crew/dashboard/state_parts/slots_push.py and docs/system-specs/modules/learn-cron-dashboard.md (same files) since this head went green (2f20f5b -> 4d208a0). The commit itself is unchanged (range-diff =). The GPT 6.1 and Opus 5.5 lanes on the previous head stopped on a CI rate limit before posting a verdict; this push re-runs them. CI re-running. [operator: bolichen97] |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Approved by Crew Captain for the on-call: checks green, PR Readiness passed, review lanes clean on this head.
…te (#30730) A slot create that had already committed answered 500 when the slots broadcast after it failed on the coalescing window's leading edge, while inside the window the same failure was only logged and the create answered 200. The caller's answer was decided by a timer. suspend_slots_push now logs a failing exit flush instead of raising it, so every block's caller is answered as when the trailing timer carries the failure, and the flush cannot hide the body's own exception. A committed resume or import publishes its final push through such a block, so neither turns into a 500 after it landed. A direct push_slots_update() still raises, so callers that audit and retry a failed publication keep that signal. Closes #8745 (cherry picked from commit 31aa5b1) Original author: Bolin Chen
…te (#30730) A slot create that had already committed answered 500 when the slots broadcast after it failed on the coalescing window's leading edge, while inside the window the same failure was only logged and the create answered 200. The caller's answer was decided by a timer. suspend_slots_push now logs a failing exit flush instead of raising it, so every block's caller is answered as when the trailing timer carries the failure, and the flush cannot hide the body's own exception. A committed resume or import publishes its final push through such a block, so neither turns into a 500 after it landed. A direct push_slots_update() still raises, so callers that audit and retry a failed publication keep that signal. Closes #8745 (cherry picked from commit 31aa5b1) Original author: Bolin Chen
…te (#30730) A slot create that had already committed answered 500 when the slots broadcast after it failed on the coalescing window's leading edge, while inside the window the same failure was only logged and the create answered 200. The caller's answer was decided by a timer. suspend_slots_push now logs a failing exit flush instead of raising it, so every block's caller is answered as when the trailing timer carries the failure, and the flush cannot hide the body's own exception. A committed resume or import publishes its final push through such a block, so neither turns into a 500 after it landed. A direct push_slots_update() still raises, so callers that audit and retry a failed publication keep that signal. Closes #8745 (cherry picked from commit 31aa5b1) Original author: Bolin Chen
…te (#30730) A slot create that had already committed answered 500 when the slots broadcast after it failed on the coalescing window's leading edge, while inside the window the same failure was only logged and the create answered 200. The caller's answer was decided by a timer. suspend_slots_push now logs a failing exit flush instead of raising it, so every block's caller is answered as when the trailing timer carries the failure, and the flush cannot hide the body's own exception. A committed resume or import publishes its final push through such a block, so neither turns into a 500 after it landed. A direct push_slots_update() still raises, so callers that audit and retry a failed publication keep that signal. Closes #8745 (cherry picked from commit 31aa5b1) Original author: Bolin Chen
…te (#30730) A slot create that had already committed answered 500 when the slots broadcast after it failed on the coalescing window's leading edge, while inside the window the same failure was only logged and the create answered 200. The caller's answer was decided by a timer. suspend_slots_push now logs a failing exit flush instead of raising it, so every block's caller is answered as when the trailing timer carries the failure, and the flush cannot hide the body's own exception. A committed resume or import publishes its final push through such a block, so neither turns into a 500 after it landed. A direct push_slots_update() still raises, so callers that audit and retry a failed publication keep that signal. Closes #8745 (cherry picked from commit 31aa5b1) Original author: Bolin Chen
Problem / Motivation
Goal: A slot create that has already committed answers 200, not 500, when the slots broadcast that follows it fails, whichever side of the coalescing window that broadcast lands on.
The create finishes, the session exists, and then the owed slots broadcast runs. If that broadcast fails on the window's leading edge (an idle dashboard, one deliberate create with a folder or title), the caller gets a plain-text 500. Inside the 0.2 s window the same failure is only logged and the caller gets 200. A plain local New Chat already answers 200 and logs, because its broadcast runs after the response.
Why it matters
A 500 tells the caller the create failed when it did not. The dashboard sends no slot name, so a retry mints another session each time. Which answer the caller gets is decided by a timer, so no client can be written against it.
Not a goal
GET /api/chat/slotsand the WebSocket snapshot, which still raise with the offender note.What changed (motivation → approach → change)
A committed create could be told it failed. The slots broadcast is coalesced: the first push after a quiet spell broadcasts at once, later ones within the window wait for a timer. A failing broadcast on the timer was logged by the event loop, but one sent at once raised into whoever pushed, here the create handler at the end of its
suspend_slots_pushblock, after its writes were done.The
suspend_slots_pushexit flush logs a failing broadcast (traceback and offender note included) instead of raising it. That block is where a create, a resume, a fork, a member thread, a channel binding and the boot restore publish once their change is made, so each of them gets the same answer on either edge, and the flush cannot hide the body's own exception. A resume and an import end with one more push after they have committed; it now goes through the same block, so neither answers 500 after it landed. This takes the catch-and-log-at-the-flush option #8745 sets out, with both timing branches converging, and so reverses the "separate, declined question" noteTestDurableWriteOrderingcarried.A direct
push_slots_update()still raises, so a caller that audits and retries a failed publication (source-link unlink'sbroadcast_failedrow and itsfinalre-publish) keeps that signal. The[slots-flush]unwinding note goes: the flush no longer raises over the body's exception.The dashboard spec records the rule, and comments that described a raising flush in the create and resume handlers are corrected.
Backwards compatibility
Compatible: a suspend block whose exit flush raised a broadcast failure on the leading edge logs it instead, as the trailing edge always did; nothing that succeeds today is refused.
Removes nothing: the broadcast failure is still reported, with its traceback and offender note, in the log rather than to the caller; the dropped
[slots-flush]note annotated a raise the exit no longer makes.Tests
TestDurableWriteOrdering(both tests, renamed) asserts a leading-edge exit-flush failure answers 200 and is logged, and that the folder filing or pinned title was already on disk when the slots frame went out.test_leading_edge_serialization_failure_names_the_offenderasserts a directpush_slots_update()still raises the annotated TypeError, the raise source-link unlink's audit reads.test_flush_failure_during_unwind_leaves_the_body_exception_unmaskedasserts a body's own exception reaches the caller as raised while the broadcast failure goes to the log with its offender note.test_flush_failure_on_a_clean_exit_is_logged_with_its_offenderasserts a failing exit flush after a clean body is logged, not raised.test_a_failing_slots_broadcast_does_not_500_a_committed_resumeasserts a resume answers 200 when every broadcast fails on a leading edge, including its final push.test_a_failing_exit_flush_does_not_fail_materialisationasserts materialisation completes when its exit broadcast fails;test_flush_failure_at_construction_does_not_leak_the_reservationstill pins the rollback when the exit lets aBaseExceptionthrough.Proof: PROVEN test/test_chat_slot_create_folder.py::TestDurableWriteOrdering::test_the_folder_write_lands_before_a_failing_exit_broadcast, test/test_chat_slot_create_folder.py::TestDurableWriteOrdering::test_the_pinned_title_write_lands_before_a_failing_exit_broadcast, test/test_resume_publishes_hydrated_slot.py::test_a_failing_slots_broadcast_does_not_500_a_committed_resume (head b7e8b7dd7f5d)
Manual verification
N/A — unit coverage sufficient: the failure needs a non-serializable value in slot state, which the tests inject, and the HTTP tests drive the real create handler.
Screenshots / video
N/A — no frontend change.
Related Issues
Closes #8745
Sibling sweep
Swept: git grep -nF "suspend_slots_push()" -- src
Sibling: src/kiro_crew/dashboard/state_parts/slots_push.py -- changed here
Sibling: src/kiro_crew/dashboard/chat_api/slot_create.py -- changed here
Sibling: src/kiro_crew/dashboard/chat_api/resume.py -- changed here
Sibling: src/kiro_crew/dashboard/session_transfer_install.py -- changed here
Sibling: src/kiro_crew/dashboard/chat_fork.py -- not affected -- its block's exit flush is the shared one that now logs
Sibling: src/kiro_crew/dashboard/handlers/members_thread.py -- not affected -- its block's exit flush is the shared one that now logs
Sibling: src/kiro_crew/dashboard/session_control_parts/session_create.py -- not affected -- its block's exit flush is the shared one that now logs
Sibling: src/kiro_crew/dashboard/server_runtime/session_restore.py -- not affected -- its block's exit flush is the shared one that now logs
Sibling: src/kiro_crew/slack/code_channels/binding.py -- not affected -- its block's exit flush is the shared one that now logs
Pattern harvest
Not generalizable: the suspend block's exit is the one flush that publishes for a caller whose change is already made, and it is fixed there for every block; direct pushes keep raising for the callers that audit the failure.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)