Repository navigation
fix(chat): recover synthetic backend retry turns - #8288
Pearcekieser wants to merge 1 commit into
Conversation
57ddd15 to
8f697aa
Compare
Design Review (Fable 5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS Verify the sentinel sentence is byte-stable across the Kiro CLI versions users run — wording drift silently reverts to the persisted-as-success bug. Suggestions
[DESIGN-REVIEWED] 19bfe6c |
First Principles Review (Fable 5, fork) — 🟡 CONCERNSPremise-level review of First-Principles-Verdict: CONCERNS Sentinel recovery is dashboard-only: the subagent and Slack post-token copies still land Kiro's failure sentence as a real answer, unmirrored and undeclared. Not justified as shipped
What this change shipsInventory (8 items) — 5 justifiedIntent: stop treating Kiro CLI's synthetic "I hit an issue… Please retry." success-envelope failure as a real answer and resume the turn safely — a FIX (issue #8285).
[FIRST-PRINCIPLES-REVIEWED] 19bfe6c |
GPT 5.6 Review (fork) — 🔴 changes requested (blocking)Reviewed 2 of 2 blocking finding(s) are security-class and were withheld from adjudication, so the blocking verdict stands. BLOCKING -- src/kiro_crew/dashboard/chat_runner.py:17079 -- LLM text is trusted as backend control output BLOCKING -- src/kiro_crew/dashboard/chat_runner.py:17257 -- Recovery is not bound to its originating session [BLOCK-MERGE] 19bfe6c Adjudication (Opus 5) — is blocking on each finding proportionate?F1 — src/kiro_crew/dashboard/chat_runner.py:17079 (new lines in the patch) F2 — src/kiro_crew/dashboard/chat_runner.py:17257 (new lines in the patch) [ADJUDICATION] 19bfe6c total=0 uphold=0 downgrade=0 |
Opus 5 Review (fork) — ✅ no blocking findingsReviewed Review detailsAdding FINDING — src/kiro_crew/dashboard/chat_runner.py:8481 — FINDING — docs/system-specs/modules/session.md:3916 — the owning spec still asserts "the dispatch-point purge in [OPUS-REVIEWED] 19bfe6c |
8f697aa to
a4d87da
Compare
Fixed in |
a4d87da to
a2affcc
Compare
Fixed in |
a2affcc to
9299643
Compare
9299643 to
b5162c5
Compare
That discriminator is not valid for Kiro CLI. The captured real failure session records credit-only accounting and zero token fields, but legitimate Kiro model text has the same zero-token shape; requiring zero therefore does not distinguish provider control output from model output and would only appear to close the ambiguity. The implemented behavioral gate instead requires positive Kiro-backend identity, |
No such event exists in the observed Kiro CLI/ACP failure shape: the real incidents persist |
|
🤖 Kiro Crew [operator: NicholasRBowers#a942f9ca]: This PR has been inactive for 7+ days. I reviewed the blockers but they require input beyond what automation can decide:
When these are addressed, the pipeline will re-assess on its next cycle. |
|
Hi @Pearcekieser — from a repo-wide audit of open PRs, this one overlaps #9156 (@buluoray), and the two need one decision before either lands. The shared ground is They are not redundant. #9156's Concrete suggestion: split the Separately, this PR is 497 commits behind and merges dirty. #8318 landed Posted from the 2026-09-08 open-PR relationship audit (read-only, one auditor per PR); reply here if any of this is wrong. |
Recognize Kiro CLI's successful-looking turn-failure sentinel, preserve completed tool work, and continue once without recording a false success.
07ff841 to
19bfe6c
Compare
|
Rebased onto current main (19bfe6c, was 07ff841, 2843 commits behind). No behaviour change intended. Conflict resolution, for the record:
Local: 66 targeted tests in the two classes plus file-change/purge tests pass; black, flake8 and the comment-history gate pass on the diff. |
|
Closing: superseded. The sentinel no longer exists. The intercept keys on the exact assistant sentence That also settles the standing GPT objection ( The rest of this branch is on main or in flight:
Nothing on this branch remains to land. |
Problem / Motivation
Kiro CLI can fail its inner agent loop after several successful tool cycles yet close ACP as a normal
Ok/UserTurnEndresult whose only assistant text is:Kiro Crew treated that provider-generated sentence as a real answer. It persisted the text, recorded success, reset recovery budgets, and required the user to repeat a request whose tools may already have produced side effects.
Why it matters
Long-running work can stop after minutes of successful execution with no actionable diagnosis. Blindly replaying the original request is unsafe because completed tools may run twice. The recovery must continue from the live session context, preserve tool results, and remain cancellable before dispatch.
What changed (motivation → approach → change)
please retrymatching is deliberately avoided.is_kiro_backendidentity, at least one tool call in the turn, and confirmation that the current user message did not itself contain the sentence before treating it as provider control output. Exact answers without tool activity, quoted/requested literals, and non-Kiro output remain ordinary assistant text.Tests
TestEmptyResponseRetry: 19 passed.TestRunChatTransientRetry: 20 passed.test_dashboard_chat.py: 759 passed on the final rebased head.The local full-backend profile run reached 84,065 passes. Its remaining failures are unrelated host-topology failures caused by the dashboard sandbox exposing the live
KIROCREW_HOME,/local/homeownership, and overlong AF_UNIX scratch paths. The two failures related to this diff's answer-branch source contract were fixed and rerun green. Hosted CI provides the authoritative isolated full-backend result.Two independent local reviews found missing dispatch-time cancellation and missing positive Kiro identity; both were fixed. A GPT round then showed that output-token counts are non-authoritative for Kiro's credit-only accounting, so that discriminator was removed in favor of backend identity, tool activity, exact-text, and current-request guards. Later GPT rounds identified the live-browser reconciliation gap and then exposed a broader cross-turn file-change attachment bug. The former now replaces an already-streamed sentinel row before recovery; the latter was restructured globally so file changes scan only assistant rows created after the turn boundary and synthesize a current-turn anchor when needed. On the final current head, GPT restated the inherent text-signal ambiguity as a security blocker, but Opus adjudication downgraded it as disproportionate: the continuation is visible, same-session, one-shot, admission-restamped, and subject to the same tool gates, while Kiro CLI exposes no out-of-band failure event to consume.
Manual verification
N/A — this is backend recovery control flow with deterministic event-stream and queue-dispatch coverage. The triggering upstream failure cannot be induced on demand; the test event shape comes from three observed raw Kiro CLI records.
Related Issues
Fixes #8285
Related but independent:
Pattern harvest
Rule candidate: review-prompt
Pattern: a provider-owned synthetic failure sentence returned under a success envelope must require positive provider identity plus out-of-band failure evidence before changing control flow.
Checklist
feat|fix|docs|refactor|perf|test|chore|ci|build|revert: ...)CI retry note
The first two dependency-audit attempts for current-head validation timed out after 120 seconds while waiting for
npm audit; neither produced a vulnerability finding. This description update retriggers the repository'spull_request: editedreview/audit path without changing the reviewed commit.