feat(core,cli): enforce mandatory MessageBus injection (Phase 3 Hard Migration) (#15776)

This commit is contained in:
Abhi
2026-01-04 17:11:43 -05:00
committed by GitHub
parent 90be9c3587
commit 12c7c9cc42
57 changed files with 442 additions and 278 deletions

View File

@@ -47,7 +47,7 @@ class MockToolInvocation extends BaseToolInvocation<
constructor(
private readonly tool: MockTool,
params: { [key: string]: unknown },
messageBus?: MessageBus,
messageBus: MessageBus,
) {
super(params, messageBus, tool.name, tool.displayName);
}
@@ -98,9 +98,9 @@ export class MockTool extends BaseDeclarativeTool<
options.description ?? options.name,
Kind.Other,
options.params,
options.messageBus ?? createMockMessageBus(),
options.isOutputMarkdown ?? false,
options.canUpdateOutput ?? false,
options.messageBus ?? createMockMessageBus(),
);
if (options.shouldConfirmExecute) {
@@ -122,11 +122,11 @@ export class MockTool extends BaseDeclarativeTool<
protected createInvocation(
params: { [key: string]: unknown },
messageBus?: MessageBus,
messageBus: MessageBus,
_toolName?: string,
_toolDisplayName?: string,
): ToolInvocation<{ [key: string]: unknown }, ToolResult> {
return new MockToolInvocation(this, params, messageBus ?? this.messageBus);
return new MockToolInvocation(this, params, messageBus);
}
}
@@ -146,7 +146,7 @@ export class MockModifiableToolInvocation extends BaseToolInvocation<
constructor(
private readonly tool: MockModifiableTool,
params: Record<string, unknown>,
messageBus?: MessageBus,
messageBus: MessageBus,
) {
super(params, messageBus, tool.name, tool.displayName);
}
@@ -207,9 +207,9 @@ export class MockModifiableTool
type: 'object',
properties: { param: { type: 'string' } },
},
createMockMessageBus(),
true,
false,
createMockMessageBus(),
);
}
@@ -230,14 +230,10 @@ export class MockModifiableTool
protected createInvocation(
params: Record<string, unknown>,
messageBus?: MessageBus,
messageBus: MessageBus,
_toolName?: string,
_toolDisplayName?: string,
): ToolInvocation<Record<string, unknown>, ToolResult> {
return new MockModifiableToolInvocation(
this,
params,
messageBus ?? this.messageBus,
);
return new MockModifiableToolInvocation(this, params, messageBus);
}
}