Repository navigation
fix(operator-queue): acknowledging a platform alert ends it (#2372) - #3338
Merged
Merged
Conversation
A platform-minted alert (a request_id with a reserved platform prefix) has no agent audience, so the operator's answer is its last event. The answer sink now passes terminal=is_platform_minted(item) and the respond compare-and-set writes status='acknowledged' + acknowledged_at for those rows. An agent's own ask still lands 'responded'. The endings ledger is unchanged (answered / person), so the skill gate's resolver and the Workspace views read the same ending. Agent files written before ent#499 can still hold such an alert as a 'responded' entry, and nothing removes it. Ingestion now skips a reserved-prefix entry that is no longer pending without the #1631 WARNING. Only a pending entry can pre-create a platform row, so that case keeps the WARNING. Rows already stuck in 'responded' move to 'acknowledged' once, through the dual-track heal platform_alert_responded_heal (SQLite) and Alembic 0093. Ids are matched the way is_platform_minted matches them, in Python, because SQL LIKE reads the '_' in 'val_' as a wildcard. Mutation check: with terminal=False the three answer-sink tests in test_2372 go red; with the guard skip removed the two leftover-entry tests go red. Fixes #2372 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
merge-train (mechanical): changed the body's |
# Conflicts: # tests/registry.json
webmixgamer
added a commit
that referenced
this pull request
Oct 7, 2026
…n to 0094 dev gained `0093_platform_alert_responded_heal` (#3338) on the same parent as this branch's `0093_agent_skill_gates` — two heads, so `upgrade head` would apply nothing (alembic-head-watch). The revision is now `0094_agent_skill_gates` on top of `0093_platform_alert_responded_heal`; it was never applied to a persistent PostgreSQL (local installs are SQLite, CI and verify-local databases are throwaway), so a rename, not a merge revision. Conflicts: `db/migrations.py` keeps both entries (dev's heal first, then `agent_skill_gates`; the SQLite runner tracks by name, so an install that already applied `agent_skill_gates` is unaffected) and `tests/registry.json` keeps both sets of entries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
10 of 12 tasks
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.
Summary
request_idwith a reserved platform prefix) now lands it inacknowledgedwithacknowledged_atset, in the same compare-and-set as the answer. An agent's own ask still lands inresponded. The endings ledger staysanswered/person.pending, and logs no bug: operator_queue.id is a global primary key — cross-agent id collision silently swallows requests #1631 WARNING for it. These entries were left in agent files by the write-back before ent#499. Apendingreserved entry can still pre-create a row, so it still gets the WARNING and is never created.platform_alert_responded_healon SQLite, Alembic0093) moves rows already stuck inrespondedtoacknowledged.Acceptance criteria
db/operator_queue.pyrespond_to_item(terminal=),services/ask_service.pyanswerdevthrough ent#499 (is_platform_mintedin_write_responses_to_agent). Regression test:test_no_warning_and_no_write_with_the_row_goneservices/operator_queue_service.pyreserved-prefix guarddb/migrations.py+migrations/versions/0093_platform_alert_responded_heal.py. The #1017 terminal write-back is unchanged.acknowledgedas terminal. Test:test_clear_all_hides_an_acknowledged_platform_alertdocs/memory/feature-flows/operating-room.mdand thedocs/memory/architecture/backend.mdcatalog entry.architecture.mdhas no Operator Queue section, and its write-path rule sends area updates to area files.Notes for review
gate-approvals are platform-minted, so they now land inacknowledgedtoo.skill_gate_service.resolvereadsdispositionfirst and maps both statuses toanswered._RESERVED_ID_PREFIXEStoday.created_at, so a healed row older thanoperator_queue_retention_daysis deleted at the next sweep. That is the normal window AC5 asks for.Test plan
cd tests && pytest unit/test_2372_platform_alert_ack.py unit/test_2915_operator_queue_sync_honesty.py -v: 96 passedterminal=False: 3 answer-sink tests go red.ent751/ent679tests plus atest_3215collection error. They come from the localpayments_pyinstall and also fail without this change.scripts/ci/check_alembic_heads.py: 1 head,0093.pg-migrations: the heal on PostgreSQL./cso --diff: 0 findings (docs/security-reports/cso-diff-2026-10-07-2372-platform-alert-ack.md).Fixes #2372
🤖 Generated with Claude Code