Skip to content

tasks/orchestration: completion delivery loop, CompletionRouter registry, abort guard, live-then-durable wait/resolve #473

Closed

Description

@senamakel

Generic detached-run plumbing that OpenHuman reimplements in agent/orchestration/ (see openhuman#7929):

  • completions::delivery in tinyagents-tasks. A debounced, batch-claiming loop with backoff, give-up and boot recovery, plus a parent-busy RAII gate, a one-turn-per-thread lease and drain timing.
    • Seams: is_busy, the delivery turn, the undelivered writer, and a fence trait.
    • From background_delivery.rs (749), busy_guard.rs, background_delivery/slot.rs and delivery_drain.rs.
  • CompletionRouterPool<K>. A lazily opened router per key with in-memory fallback, mirroring TaskStoreRegistry. From background_completions.rs.
  • Watcher writes the run ledger. spawn_status_watcher settles AgentRunStatus itself (from run_ledger_finalize.rs).
  • DetachedTaskRegistry abort guard. Emit a terminal event when take_and_cancel drops the future (from tools/subagent_abort_report.rs).
  • detached::*_or_durable combinators. Try the live registry, then the TaskStore, for wait / resolve / cancel (from running_subagents/{wait,resolve,cancel}.rs). Also return metadata for cancelled runs.
  • wait_all. Multi-child deadline wait (from orchestration/ops.rs).
  • Decide awaiting_input handling in DetachedCompletionTarget (see Background completions record awaiting_input as a completion, taking the dedupe slot openhuman#7932).

Done when: merged upstream with tests in sibling *_tests.rs, released or tagged, and the OpenHuman follow-up can delete the host copy after a gitlink bump on vendor/tinyagents.

Parent: tinyhumansai/openhuman#7929, which has the full file-by-file verdict tables.

Activity

  1. added
    enhancementNew feature or request
    rustPull requests that update rust code
    on Oct 16, 2026
  2. added
    priority: p3Whenever. Cosmetic, a nicety, or a cleanup with no user visible effect.
    on Oct 16, 2026
  3. tinysweeper commented on Oct 16, 2026

    @tinysweeper

    Port of OpenHuman's generic detached-run plumbing (completion delivery loop, CompletionRouterPool registry, abort guard, live-then-durable wait/resolve/cancel combinators, wait_all) into tinyagents-tasks, with tests and a tagged release so OpenHuman can delete its host copy. This is a net-new implementation/enhancement request, not a broken path, so it can be scheduled as future work.

    Labelled priority: p3.

  4. senamakel commented on Oct 17, 2026

    @senamakel
    MemberAuthor

    Implemented and merged into the tinyagents-refactor branch on the senamakel fork:

    Closing this completed migration issue as requested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestpriority: p3Whenever. Cosmetic, a nicety, or a cleanup with no user visible effect.rustPull requests that update rust code

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions