Repository navigation
fix: backport #32498 to 0.12.1 (skip a repeated synthesis report) - #32835
Conversation
…32498) When a fan-out's results reach the parent over two or more completion turns, the fire gate always ran a separate synthesis turn, even when the turn that took the last result had already written the consolidated report. The user then got the same report twice. The completion that arms the synthesis (the batch's last outstanding result) now ends with SUBAGENT_FINAL_COMPLETION_NOTE, which asks the model for the consolidated report in that reply. Every turn end records in slot._synthesis_final_turn_ran whether the newest turn took that note, landed and left visible reply text; _drop_single_turn_synthesis also drops the arm for a multi-turn batch when it is set. A quiet end, a failed turn or a reply with no text still gets the synthesis. One-turn batches are unchanged. The flag resets wherever the turn count does. (cherry picked from commit 0b75594) src/kiro_crew/dashboard/chat_turn/queue_cycle.py hand-resolved: kept only this PR's _synthesis_final_turn_ran block after the _TurnOutcome record; the consumption-stamp block beside it on main belongs to a main change not on release. The same block assigns through turn.slot: release's _turn_record_outcome has no slot local; main's comes from #17165 (feat), which is not a prerequisite here.
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: this is a faithful backport, and its one hand-resolved line ( Notes
[DESIGN-REVIEWED] ae2ad67 Description read[DESCRIPTION-READ] b1bae0cae46080fba4ba29da4ce39a53fb0de3d6931086345fddedbb6bc4d094 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 This is a straight backport of a reported duplicate-report defect, and every item is part of that fix; nothing rides along. What this change shipsInventory (5 items) — 5 justifiedIntent: a user whose sub-agent results arrive over several turns gets the consolidated report once, not again from an extra synthesis turn. This is a FIX, backported from
[FIRST-PRINCIPLES-REVIEWED] ae2ad67 Description read[DESCRIPTION-READ] 5123132a5d53ff14cbe594c0518348c5c267b433ed6f041f158222a4b0484d05 That sha256 names the PR description this verdict read. Recompute it with |
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: |
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: |
Problem / Motivation
Goal: Bring #32498 (after a fan-out whose results arrive over several turns, the user gets the consolidated report once, not a second copy from a synthesis turn) from
mainontorelease/0.12.0, as one commit in a PR of its own.Why it matters
Reported by plasene (Slack, item 3.3). On 0.12.0, when a parent takes its sub-agents' completion events over two or more turns, the injected
[SYSTEM] Sub-agent synthesis: ...prompt fires even when the turn that took the last completion already wrote the consolidated report. The user gets the same report twice, and the second costs a full extra turn.The faulty line is on
release/0.12.0@24a7f631f0:src/kiro_crew/dashboard/chat_turn/queue_cycle.py:151if slot._synthesis_completion_turns != 1: return Falsefires the synthesis for every multi-turn batch.Not a goal
main; nothing is changed only here.CHANGELOG.mdchange.What changed (motivation → approach → change)
Main squash commit
0b755947b8was cherry-picked with-xontorelease/0.12.0@24a7f631f0asae2ad67000. Thedocs/system-specs/common/injected-messages.mdanddocs/system-specs/modules/subagent.mdupdates ship with it.One production hunk is hand-resolved, in
src/kiro_crew/dashboard/chat_turn/queue_cycle.py_turn_record_outcome:feat: merge a fork back into its parent chat), which is not on release. Only this PR's_synthesis_final_turn_ran = (...)assignment is kept; #17165 is not picked, because it is a feature._turn_record_outcomehas noslotlocal (main's comes from #17165), so the assignment writesturn.slot._synthesis_final_turn_raninstead ofslot._synthesis_final_turn_ran.turn.slotis the same_ChatSlot(_ChatTurn.slot,chat_turn/turn_locals.py:71).Every other file has added and removed lines identical to the main commit. The commit is authored with the public identity (the main commit's author email is not a public one).
builder-security checked: no bind, listener, route, auth mechanism or storage grant changes.
Backwards compatibility
Compatible: one-turn batches are unchanged; a quiet end, a failed turn or a reply with no text still gets the synthesis.
Removes nothing: no setting, key or caller is removed.
Tests
Proof: not provable -- other: a backport of a main commit whose proof ran on its own PR
release/*, so the related set was run here: every touched test file, every test file that imports a touched module, and the tests that read the touched docs, 319 files,-n 4 --dist loadgroup. 10779 passed, 5 xfailed, 2 failed:test_stop_hook_continuation.py::TestRealHookProcess(2 tests), which fail the same way on a cleanrelease/0.12.0@24a7f631f0on this host. The PR's own tests intest_chat_runner_coverage_queue.pyandtest_gateway_subagent_injection.pypass, including the ones that drive_turn_record_outcome.slotname before the hand port).Manual verification
N/A - verified on its own main PR. The 0.12.1 RC soak is the end-to-end check.
Screenshots / video
N/A - no frontend file changes.
Related Issues
Backport to the 0.12 line for 0.12.1 of #32498.
Sibling sweep
Siblings: none -- the source PR carried its own sibling sweep; this PR only carries that fix.
Pattern harvest
Not generalizable: this PR only carries a fix already on
main. The source PR has its own harvest.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; see the Licensing section of CONTRIBUTING.md.