diff --git a/packages/core/agent-loop/src/index.ts b/packages/core/agent-loop/src/index.ts index f0a20e21f2..399e29e9aa 100644 --- a/packages/core/agent-loop/src/index.ts +++ b/packages/core/agent-loop/src/index.ts @@ -589,6 +589,7 @@ export class AgentLoop extends Service implements AgentFactory { } throwCollectedFailures(failures, `agent "${id}" disposal failed`) })()) + let unfollowOwner: () => Promise | void const dispose = async (): Promise => { try { await teardown() @@ -597,7 +598,6 @@ export class AgentLoop extends Service implements AgentFactory { } } const untrack = this.ownership.track(dispose) - let unfollowOwner: () => Promise | void try { unfollowOwner = ownerCtx.effect(function* () { machine = new ReactLoopAgent(loopCtx, id, options, session)