fix(agent): align subagent lifecycle with openclaw
This commit is contained in:
parent
1cd778b845
commit
30f23459ce
2 changed files with 11 additions and 7 deletions
|
|
@ -100,6 +100,10 @@ export function createSessionsSpawnTool(
|
|||
model,
|
||||
});
|
||||
|
||||
// Write the task to the child (non-blocking) before registering,
|
||||
// so waitForIdle() observes the queued work.
|
||||
childAgent.write(task);
|
||||
|
||||
// Register the run for lifecycle tracking
|
||||
registerSubagentRun({
|
||||
runId,
|
||||
|
|
@ -111,9 +115,6 @@ export function createSessionsSpawnTool(
|
|||
timeoutSeconds,
|
||||
});
|
||||
|
||||
// Write the task to the child (non-blocking)
|
||||
childAgent.write(task);
|
||||
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue