Skip to content

fix(chat): scope file-change chips to the turn that made them - #14710

Merged
iamwhatever merged 1 commit into
kirodotdev:mainfrom
Pearcekieser:fix/flush-file-changes-turn-boundary
Sep 30, 2026
Merged

iamwhatever merged 1 commit into
kirodotdev:mainfrom
Pearcekieser:fix/flush-file-changes-turn-boundary

Conversation

@Pearcekieser

@Pearcekieser Pearcekieser commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: File-change chips appear under the turn that changed the files, never under an earlier answer.

A turn that edits files through tools and then ends without an assistant row of its own (provider error, cancel before any text, a synthetic backend-failure turn) writes its chips onto the previous turn's answer.

Why it matters

The chips are how a user finds out what an aborted turn wrote to disk. Placed on the earlier answer they say the wrong turn made the change, and a user who reads the earlier answer as unchanged misses edits that happened.

Not a goal

What changed (motivation → approach → change)

Piece What it does
_turn_rows Returns the window rows appended since the turn began, found by the identity (meta.mid) of the row at the window's tail at turn start.
_flush_file_changes(turn_boundary, turn_start_mid) Scans only those rows for an assistant row this runner recorded as its reply (slot._turn_reply_mids); with none, appends a synthetic content-less assistant row that carries only the chips.
_run_chat Captures _turn_start_mid beside _turn_msg_boundary at entry, at dispatch, and on the mid-turn clear (beside the existing assistant_text reset, which stays), and passes both at the two flush sites.
_note_reply_row Records a reply row's meta.mid in slot._turn_reply_mids. Called by _flush_segment and _persist_partial_reply on the row they append; the list is a new _ChatSlot attribute in src/kiro_crew/dashboard/state.py, cleared at turn entry and by the flush, and bounded at _MAX_SLOT_MESSAGES (a row older than the window cap has been trimmed and cannot be an anchor).

_flush_file_changes in src/kiro_crew/dashboard/chat_runner.py walked reversed(slot.messages) for the first assistant row and only created its synthetic anchor when the whole slot had none. Any session with history has an earlier assistant row, so the fallback never ran and that row was mutated.

A window index is not enough to fix it. _ChatSlot.append front-trims at _MAX_SLOT_MESSAGES and pins the length there, so on a saturated window the index captured at turn start names the wrong row: an empty slice on a turn that answered, or an earlier turn's row on one that did not. A row identity does not move with the trim. Rows after the identified row are this turn's; an identified row that has left the window means every remaining row arrived after it. Only a tail row with no id (a transcript restored from a pre-id disk format) falls back to the index, clamped to the window so a stale value yields no rows, never an earlier turn's.

The synthetic anchor has empty content. It lands after the turn's error row (every except branch appends that row before the finally flush), and an assistant row with text there is read by state.is_turn_interrupted and its twin selectTurnInterrupted as the turn's reply, which hides the trailing error and removes the composer's Resume control. Every last-conversational-row scan looks through an empty assistant row, and invisibleText.ts::isHiddenInvisibleAssistantRow keeps a row with chips drawn, so the chips render and the error still decides the verdict. main has the same shape only on a first-ever aborting turn; this PR would otherwise reach it on every turn that aborts before text (Opus finding on cdafbbe).

The live window is shared. workflow_inject.py appends a workflow completion into the originating slot as an assistant row with no in-flight guard, and the Slack gateway writes sub-agent completions under the same role, so a row that landed after this turn's last append and before its flush is the newest assistant row in the turn without being its reply (#14829). Position cannot tell the two apart; identity can, so the flush attaches only to a row the runner recorded when it appended it and otherwise falls to the synthetic anchor. main picks that injected row too (its whole-window walk), so this closes a pre-existing hole rather than a regression of this PR.

docs/system-specs/modules/learn-cron-dashboard.md states the turn-scoped attach target and the identity rule.

Backwards compatibility

Compatible: both parameters default to the old whole-slot scan (turn_boundary=0, turn_start_mid=None). A _ChatSlot always carries _turn_reply_mids, so a caller that appends an assistant row directly and expects the chips on it now registers it with _note_reply_row (two existing tests updated); a slot double without the list keeps the position rule. The synthetic row's text becomes empty; nothing in src/, website/ or test/ matched the old wording.

