Resolves CI build failure on PR #1950:
internal/handlers/admin_queue.go:8:2: "github.com/Molecule-AI/molecule-monorepo/platform/internal/db" imported and not used
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Issue #1947: after incidents, PM agents inherit hour-old TASK-priority
queue items from ICs that were correctly reporting "X is broken" while
X was actually broken. Once X is fixed those items are stale noise —
PMs spend ~5 min each writing "thanks, the issue is resolved".
Adds:
- DropStaleQueueItems() in a2a_queue.go: UPDATE ... SET status='dropped'
for queued items older than maxAgeMinutes. Uses FOR UPDATE SKIP LOCKED
to stay concurrency-safe with concurrent drain calls.
- AdminQueueHandler in admin_queue.go: POST /admin/a2a-queue/drop-stale
(AdminAuth, ?max_age_minutes=N, &workspace_id=<id>). Returns {dropped: N}.
- admin_queue_test.go: HTTP-level tests for param validation and response shape.
- Router registration for the new endpoint.
Usage during incident recovery:
curl -X POST /admin/a2a-queue/drop-stale?max_age_minutes=120
# scoped to one workspace:
curl -X POST /admin/a2a-queue/drop-stale?max_age_minutes=120&workspace_id=<uuid>
Closes#1947.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>