Skip to content

feat: MAX_REDELIVERY cap + async operator-queue human-gate lever (lease-reaper backstop) #1402

Closed

Description

@vybe

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:

  1. a poison task that keeps failing on every re-delivery, and
  2. 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

Activity

  1. added
    priority-p2
    type-feature
    theme-reliability
    complexity-medium
    status-incubating
    on Jul 1, 2026
  2. self-assigned this
    on Jul 3, 2026
  3. added
    status-ready
    and removed
    status-incubating
    on Jul 3, 2026
  4. removed
    status-ready
    on Jul 15, 2026
  5. 1 remaining item

  6. github-actions commented on Jul 15, 2026

    @github-actions

    @vybe This issue is already assigned to obasilakis. Use /unclaim first if you want to take over.

  7. added
    status-ready
    on Jul 16, 2026
  8. added
    status-in-dev
    on Jul 17, 2026
  9. removed
    status-in-dev
    status-ready
    on Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

complexity-mediumpriority-p2theme-reliabilitytype-feature

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions