Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(chat): reattach resumed subagent cards to the newest parent call

Steven Enamakel17d84e4b403d
diff --git a/app/src/store/chatRuntimeSlice.ts b/app/src/store/chatRuntimeSlice.ts
index 691ffaf863..68ae7bafa4 100644
--- a/app/src/store/chatRuntimeSlice.ts
+++ b/app/src/store/chatRuntimeSlice.ts
@@ -2004,6 +2004,9 @@ const chatRuntimeSlice = createSlice({
existing.subagent.status = 'running';
existing.subagent.awaitingQuestion = undefined;
existing.subagent.spawnEventId = spawnEventId;
+ // Reattach the resumed task card to the newest parent call so the
+ // completed spawn from its earlier turn does not claim this work.
+ if (parentCallId) existing.subagent.parentCallId = parentCallId;
}
}
return;
diff --git a/crates/openhuman-core/src/agent/orchestration/running_subagents.rs b/crates/openhuman-core/src/agent/orchestration/running_subagents.rs
index 424ee34633..6b2d2bd1a9 100644
--- a/crates/openhuman-core/src/agent/orchestration/running_subagents.rs
+++ b/crates/openhuman-core/src/agent/orchestration/running_subagents.rs
@@ -1,36 +1,5 @@
-//! Registry of in-flight asynchronous sub-agents and their cancellation lifecycle.
-//!
-//! `spawn_subagent` runs a child as a detached `tokio` task. On its own
-//! that task is opaque: the parent gets a `task_id` back but has no channel into
-//! the running loop and no way to collect the result inline. This registry
-//! closes both gaps.
-//!
-//! The registry tracks task metadata, status and abort handles for cancellation.
-//!
-//! TinyAgents owns the process-local watch/cancel/abort/steering mechanics.
-//! OpenHuman retains product metadata and durable task-store projection.
-//!
-//! ## Typed lifecycle ledger (issue #4249)
-//!
-//! Alongside the executor plumbing (abort handle + steering queue + watch
-//! status), every detached sub-agent is also recorded in a process-wide
-//! [`tinyagents` orchestration `TaskStore`](tinyagents_tasks)
-//! as an `OrchestrationTaskKind::SubAgent` task. `register` inserts it
-//! (`Pending` → `Running`) and spawns a watcher that mirrors the child's
-//! terminal status into the store (`Completed`/`Failed`/`Awaiting`); the cancel
-//! paths record `Cancelled`. This gives a typed, queryable lifecycle
-//! (`task_records`) alongside the crate-owned runtime registry.
-//!
-//! ## Module layout
-//!
-//! - [`registry`] — the in-process table itself: [`DetachedSubagentStatus`],
-//! registration, and status channels.
-//! - [`task_ledger`] — the durable per-workspace task store and the typed
-//! lifecycle records mirrored into it.
-//! - [`roster`] — read-only snapshots for prompt injection and control tools.
-//! - [`resolve`] — mapping a durable session id (or bare task id) to the live
-//! registry entry or a durable fallback record.
-//! - [`cancel`] — aborting sub-agents by task, session, thread, or all at once.
+//! Host-side scope checks and durable fallback views for asynchronous
+//! sub-agents. TinyAgents owns live child jobs and their cancellation lifecycle.
mod cancel;
mod registry;