ami-drift: closer v2.2 — idempotent close, comment only confirmed transitions - #24
Open
geisbruch wants to merge 1 commit into
Open
ami-drift: closer v2.2 — idempotent close, comment only confirmed transitions#24geisbruch wants to merge 1 commit into
geisbruch wants to merge 1 commit into
Conversation
…d transitions Post-incident fix (2026-07-28): 8 already-closed items collected 54 duplicate closing comments and the nightly sweep failed outright. - close_items: ignoreInvalidTransition — an already-closed item no-ops (skipped: true) instead of failing the whole page's forEach - ordering inverted: close FIRST, then comment ONLY the ids that actually transitioned (attribution by response actionItem.id, with a length-guarded positional fallback) - output_projection on close_items trims the per-item payload - E2E suite updated to the v2.2 contract (53 tests green)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ports the post-incident closer fix (2026-07-28) from the engine repo's workflow corpus.
Incident: on a customer org, 8 already-closed
ami-driftitems collected 54 duplicate "Closing automatically" comments between 2026-07-18 and 2026-07-22, and the nightly run then failed outright.Fixes (each link of the failure chain, independently):
close_itemsnow setsignoreInvalidTransition: true— closing an already-closed item (NP API 400 "Invalid action item status transition") becomes a per-item no-op (skipped: true) instead of taking down the whole page's forEach.actionItem.id, with a length-guarded positional fallback so a non-echoing API can never mis-attribute (it just yields no comment for that slot).output_projectiononclose_itemskeeps onlyactionItem.id+skippedper item.E2E suite updated to the v2.2 contract: 53 tests green (
npx vitest run ami-drift).🤖 Generated with Claude Code