Tests

test/test_file_change_snapshots.py::TestFlushFileChanges:

  • test_turn_boundary_keeps_chips_off_the_previous_turns_answer: prior answer, new user row, one change. The prior answer stays clean; the chips sit on a new assistant row. Fails on the whole-slot scan.
  • test_trimmed_window_still_finds_this_turns_rows_by_identity: a turn that answered and was front-trimmed keeps its chips; no synthetic row.
  • test_trimmed_window_with_no_answer_never_reaches_an_earlier_turn: same trim, turn aborted; the earlier row stays clean and a synthetic row is added.
  • test_evicted_start_row_means_every_row_is_this_turns: the turn-start row was trimmed away; the newest assistant row is the anchor.
  • test_idless_start_row_falls_back_to_the_clamped_index: an id-less tail row with a stale index yields the synthetic row, not the earlier answer.
  • test_the_mid_turn_clear_resets_the_boundary_id_beside_the_text: reads the runner's EVENT_CLEAR_STATUS branch and requires both assistant_text and _turn_start_mid to be reset there, so the new capture is added beside the accumulator reset and never replaces it.
  • test_synthetic_message_created_when_no_assistant_text pins the empty anchor content.
  • test_aborted_turn_with_chips_still_reads_as_interrupted: [user, error] plus a flush yields [user, error, assistant(chips)] and is_turn_interrupted is True; fails on the previous anchor text.
  • test_injected_assistant_row_is_never_the_anchor: [user, injected workflow_result row] plus a flush leaves the injected row's meta untouched and adds the synthetic anchor; fails on the position rule.
  • test_own_reply_wins_over_a_later_injected_row: a recorded reply followed by an injected row gets the chips; the injected row does not, and the flush clears the identity list.
  • test_flush_segment_records_the_reply_identity: the production reply path registers the row it appends.
  • test_reply_identities_are_bounded_at_the_window_cap: with the cap pinned to 2, three recorded rows leave the newest two ids.
  • The snapshot_turn harness, which executes the runner's lifted flush statements, seeds _turn_msg_boundary and _turn_start_mid.

Manual verification

N/A — unit coverage sufficient: a pure helper plus a guard, each path with a direct test.

Related Issues

Fixes #14708
Fixes #14829

Pattern harvest

Rule candidate: review-prompt
Pattern: end-of-turn attach that locates this turn's rows by a window index in a list that front-trims

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

@Pearcekieser
Pearcekieser requested a review from a team as a code owner September 28, 2026 14:45
@Pearcekieser

Copy link
Copy Markdown
Contributor Author

Intent: File-change chips from a turn that ended without its own assistant row land on that turn's synthetic anchor, not on the previous turn's answer.
Not a goal: Changing how snapshots are captured, budgeted or redacted; the Kiro CLI sentinel intercept, which stays in #8288.

@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Sep 28, 2026
@github-actions

github-actions Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Fable 5, fork) — ✅ PASS

Design-level review of b441fc26df201ac29f5216cf92ec19aee0c30c0a via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

Eyeball one live aborted file-changing turn: the chips-only empty bubble after the error row is unit-pinned but never seen rendered.

Suggestions

  • _attach_turn_stats still scopes by the window index this PR proves wrong under front-trim; file the follow-up to move it onto the same _turn_start_mid identity rule.

[DESIGN-REVIEWED] b441fc2

Description read

[DESCRIPTION-READ] 702f1c734b773d60416bb8fae367d1a82b29b455f6cd5f07e6893d2213225753

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 Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5, fork) — ✅ PASS

Premise-level review of b441fc26df201ac29f5216cf92ec19aee0c30c0a via the fork AI-review pipeline — 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/CONCERNS are advisory.

First-Principles-Verdict: PASS

_attach_turn_stats (chat_runner.py:3093) keeps the index rule this PR proves wrong under trim and mid-turn injection — confirm the declared deferral gets a follow-up.

Every load-bearing premise checks out on base: the front-trim exists (state.py:4306), is_turn_interrupted looks through a content-less assistant row (state.py:1209), selectTurnInterrupted mirrors it (selectors.ts:248), invisibleText.ts:37-38 keeps a chip-bearing row drawn, workflow_inject.py:190 appends assistant rows unguarded, and mint_mid=False restore rows (state.py:4259) give the id-less fallback a real trigger. The rewritten anchor-text pin ("stopped" in content → == "") is declared, and the PR ships the evidence the old pin was wrong: test_aborted_turn_with_chips_still_reads_as_interrupted fails on the old wording against base's own is_turn_interrupted. No docs/decisions/ entry covers the wording (grep file.change|chip: 0). The one unfixed sibling of the root cause is counted (1: _attach_turn_stats) and the frozen Not-a-goal declares it deferred.

What this change ships

Inventory (8 items) — 8 justified

Intent: FIX — chips from a turn attach to that turn's own reply, never an earlier answer or a foreign row (#14708, #14829).

  1. Chips from a reply-less turn land on a new synthetic row, not the previous answer — justified
  2. A workflow/sub-agent completion row injected mid-turn never receives the chips — justified
  3. Synthetic anchor text "(stopped — files were modified)" becomes empty — justified
  4. On a trimmed window the turn's rows are found by row identity, not index — justified
  5. Id-less restored transcripts fall back to the clamped index, yielding no rows — justified
  6. Slot tracks this turn's reply ids, bounded at the window cap — justified
  7. Spec doc updated in the same commit — justified
  8. _flush_file_changes gains two params; both production call sites pass real values — justified

[FIRST-PRINCIPLES-REVIEWED] b441fc2

Description read

[DESCRIPTION-READ] 781ea6b959e979fa945db65289a3b4aa2467273bea4281883aa4f1575ac904e6

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 Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

GPT 5.6 Review (fork) — ✅ no blocking findings

Reviewed b441fc26df201ac29f5216cf92ec19aee0c30c0a via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] b441fc2

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 28, 2026
@github-actions

github-actions Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5 Review (fork) — ✅ no blocking findings

Reviewed b441fc26df201ac29f5216cf92ec19aee0c30c0a via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] b441fc2

@Pearcekieser

Copy link
Copy Markdown
Contributor Author
  • Window trimming invalidates the turn boundary (chat_runner.py:2972)

fixed: at _MAX_SLOT_MESSAGES the window length is pinned, so a boundary captured at turn start cannot name this turn's first row and the slice read as "no answer".
_flush_file_changes now falls back to the whole-slot walk when len(slot.messages) >= _MAX_SLOT_MESSAGES or the boundary is past the end; below the cap no trim has happened since the turn began, so the index is exact there.
Locked by test_saturated_window_falls_back_to_the_whole_slot (cap pinned to 2, trimmed turn keeps its chips, no synthetic row).

@Pearcekieser

Copy link
Copy Markdown
Contributor Author
  • Stale boundary fabricates a "stopped" anchor; tool-only continuation turns get one too (chat_runner.py:2972, :19917)

fixed: the saturated-window and past-the-end cases fall back to the whole-slot walk, so a turn that answered keeps its chips and no synthetic row is appended (test_saturated_window_falls_back_to_the_whole_slot).
fixed: the anchor now reads *(files were modified)*; it names only what the flush knows, and the notice beside it says whether the turn stopped, errored or is continuing. Smaller than a text parameter: the flush has no caller that knows more than that.

@Pearcekieser
Pearcekieser force-pushed the fix/flush-file-changes-turn-boundary branch from 5e1cad4 to f11769d Compare September 28, 2026 16:17
@Pearcekieser

Copy link
Copy Markdown
Contributor Author

Pushed f11769d (rebased onto current main, single commit) in one push:

  • CI: the snapshot_turn harness in test/test_file_change_snapshots.py executes the runner's lifted flush statements, which now read _turn_msg_boundary; the harness seeds it. That was every red on shards 4 and Windows 4 (7 NameErrors). Shard 6's test_forwarded_fence_long_separator_run_is_linear failed on a 562 ms wall-clock budget of 500 ms, passes locally, unrelated to this diff.
  • GPT db37e66c9e96 and Opus e48125549479: fixed as recorded in the two disposition comments above (saturated-window fallback with a test; neutral anchor text).

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 28, 2026
@Pearcekieser

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: the saturated-window fallback to the whole-slot walk is removed; the turn's rows are now found by row identity

  • saturated turns corrupt the previous turn's file-change metadata (chat_runner.py:2982)

