You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: POST /api/operator-queue/{id}/respond accepts any string as an approval decision — no layer checks response ∈ options #2376
OperatorResponse.response is a bare str; the router, the DB write and the agent write-back pass it through verbatim, and no layer checks that an approval item's recorded decision is one of the options the agent offered. #2370 shipped response: "approved" against options: ["Approve", "Deny"] for five months without a single 4xx — a server-side membership check would have turned the first tap into a named 422.
Context
The operator queue is the approval channel for irreversible agent actions (#1402 poison-park, ent#329 respond→resume, the TARGET_ARCHITECTURE v2 human-gate). Four producers exist today (desktop store, /m, the Workspace asks panel, the MCP tool) and the next one — a channel button, an ops agent — can re-ship the class unless the sink refuses. Defence in depth at the boundary (Product Quality Bar #6: a named validation error, never a silently broken state). Surfaced by the #2370 plan review.
Acceptance Criteria
For an item with type == 'approval' and real options (a non-empty list that is not the size-cap marker _OPTIONS_DROPPED_MARKER), a response not in options is rejected with a named 422 (e.g. response_not_an_offered_option) that lists the offered options; exact string match (options are agent-authored)
Question items, alert items, approval items without usable options, and acknowledged are unaffected
The check lives in ONE place reached by both POST /api/operator-queue/{id}/respond and the Workspace asks answer path (src/backend/client_portal/asks/service.py) — a shared validator at the service/db chokepoint, not a copy per router
MCP respond_to_operator_queue surfaces the 422 as a structured error (no silent success)
Tests: accept / reject / exempt cases on both entry points, including the marker-list case
Technical Notes
src/backend/models.py (OperatorResponse), src/backend/routers/operator_queue.py (respond), src/backend/db/operator_queue.py (options stored as JSON and loaded back in the row mapper), src/backend/services/operator_queue_service.py (_OPTIONS_DROPPED_MARKER), src/backend/client_portal/asks/service.py, src/mcp-server/src/tools/operator_queue.ts
Activity
fix(ui): /m approval card sends the tapped option as the decision — s…
dolho commentedon Aug 27, 2026
/claim
github-actions commentedon Aug 27, 2026
Claimed by @dolho. Label
status-in-progressadded.Next steps:
feature/2376-<short-slug>Fixes #2376Merge pull request #2414 from Abilityai/fix/2376-approval-response-me…
fix(operator-queue): an approval's decision must be one the agent off…
feat(workspace): an answer given in the Workspace resumes the agent (…
Release: v0.9.5 (#2872)
feat(operator-queue): backend sink accepts the reserved (something el…
feat(operator-queue): backend sink accepts the reserved (something el…
feat(operator-queue): approvals get a "Something else" answer (#3242) (…
feat(operator-queue): atomic asks — authoring rules in the ask_operat…
Release: v1.0.0 (#3853)