Repository navigation
feat(ops): per-tab Clear All on the Operations page (#1017) - #1146
Merged
Merged
Conversation
Bulk clear actions for the Operating Room queue and agent notifications:
- POST /api/operator-queue/bulk-cancel — cancels only the ids the operator
actually saw (race-safe vs the 5s sync loop); per-id accessible-agent
scoping; returns {cancelled, skipped}
- POST /api/operator-queue/clear-resolved — hides terminal rows
(acknowledged/cancelled/expired) via a new cleared_at column. NOT a
DELETE: the sync loop re-creates DB-missing items whose agent-file entry
still says pending (always true for expired, and for cancelled inside
the propagation window). Deletion deferred to the retention sweep (#1142)
- POST /api/notifications/dismiss-all — pending+acknowledged → dismissed
in one statement, same accessible-set the list endpoint uses
- Sync write-back now propagates cancelled/expired status into agent queue
files (in-place flips only) so agents stop waiting on cleared items
- Respond-vs-bulk-cancel race now returns 409 instead of a silent 200
that never recorded the response
- One audit-log entry + one WS event (operator_queue_cleared /
notifications_cleared) per bulk op; stores refetch on receipt
- Operations.vue: per-tab Clear All button (hidden when empty) with
blast-radius confirmation; Resolved feed now shows cancelled/expired
- Tests: tests/test_ops_clear_all.py (20 tests — scoping isolation,
tri-state accessible-set, idempotency, 409 marker, hide-not-delete)
Closes #1017
Co-Authored-By: Claude Fable 5 <[email protected]>
|
Resolve by running |
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
POST /api/operator-queue/bulk-cancel{ids}— cancels only the items the operator actually saw (race-safe vs the 5s sync loop), returns{cancelled, skipped}POST /api/operator-queue/clear-resolved— hides terminal rows via a newcleared_atcolumn (migrationoperator_queue_cleared_at). Deliberately not a DELETE: the sync loop re-creates DB-missing items whose agent-file entry still sayspending(always true for expired items, and for cancelled ones inside the propagation window). Actual deletion deferred to the retention sweep (Add operator_queue retention sweep to cleanup_service #1142)POST /api/notifications/dismiss-all— pending + acknowledged → dismissed in one statementcancelled/expiredstatus into agent queue files, so agents stop waiting on cleared itemsAuditEventType.OPERATOR_QUEUE/NOTIFICATION).cancelled/expireditems (previously they vanished from the UI entirely).Changes
Backend:
routers/operator_queue.py,routers/notifications.py,db/operator_queue.py,db/notifications.py,db/schema.py+db/migrations.py(cleared_at),database.py,services/operator_queue_service.py,services/platform_audit_service.pyFrontend:
views/Operations.vue,stores/operatorQueue.js,stores/notifications.js,utils/websocket.js,components/operator/ResolvedCard.vueDocs:
architecture.md, feature flowsoperating-room.md+agent-notifications.mdTest Plan
pytest tests/test_ops_clear_all.py -v(20 tests — scoping isolation between users, tri-state accessible-set incl. zero-agent no-op, idempotency, 409 conflict marker, hide-not-delete + list exclusion, responded-row delivery survival, oversized-ids 422)test_operator_queue.py+test_notifications.py(85 passed)schema_migrationsrow + column present)Follow-ups filed: #1142 (operator_queue retention sweep), #1143 (NavBar notification badge capped at 1 — pre-existing).
Closes #1017
🤖 Generated with Claude Code