Repository navigation
fix(slack): clear early-exit working indicators through the turn helper - #25538
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. The fix sends the four hand-written clears through the existing helper, so the cause is gone and no copy is left in What this change shipsInventory (5 items) — 5 justifiedIntent: when a Slack turn ends before it runs, take down its "Working…" status and its Stop button. FIX.
[FIRST-PRINCIPLES-REVIEWED] 5067b8c Description read[DESCRIPTION-READ] 974572c97841edaba02af964e97fa4218e089f0a2f7187aa538ff82cc2177e96 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 four early exits now share the one clear helper. The local [DESIGN-REVIEWED] 5067b8c Description read[DESCRIPTION-READ] 1daec55267d06b04287a282742c4fffba686f5d708a959a25a52e3d7d4144f16 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: |
b2b65d7 to
f2df761
Compare
997cb18 to
f793936
Compare
|
HOLD (base) at f793936. This PR targets The change itself is small and looks right: the four early exits in To clear: merge #20353, retarget this PR to — crew-pr-reviewer (r134) |
f793936 to
0d18f4c
Compare
0d18f4c to
23a8cb9
Compare
_run_turn's four exits before the stream opens cleared the thread status and the Stop block by hand. Two never deleted the Stop block, the status clear was unguarded, and none set _indicators_cleared. Each now calls turn.clear_working_indicators(). Fixes #24947
23a8cb9 to
5067b8c
Compare
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Tier 1 auto-approve: fix (4 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, security checklist all-NO, no reviewer-lane findings, readiness signal fresh for this head SHA, declared category matches the diff. Category: the Slack turn's early exits (cancel, stop before replay, turn ceiling, shutdown) now call the shared clear_working_indicators helper, so the Stop block is deleted as well as the status; tests added.
Problem / Motivation
Goal: Every exit
_run_turntakes before the stream opens takes down the "…is working" status and the Stop block throughturn.clear_working_indicators()._run_turnhas four early exits that clear the indicators by hand: cancelled before the LLM call, stopped before a compaction replay, the turn ceiling, and the gateway shutting down (SessionClosingError). Their copies differ from the helper and from each other:_indicators_cleared.Why it matters
A message cancelled before its LLM call, or dropped because the gateway is shutting down, leaves a "Working…" block with a Stop button for a turn that never ran.
Not a goal
_deliver_answerand the cancel arm already use the helper (fix(slack): clear working indicators on CancelledError mid-stream #20353).Intended? / Repro
Intended? No.
clear_working_indicatorsis documented as the one place that takes down the status and the Stop block (slack/handler_runtime/turn.py, added in #20353). The turn-ceiling exit's own comment says the Stop block must be deleted on the way out because the turn never opened; the same holds for the cancelled and shutdown exits, which skip the delete.Repro (code path on main
76685f225e):_run_turn,post_blocks).sessions.is_cancelled(...)is True before the LLM call: the exit callsset_thread_status(..., "")and returns. The Stop block is never deleted.SessionClosingErrorfrom the turn gate.What changed (motivation → approach → change)
Symptom (Stop block left behind, unguarded clears) → cause (four hand-written copies of the clear) → change: each of the four exits calls
await turn.clear_working_indicators().turn._working_tsholds the same Stop block id as the local at each exit, so the helper deletes the right message. The helper's comment now names these exits among its callers.Backwards compatibility
Compatible: the same status clear runs on each exit. Two exits now also delete their Stop block, and a Slack error on the status clear no longer escapes
_run_turn; it is logged at debug, as in the helper's other callers.Removes nothing a user relies on: the Stop block it now deletes belongs to a turn that never ran.
Tests
TestEarlyExitsClearBothIndicatorsintest/test_slack_handler_working_indicators.py:begin_turnraisesSessionClosingError): both cleared.The native-handler golden digests for
cancelled_messagesandturn_ceiling_and_shutdownrecord what reaches Slack, so they change with the added Stop-block deletes. They are updated from this PR's CI run.Proof: not provable -- other: this host runs no tests locally; CI runs the new tests
Manual verification
N/A. No UI code changes; the tests drive the real
handle_messageagainst the mock Slack client.Related Issues
Fixes #24947
Follow-up to #20353 (merged), which added
clear_working_indicators.Sibling sweep
Swept:
git grep -n 'set_thread_status(.*"")' -- src/kiro_crew/slack/Sibling: src/kiro_crew/slack/handler_runtime/turn.py -- changed here (the four early exits)
Sibling: src/kiro_crew/slack/handler_runtime/turn.py -- not affected --
clear_working_indicatorsitselfSibling: src/kiro_crew/slack/handler_runtime/delivery.py -- not affected -- already calls the helper (#20353)
Pattern harvest
Not generalizable: the helper's comment names every caller, and no inline status clear is left in
handler_runtime/.Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license.