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
+7 -6
View File
@@ -114,7 +114,7 @@ class WebFetchToolInvocation extends BaseToolInvocation<
constructor(
private readonly config: Config,
params: WebFetchToolParams,
messageBus?: MessageBus,
messageBus: MessageBus,
_toolName?: string,
_toolDisplayName?: string,
) {
@@ -218,7 +218,8 @@ ${textContent}
protected override async getConfirmationDetails(
_abortSignal: AbortSignal,
): Promise<ToolCallConfirmationDetails | false> {
// Legacy confirmation flow (no message bus OR policy decision was ASK_USER)
// Check for AUTO_EDIT approval mode. This tool has a specific behavior
// where ProceedAlways switches the entire session to AUTO_EDIT.
if (this.config.getApprovalMode() === ApprovalMode.AUTO_EDIT) {
return false;
}
@@ -406,7 +407,7 @@ export class WebFetchTool extends BaseDeclarativeTool<
constructor(
private readonly config: Config,
messageBus?: MessageBus,
messageBus: MessageBus,
) {
super(
WebFetchTool.Name,
@@ -424,9 +425,9 @@ export class WebFetchTool extends BaseDeclarativeTool<
required: ['prompt'],
type: 'object',
},
messageBus,
true, // isOutputMarkdown
false, // canUpdateOutput
messageBus,
);
}
@@ -452,14 +453,14 @@ export class WebFetchTool extends BaseDeclarativeTool<
protected createInvocation(
params: WebFetchToolParams,
messageBus?: MessageBus,
messageBus: MessageBus,
_toolName?: string,
_toolDisplayName?: string,
): ToolInvocation<WebFetchToolParams, ToolResult> {
return new WebFetchToolInvocation(
this.config,
params,
messageBus ?? this.messageBus,
messageBus,
_toolName,
_toolDisplayName,
);