fixed: the index-based fallback is gone. _turn_rows locates this turn's rows by the meta.mid of the window's tail row at turn start; rows after it are the turn's, and a tail row that left the window means every remaining row is. Neither case can reach an earlier turn's row.
The only index path left is an id-less tail row (pre-id restored transcript), clamped to the window so a stale index yields no rows and a synthetic anchor, never an earlier row.
Locked by test_trimmed_window_with_no_answer_never_reaches_an_earlier_turn (trimmed, aborted turn: earlier answer clean, synthetic row added) and test_idless_start_row_falls_back_to_the_clamped_index.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author
  • spec's documented attach target is stale (chat_runner.py:2874, learn-cron-dashboard.md:1271)

fixed: the File-change snapshots clause now states the turn-scoped target, the synthetic row for a turn with no assistant row, the row-identity rule and the id-less index fallback. The whole-slot fallback the finding asked to document no longer exists (see the GPT disposition for this head).

@Pearcekieser
Pearcekieser force-pushed the fix/flush-file-changes-turn-boundary branch from f11769d to 4b81cd3 Compare September 28, 2026 17:15
@Pearcekieser

Copy link
Copy Markdown
Contributor Author

Pushed 4b81cd3 (rebased onto current main, single commit).

The saturated-window fallback from the previous head is gone. _turn_rows finds this turn's rows by the meta.mid of the window's tail row at turn start, which a front-trim does not move; the runner captures _turn_start_mid beside _turn_msg_boundary at entry, dispatch and the mid-turn clear. Only an id-less tail row (pre-id restored transcript) still uses the index, clamped so a stale value yields a synthetic anchor and never an earlier turn's row. The spec clause in learn-cron-dashboard.md now states the target. Dispositions for f11769d are the two comments above; 130 tests in test_file_change_snapshots.py pass, gates clean.

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Sep 28, 2026
@Pearcekieser

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: the round-2 hunk that added the _turn_start_mid = "" capture on the clear branch replaced the assistant_text = "" line instead of sitting beside it

  • Native clear re-persists buffered reply text (chat_runner.py:16090)

fixed: assistant_text = "" is restored on the EVENT_CLEAR_STATUS branch, directly beside _turn_start_mid = "", so text streamed before a mid-turn or fanned-out clear is discarded as before and the terminal _flush_segment has nothing to re-append.
Locked by test_the_mid_turn_clear_resets_the_boundary_id_beside_the_text, which parses the runner's clear branch and requires both resets; it fails on head 4b81cd3 and passes with the line restored.
Third round on this span, each a different finding on the same file/kind: round 1 the saturated-window fallback, round 2 its whole-slot walk, round 3 this rider the round-2 edit introduced.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: the round-2 hunk that added the _turn_start_mid = "" capture on the clear branch replaced the assistant_text = "" line instead of sitting beside it

  • A mid-turn native clear no longer discards the text streamed before it (chat_runner.py:16090)

fixed: assistant_text = "" is restored on the EVENT_CLEAR_STATUS branch, directly beside _turn_start_mid = "", so text streamed before a mid-turn or fanned-out clear is discarded as before and the terminal _flush_segment has nothing to re-append.
Locked by test_the_mid_turn_clear_resets_the_boundary_id_beside_the_text, which parses the runner's clear branch and requires both resets; it fails on head 4b81cd3 and passes with the line restored.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author

Pushed cdafbbe (rebased onto current main, single commit).

  • All four review lanes found the same one-line defect from the previous head: the clear-branch hunk had replaced assistant_text = "" with _turn_start_mid = "". The reset is restored beside the new line, and test_the_mid_turn_clear_resets_the_boundary_id_beside_the_text fails without it.
  • Backend shards 4 (Linux, Windows): test_pid_reader_sites_match_the_recorded_count_exactly failed because main's recorded baseline was 158 while the tree held 160; fix(test): record the pid-reader count the tree actually holds #14778 corrected it on main, and the rebase picks that up. Coverage Gate was downstream of those shards.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author

self-added: no

  • Concurrent injections are mistaken for this turn's assistant row (chat_runner.py:3005)

pre-existing, tracked in #14829, needs a writer override. The scenario needs workflow_inject.py:186 to append a workflow_result row into the live slot after the turn's last assistant append and before the terminal flush, in a turn that recorded file changes and appended no assistant row. Main's _flush_file_changes scans the whole window (for m in reversed(slot.messages), chat_runner.py:2967 on main) and picks that same row. This PR's _turn_rows picks the same anchor when the injection lands mid-turn, and a later one when it landed before the turn started, so the PR does not widen the residual. Damage is additive (meta.update(file_meta) adds file_changes only; the workflow row's content, mid and kind survive), which the adjudicator rated MEDIUM and machine-flagged as F1 pre-existing.
The proposed fix (a runner-owned assistant-row identity threaded through every append site, plus synthesize-when-absent) touches every runner append path and is out of scope for a one-slice PR. #14829 records it with owner and due date. Fourth round on this span, each round a different finding; per the fence, a repository writer must record the override, and the F1 rationale above is the one to verify.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 28, 2026
@Pearcekieser

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: main reaches the synthetic anchor only on a first-ever aborting turn; the turn-scoped walk reaches it on every turn that aborts before text, so the anchor-after-error shape went from rare to routine

  • Turn-scoped flush appends a synthetic assistant row after the turn's error row, so an interrupted turn stops reporting as interrupted (chat_runner.py:3005)

fixed: the anchor is now content-less. Every except branch appends the error row before the finally flush, so the anchor lands after it; state.is_turn_interrupted and selectTurnInterrupted look through an assistant row with empty content (if role in ("user", "assistant") and m.get("content")), so the trailing error decides the verdict and the Resume gate stays. The row still draws because invisibleText.ts::isHiddenInvisibleAssistantRow keeps a row with file_changes visible. Chosen over a new SYSTEM_NOTICE_KINDS entry because that set also routes the row to SystemNoticeRow, which draws no chips. test_aborted_turn_with_chips_still_reads_as_interrupted builds [user, error], flushes, and asserts is_turn_interrupted is True; it fails on this head. Spec clause in learn-cron-dashboard.md updated.

@Pearcekieser
Pearcekieser force-pushed the fix/flush-file-changes-turn-boundary branch from cdafbbe to f50dcb2 Compare September 29, 2026 22:30
@Pearcekieser

Copy link
Copy Markdown
Contributor Author

Pushed a new head, rebased onto current main, still one commit.

Fix for Opus's finding on cdafbbe: the synthetic anchor row is now content-less, so a turn that aborts before any text still reads as interrupted (the error row it follows decides), and the chips still draw. One new test, test_aborted_turn_with_chips_still_reads_as_interrupted, fails on the previous head. Spec clause and PR body updated.

