Skip to content

fix: recover Kiro intents after quota exhaustion and lost sessions - #466

Open
JWThewes wants to merge 1 commit into
mainfrom
fix/463-intent-recovery
Open

JWThewes wants to merge 1 commit into
mainfrom
fix/463-intent-recovery

Conversation

@JWThewes

Copy link
Copy Markdown
Contributor

An existing Kiro intent can remain stuck after a credit outage even when its key has been replaced: a parked stage may lack a saved session, and an answer arriving before callback binding can be mistaken for a conflicting callback owner.

This change:

  • Handles answers that race engine/stage callback binding, while retaining callback ownership checks and fencing retired engine runs.
  • Rejects Kiro parks without a captured session and successful configured store persistence. A legacy parked stage with matching gate ownership can start a fresh conversation using its saved context and answer; reset, sibling and expired waits remain protected.
  • Classifies explicit credit exhaustion separately from invalid credentials and transient throttling, with guidance and a settings link for the intent's pinned credential scope. Regression coverage verifies that rotating that scope takes effect in the same intent.
  • Uses consistent recovery and unit-plan reads, surfaces storage failures separately from absent state, and documents export, stage retry and the limits of parallel repair.

Validation: 1,984 backend tests across the agentcore, v2-orchestrator, shared and intents projects pass on Node 24, including durable-runner race/replay and real Git integration tests. All 56 intent-page tests pass, as do frontend typecheck, staged formatting/lint/secret checks and the intents/orchestrator bundles. The commit hooks also pass (959 affected tests; both production dependency audits report zero vulnerabilities). Rebased without changing this patch onto main's separate checkpoint IAM fix #465; its regression test passes.

The reported production sequence is not verified because deployment state was unavailable. A genuinely mismatched approved unit plan still requires operator reconciliation. Provider balance alerts, in-flight configuration refresh and complete diagnostic backups remain separate follow-ups.

Fixes #463.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Recover existing intents after Kiro credit exhaustion and lost sessions

2 participants