mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-18 10:03:27 +00:00
refactor(coding-agent): unify tool and event handler context creation
Tools now use ExtensionRunner.createContext() instead of a separate inline context factory. This ensures tools and event handlers share the same context, fixing ctx.shutdown() and other context methods. - Made ExtensionRunner.createContext() public - Changed wrapRegisteredTools to accept ExtensionRunner instead of getContext callback - Create ExtensionRunner when SDK custom tools are present (not just extensions) - Removed redundant inline context factory from sdk.ts
This commit is contained in:
parent
cf0466d96c
commit
b1fb910625
3 changed files with 23 additions and 49 deletions
|
|
@ -296,7 +296,11 @@ export class ExtensionRunner {
|
|||
this.shutdownHandler();
|
||||
}
|
||||
|
||||
private createContext(): ExtensionContext {
|
||||
/**
|
||||
* Create an ExtensionContext for use in event handlers and tool execution.
|
||||
* Context values are resolved at call time, so changes via initialize() are reflected.
|
||||
*/
|
||||
createContext(): ExtensionContext {
|
||||
return {
|
||||
ui: this.uiContext,
|
||||
hasUI: this.hasUI(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue