mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 13:03:42 +00:00
fix(coding-agent): make ctx.shutdown() work from extension tools
The tool execution context was created with a no-op shutdown handler. Now it delegates to ExtensionRunner.shutdown() which uses the handler set by the mode via initialize().
This commit is contained in:
parent
baf6fe4b39
commit
cf0466d96c
2 changed files with 11 additions and 1 deletions
|
|
@ -288,6 +288,14 @@ export class ExtensionRunner {
|
|||
return undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Request a graceful shutdown. Called by extension tools and event handlers.
|
||||
* The actual shutdown behavior is provided by the mode via initialize().
|
||||
*/
|
||||
shutdown(): void {
|
||||
this.shutdownHandler();
|
||||
}
|
||||
|
||||
private createContext(): ExtensionContext {
|
||||
return {
|
||||
ui: this.uiContext,
|
||||
|
|
|
|||
|
|
@ -527,7 +527,9 @@ export async function createAgentSession(options: CreateAgentSessionOptions = {}
|
|||
abort: () => {
|
||||
session.abort();
|
||||
},
|
||||
shutdown: () => {},
|
||||
shutdown: () => {
|
||||
extensionRunner?.shutdown();
|
||||
},
|
||||
}));
|
||||
|
||||
// Create tool registry mapping name -> tool (for extension getTools/setTools)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue