mirror of
https://github.com/KeygraphHQ/shannon.git
synced 2026-10-13 19:30:46 +02:00
fix(pi): give each task sub-session its own resource loader to prevent stale extension ctx
This commit is contained in:
1 parent
e9cf782081
commit
4e145a0f3f
2 files changed
+5
-4
No files matched your search
@@ -299,7 +299,7 @@ export async function runPiPrompt(
|
||||
childUsage.cacheReadTokens += usage.cacheReadTokens;
|
||||
childUsage.cacheWriteTokens += usage.cacheWriteTokens;
|
||||
},
|
||||
resourceLoader,
|
||||
createResourceLoader: () => buildResourceLoader(sourceDir, logger, agentName),
|
||||
...(cancellationSignal && { cancellationSignal }),
|
||||
}),
|
||||
createTodoWriteTool(),
|
||||
@@ -403,7 +403,6 @@ export async function runPiPrompt(
|
||||
|
||||
// 6. Run the agent to completion (resolves at agent_end).
|
||||
await session.prompt(fullPrompt);
|
||||
session.dispose();
|
||||
|
||||
// 7. Surface any error captured during the run.
|
||||
if (pendingError) throw pendingError;
|
||||
@@ -469,6 +468,7 @@ export async function runPiPrompt(
|
||||
retryable,
|
||||
};
|
||||
} finally {
|
||||
session?.dispose();
|
||||
cancellationSignal?.removeEventListener('abort', onCancellation);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user