The GPT fenced finding (F1, pre-existing, #14829) is unchanged by this head and still needs a repository writer to record the override.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author

self-added: no

  • Concurrent injections are mistaken for this turn's assistant row (chat_runner.py:3005)

fixed, superseding the earlier "pre-existing, needs override" disposition: the anchor is now chosen by identity, as the finding's own fix line asked. _flush_segment and _persist_partial_reply record the meta.mid of each reply row they append in slot._turn_reply_mids (_note_reply_row, bounded at _MAX_SLOT_MESSAGES, cleared at turn entry and by the flush); _flush_file_changes attaches only to a recorded row within the turn's rows and otherwise appends the synthetic anchor. An assistant row workflow_inject.py appends into the live window mid-turn is never recorded, so it can no longer receive the chips whatever its position; the same holds for the assistant-role sub-agent completion variants. test_injected_assistant_row_is_never_the_anchor builds the exact scenario (turn with file changes, injected workflow_result row as the newest assistant row) and asserts the injected row's meta is untouched and a synthetic anchor is added; it fails on this head. test_own_reply_wins_over_a_later_injected_row and test_flush_segment_records_the_reply_identity cover the recorded path. Closes #14829 as part of this PR.

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Sep 29, 2026
@Pearcekieser
Pearcekieser force-pushed the fix/flush-file-changes-turn-boundary branch from f50dcb2 to 052095a Compare September 29, 2026 23:15
@Pearcekieser

Copy link
Copy Markdown
Contributor Author

Pushed a new head, rebased onto current main, still one commit.

This head removes the fenced GPT finding at the root instead of waiting on an override: the file-change flush now anchors chips only to a reply row this runner recorded when it appended it (slot._turn_reply_mids, filled by _flush_segment / _persist_partial_reply), so an assistant row another writer injects into the live window mid-turn (workflow or sub-agent completion) can never be the anchor. Four new tests, one of which reproduces the injected-row scenario and fails on the previous head. The list is bounded at the window cap. Spec clause, PR body and Fixes #14829 updated.

Local pre-push review: the pinned GPT and Opus reviewer processes failed to start on this host three times (ACP initialize timeouts during a memory-pressure window), so the pre-push pass was a self-review against the two extracted CI contracts, not an independent model review. The CI lanes on this head are the first independent read.

@Pearcekieser
Pearcekieser force-pushed the fix/flush-file-changes-turn-boundary branch from 052095a to ca6e1c9 Compare September 30, 2026 00:30
@Pearcekieser

Copy link
Copy Markdown
Contributor Author

Same-tree retrigger, no code change (tree identical to 052095a, commit timestamp only).

On 052095a 102 checks were green; the four reds (GPT 5.6 Review, Opus 5 Review, Security Scope Review, Internal Content Scan) all ended within a second of starting on the CI app's installation rate limit ("API rate limit exceeded for installation" at 23:38-23:49Z, "could not run" verdicts), so no review was produced. Fork contributors cannot re-run jobs, and no fresh rate-limit failure has appeared in the repository for 30 minutes, so one push to re-run every lane.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 30, 2026
_flush_file_changes scanned every assistant row in the slot, so a turn that changed files and ended without its own assistant row wrote its chips onto the previous turn's answer. It now takes the same turn boundary _attach_turn_stats uses and scans only this turn's rows, creating the synthetic anchor when the turn has none.

Fixes kirodotdev#14708
@Pearcekieser

Copy link
Copy Markdown
Contributor Author

Same-tree retrigger, no code change (tree identical to ca6e1c9 and 052095a, commit timestamp only).

On ca6e1c9 every substantive lane is green: GPT 5.6 Review and Opus 5 Review report no blocking findings, Security Scope Review, Internal Content Scan, Coverage Gate and all backend shards pass. Three infrastructure jobs (Fork PR Description, Publish readiness signal, Resolve desktop matrix) hit the CI app installation rate limit at 00:39-00:40Z, and the failed readiness publisher leaves the label at "action required" with nothing to act on. No fresh rate-limit failure for 40 minutes; one push so the publisher reruns.

@Pearcekieser
Pearcekieser force-pushed the fix/flush-file-changes-turn-boundary branch from ca6e1c9 to b441fc2 Compare September 30, 2026 01:30
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 30, 2026

@iamwhatever iamwhatever left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed. _turn_rows / _note_reply_row / the flush filter scope chips to the rows this turn wrote; the fallback always adds a new row so chips are never hidden; every reply slot.append in _run_chat goes through _flush_segment or _persist_partial_reply and both record the row; id list capped at _MAX_SLOT_MESSAGES and cleared at turn entry and flush; one runner per slot; no new file reads.

Non-blocking: notice rows (Slack approval failure, unattended decline, agent switch) are no longer anchors, so a turn with only those gets an extra empty row; no test that _persist_partial_reply records its row or that the turn-entry clear happens; test_the_mid_turn_clear_resets checks source structure rather than behaviour.

@iamwhatever
iamwhatever enabled auto-merge (squash) September 30, 2026 05:30
@iamwhatever
iamwhatever merged commit a56379b into kirodotdev:main Sep 30, 2026
100 checks passed
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Sep 30, 2026
@Pearcekieser
Pearcekieser deleted the fix/flush-file-changes-turn-boundary branch September 30, 2026 05:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork Pull request from a fork (external contributor)

Projects

None yet

2 participants