fix(agent-loop): nest config resume teardown

This commit is contained in:
Tianyi Cui
2026-07-11 23:45:01 +08:00
parent 06e42f439c
commit e6c7522a75
2 changed files with 23 additions and 1 deletions
+5 -1
View File
@@ -120,7 +120,11 @@ export class AgentLoop extends Service implements AgentFactory {
this.ctx.logger.warn(`agent "${id}": config-driven resume of "${resumeSessionId}" failed: ${String(error)}`)
})
})
return () => void fiber.dispose()
// Return the EXACT child-fiber disposer. Cordis moves a returned
// effect into this labeled owner's teardown tree by function
// identity; a wrapper would leave the child as a concurrent sibling
// and could discard its async quiescence promise.
return fiber.dispose
}, `agentLoop.resume(${id})`)
} else {
this.create(id, options, cwd === undefined ? {} : { cwd })