Skip to content

fix: backport #32498 to 0.12.1 (skip a repeated synthesis report) - #32835

Merged
buluoray merged 1 commit into
release/0.12.0from
crew/slack/0.12.1-batch-56
Nov 8, 2026
Merged

buluoray merged 1 commit into
release/0.12.0from
crew/slack/0.12.1-batch-56

Conversation

@buluoray

@buluoray buluoray commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

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 main onto release/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:151 if slot._synthesis_completion_turns != 1: return False fires the synthesis for every multi-turn batch.

Not a goal

  • No fix that is not already merged on main; nothing is changed only here.
  • No version bump, no tag, no CHANGELOG.md change.

What changed (motivation → approach → change)

Main squash commit 0b755947b8 was cherry-picked with -x onto release/0.12.0 @ 24a7f631f0 as ae2ad67000. The docs/system-specs/common/injected-messages.md and docs/system-specs/modules/subagent.md updates ship with it.

One production hunk is hand-resolved, in src/kiro_crew/dashboard/chat_turn/queue_cycle.py _turn_record_outcome:

What Resolution
The conflict Main's hunk sits next to a durable consumption-stamp block from #17165 (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.
The one changed line Release's _turn_record_outcome has no slot local (main's comes from #17165), so the assignment writes turn.slot._synthesis_final_turn_ran instead of slot._synthesis_final_turn_ran. turn.slot is 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

  • CI does not run the backend suite on PRs into 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 clean release/0.12.0 @ 24a7f631f0 on this host. The PR's own tests in test_chat_runner_coverage_queue.py and test_gateway_subagent_injection.py pass, including the ones that drive _turn_record_outcome.
  • flake8 passes on the changed Python files (it caught the slot name 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

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

Contributions are accepted under the project's Apache-2.0 license; see the Licensing section of CONTRIBUTING.md.

…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.
@buluoray
buluoray requested review from a team and KiroCrewCaptain as code owners November 8, 2026 01:46
@buluoray
buluoray requested review from Zedmor and removed request for a team November 8, 2026 01:46
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 8, 2026
@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision ae2ad67000a76c086abec5516f52e2eecdee5651 touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Does not block merge.

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of ae2ad67000a76c086abec5516f52e2eecdee5651 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks: this is a faithful backport, and its one hand-resolved line (turn.slot) uses fields that _ChatTurn has on this base.

Notes

  • CI does not run the backend suite on PRs into release/*, so the only proof here is the author's local run of 319 related test files. Attach that run's output, or a CI run of the release branch, before tagging 0.12.1.

[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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of ae2ad67000a76c086abec5516f52e2eecdee5651 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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 ships

Inventory (5 items) — 5 justified

Intent: 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 main (#32498) to release/0.12.0.

  1. A batch whose results took two or more turns no longer runs the extra synthesis turn when the turn that took the last result already ended on a written reply — justified
  2. The completion that arms the synthesis now ends with a conditional note asking for the consolidated report in that reply — justified
  3. A per-chat flag records whether the newest turn wrote that report, and it is cleared wherever the turn count is cleared — justified
  4. A new exported constant, SUBAGENT_FINAL_COMPLETION_NOTE, with two production consumers (queue_cycle.py, subagent_injection.py) — justified
  5. The specs (injected-messages.md, subagent.md) are updated to describe the new drop rule — justified

[FIRST-PRINCIPLES-REVIEWED] ae2ad67

Description read

[DESCRIPTION-READ] 5123132a5d53ff14cbe594c0518348c5c267b433ed6f041f158222a4b0484d05

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of ae2ad67000a76c086abec5516f52e2eecdee5651 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] ae2ad67

False positive or not applicable? A repository writer can comment:
/ai-review override gpt ae2ad67000a76c086abec5516f52e2eecdee5651 false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed ae2ad67000a76c086abec5516f52e2eecdee5651 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] ae2ad67

Verdict parsed from the review's SHA-scoped output markers for commit ae2ad67000a76c086abec5516f52e2eecdee5651.

False positive or not applicable? A repository writer can comment:
/ai-review override fable ae2ad67000a76c086abec5516f52e2eecdee5651 false-positive: <reason, 20 to 500 characters>

@buluoray
buluoray merged commit aa7dfb4 into release/0.12.0 Nov 8, 2026
21 of 23 checks passed
@buluoray
buluoray deleted the crew/slack/0.12.1-batch-56 branch November 8, 2026 01:58
@github-actions github-actions Bot removed the readiness: checking Automated validation is still running label Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant