3319
// tool.execution_complete for this id is suppressed.
3320
if (isClientTool && !contributor) {
3321
>
this._logService.warn(`[Copilot:${sessionId}] Client tool '${e.data.toolName}' started with no connected client; failing it immediately.`);
copilotAgentSession.ts
3322
>
this._activeToolCalls.delete(e.data.toolCallId);
3323
>
this._emitAction({
3324
>
type: ActionType.ChatToolCallReady,
3325
>
turnId: this._turnId,
3326
>
toolCallId: e.data.toolCallId,
3327
>
invocationMessage: getInvocationMessage(e.data.toolName, displayName, parameters),
3328
>
toolInput: getToolInputString(e.data.toolName, parameters, toolArgs),
3329
>
confirmed: ToolCallConfirmationReason.NotNeeded,
3330
>
}, parentToolCallId);
3331
>
this._emitAction({
3332
>
type: ActionType.ChatToolCallComplete,
3333
>
turnId: this._turnId,
3334
>
toolCallId: e.data.toolCallId,
3335
>
result: {
3336
>
success: false,
3337
>
pastTenseMessage: `${displayName} failed`,
3338
>
error: { message: `No client was connected to run ${displayName}` },
3339
>
},
3340
>
}, parentToolCallId);
3341
>
this._pendingClientToolCalls.respondOrBuffer(e.data.toolCallId, {
3342
>
textResultForLlm: `No client was connected to run ${displayName}.`,
3343
>
resultType: 'failure',
3344
>
error: 'No client connected',
3345
>
});
3346
>
return;
3347
>
}
3348
3349
const clientToolAutoApproved = contributor?.kind === ToolCallContributorKind.Client && this._lastAppliedPermissionMode === 'on';