Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions docs/modules/graph/subagents-recursion.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,21 @@ Every steering event must include root run id, parent run id, child run id when
available, task id when graph-backed, namespace, actor, command kind, policy id,
correlation id, and checkpoint id when available.

## Detached Task Runtime Registry

`DetachedTaskRegistry<Metadata, Status>` complements the durable `TaskStore`
with process-local executor handles. Applications register a task's owner,
metadata, status watch receiver, cancellation token, and abort handle, while
the task's live `SteeringHandle` remains addressable through the shared
`SteeringRegistry`.

The registry enforces owner checks for wait and steering, keeps timed-out waits
registered, prunes terminal waits, cancels cooperatively before hard-aborting,
and sweeps terminal entries when its soft cap is reached. It never evicts live
work to satisfy the cap and does not duplicate durable lifecycle records.
After a restart, applications reconcile live `TaskStore` records that have no
matching runtime entry according to their executor policy.

## Listing Orchestration Tasks {#orchestrate-list}

The model-facing `orchestrate_list` tool enumerates managed tasks visible to the
Expand Down
5 changes: 4 additions & 1 deletion docs/sdk-gaps.md
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,10 @@ TinyAgents has sub-agent and steering primitives, but OpenHuman still owns
session reuse, wait handles, detached run tracking, user-facing cancellation,
early-exit handling, and parent-child progress aggregation.

The generic `DetachedTaskRegistry` now owns process-local owner checks,
wait/timeout, cooperative-cancel-before-abort, steering lookup, and bounded
terminal cleanup. Reusable durable child sessions and product projections remain.

Implement:

- First-class detached sub-agent sessions.
Expand Down Expand Up @@ -467,4 +471,3 @@ Acceptance criteria:
7. Remove OpenHuman-specific compatibility shims once the SDK behavior is
equivalent.
8. Implement conformance and regression tests last.

12 changes: 7 additions & 5 deletions src/graph/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,13 @@ pub use observability::{
StoreGraphEventJournal,
};
pub use orchestration::{
InMemoryTaskStore, JsonlTaskStore, OrchestrationControlOutcome, OrchestrationTaskFilter,
OrchestrationTaskKind, OrchestrationTaskRecord, OrchestrationTaskResult, OrchestrationTaskSpec,
OrchestrationTaskStatus, OrchestrationTool, OrchestrationToolKind, SteeringRegistry, TaskStore,
orchestration_tool_schema, orchestration_tool_schemas, orchestration_tools,
orchestration_tools_with_steering, register_orchestration_tools,
CancelledDetachedTask, DetachedTaskRegistry, DetachedTaskRegistryError, DetachedTaskSnapshot,
DetachedTaskWaitOutcome, InMemoryTaskStore, JsonlTaskStore, OrchestrationControlOutcome,
OrchestrationTaskFilter, OrchestrationTaskKind, OrchestrationTaskRecord,
OrchestrationTaskResult, OrchestrationTaskSpec, OrchestrationTaskStatus, OrchestrationTool,
OrchestrationToolKind, SteeringRegistry, TaskStore, orchestration_tool_schema,
orchestration_tool_schemas, orchestration_tools, orchestration_tools_with_steering,
register_orchestration_tools,
};
pub use recursion::{
ChildRun, ChildRunSink, RecursionFrame, RecursionPolicy, RecursionStack, RunTree,
Expand Down
2 changes: 2 additions & 0 deletions src/graph/orchestration/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@
//! [`register_orchestration_tools`] to insert them into a
//! [`crate::harness::tool::ToolRegistry`] alongside any other tools.

mod runtime;
mod store;
mod tool;
mod types;

pub use runtime::DetachedTaskRegistry;
Comment thread
senamakel marked this conversation as resolved.
pub use store::{InMemoryTaskStore, JsonlTaskStore, TaskStore};
pub use tool::{
OrchestrationTool, SteeringRegistry, orchestration_tool_schema, orchestration_tool_schemas,
Expand Down
Loading