Repository navigation
Description
Summary
Build the re-delivery cap that parks a poison task as FAILED(MAX_REDELIVERY) into the operator queue with an alert. This same lever is the landing spot for irreversible-and-un-confineable effects that the platform cannot auto-recover. It is unbuilt today — the existing retry_count column is #678's reader-race auto-retry, not a lease cap.
Context
Under the pull / work-stealing model (#1081), lease-expiry re-delivery re-runs failed turns. Two cases must escalate to a human instead of looping forever:
- a poison task that keeps failing on every re-delivery, and
- an irreversible effect the platform cannot make safe (no confined Trinity tool fronting the rail, no provider-native idempotency key — e.g. an action through the agent's own key /
gh/curl).
Both land in the operator queue (OPS-001). This lever is doubly load-bearing and gates defaulting pull mode on for any side-effect-bearing agent.
Design constraint: NO synchronous user gates — comms are asynchronous via the operator queue
The human gate is the asynchronous operator queue (OPS-001) — not a blocking in-turn prompt. This is a hard design constraint, not an implementation detail:
- A turn that needs human input MUST NOT hold a worker open waiting for a response. Blocking a turn on a human would pin a worker and violate async-first (Principle Feature/vector log retention #3) — the exact failure mode the pull model exists to remove.
- Instead, the turn parks a question/approval into the operator queue and ends. The operator responds later; resolution re-enters asynchronously (a new execution, or the operator-queue respond → re-trigger path).
- Agents must be designed to treat all user/operator communication as asynchronous — fire-and-park, never block-and-wait. An agent should never assume a synchronous human answer is available mid-turn.
- This contract must be surfaced to agents (agent-facing docs + the platform system prompt) so agent authors build for it explicitly.
Acceptance Criteria
- Per-execution re-delivery counter + configurable cap; over-cap → status
FAILED(MAX_REDELIVERY). - Over-cap task parked into the operator queue with an alert (never silently dropped).
- Irreversible-and-un-confineable effects route to the same async human gate.
- The gate is asynchronous (operator queue) — never a synchronous in-turn block; a turn never holds a worker waiting on a human.
- Agents are made aware that user/operator comms are async via the operator queue (agent-facing docs and the platform system prompt) — fire-and-park, not block-and-wait.
- Counter reset-on-progress semantics defined (raw attempts vs. reset on partial progress).
- Bounds the lease-reaper (refactor: collapse 9-path cleanup pyramid once agent is authoritative #429) so a re-pulled task cannot loop forever.
Technical Notes
- v2 reframe:
docs/planning/TARGET_ARCHITECTURE.md§Recovery + §"Re-Delivery and Side-Effect Idempotency" (pending v2 update). - Operator queue is the async human-gate surface:
src/backend/routers/operator_queue.py,src/backend/services/operator_queue_service.py(OPS-001). - Do not overload the existing
retry_countcolumn (that is Async chat_with_agent: long execution silently fails with null response (reader-thread) #678 reader-race auto-retry) — this is a distinct lease-level cap. - Parent: feat: pull / work-stealing coordination (push→pull dispatch) #1081; bounds the lease-reaper refactor: collapse 9-path cleanup pyramid once agent is authoritative #429. Companion to the recovery-trace sibling issue in this batch.
Activity
docs(target-arch): v2 — reframe side-effect handling to retry-with-tr…
docs(target-arch): v2 — reframe side-effect handling to retry-with-tr…
feat(pull-migration): pull coordination core — claim/CAS, lease-reape…
feat(pull-migration): pull coordination core — claim/CAS, lease-reape…
feat(pull-migration): pull/work-stealing coordination Phases 0–3 (dar…
1 remaining item
github-actions commentedon Jul 15, 2026
@vybe This issue is already assigned to obasilakis. Use
/unclaimfirst if you want to take over.fix(pull): compose the platform system prompt on the pull-claim path …
feat(operator-queue): async human-gate contract — fire-and-park promp…
feat: async operator human-gate contract — fire-and-park prompt + der…
fix(operator-queue): scope request-id uniqueness per agent — split th…
fix(operator-queue): ingestion depth/rate/size caps at the agent-auth…
feat(prompt): model-conditional prompt tiers — mechanism only, provab…
feat(operator-queue): an operator answer can wake a parked agent (ent…
docs(pull): one entry point for the pull migration — delete five supe…
fix(operator-queue): an approval's decision must be one the agent off…