fix: retain subagent control after live session reattachment

This commit is contained in:
Teknium
2026-09-07 22:07:59 -07:00
parent 975699714d
commit 7befa11bf2
4 changed files with 92 additions and 3 deletions
+5
View File
@@ -53,6 +53,11 @@ def _register_subagent(record: Dict[str, Any]) -> None:
return
record.setdefault("accepting_steer", True)
with _active_subagents_lock:
owner = record.get("owner_session_record")
if owner is not None and record.get("owner_transport") is not None:
# Child construction can finish after its captured dispatch transport
# was replaced. The exact session object retains generation authority.
record["owner_transport"] = owner.get("transport")
_active_subagents[sid] = record
def _unregister_subagent(subagent_id: str, *, agent: Any = None) -> None: