mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 16:57:46 +00:00
fix: forward entire tool call confirmation object through useToolScheduler (#481)
This commit is contained in:
@@ -291,6 +291,7 @@ Expectation for parameters:
|
||||
{ context: 3 },
|
||||
);
|
||||
const confirmationDetails: ToolEditConfirmationDetails = {
|
||||
type: 'edit',
|
||||
title: `Confirm Edit: ${shortenPath(makeRelative(params.file_path, this.rootDirectory))}`,
|
||||
fileName,
|
||||
fileDiff,
|
||||
|
||||
@@ -107,6 +107,7 @@ export class ShellTool extends BaseTool<ShellToolParams, ToolResult> {
|
||||
return false; // already approved and whitelisted
|
||||
}
|
||||
const confirmationDetails: ToolExecuteConfirmationDetails = {
|
||||
type: 'exec',
|
||||
title: 'Confirm Shell Command',
|
||||
command: params.command,
|
||||
rootCommand,
|
||||
|
||||
@@ -171,25 +171,23 @@ export interface FileDiff {
|
||||
fileName: string;
|
||||
}
|
||||
|
||||
export interface ToolCallConfirmationDetailsDefault {
|
||||
export interface ToolEditConfirmationDetails {
|
||||
type: 'edit';
|
||||
title: string;
|
||||
onConfirm: (outcome: ToolConfirmationOutcome) => Promise<void>;
|
||||
}
|
||||
|
||||
export interface ToolEditConfirmationDetails
|
||||
extends ToolCallConfirmationDetailsDefault {
|
||||
fileName: string;
|
||||
fileDiff: string;
|
||||
}
|
||||
|
||||
export interface ToolExecuteConfirmationDetails
|
||||
extends ToolCallConfirmationDetailsDefault {
|
||||
export interface ToolExecuteConfirmationDetails {
|
||||
type: 'exec';
|
||||
title: string;
|
||||
onConfirm: (outcome: ToolConfirmationOutcome) => Promise<void>;
|
||||
command: string;
|
||||
rootCommand: string;
|
||||
}
|
||||
|
||||
export type ToolCallConfirmationDetails =
|
||||
| ToolCallConfirmationDetailsDefault
|
||||
| ToolEditConfirmationDetails
|
||||
| ToolExecuteConfirmationDetails;
|
||||
|
||||
|
||||
@@ -158,6 +158,7 @@ export class WriteFileTool extends BaseTool<WriteFileToolParams, ToolResult> {
|
||||
);
|
||||
|
||||
const confirmationDetails: ToolEditConfirmationDetails = {
|
||||
type: 'edit',
|
||||
title: `Confirm Write: ${shortenPath(relativePath)}`,
|
||||
fileName,
|
||||
fileDiff,
|
||||
|
||||
@@ -94,7 +94,7 @@ export async function checkNextSpeaker(
|
||||
return null;
|
||||
} catch (error) {
|
||||
console.warn(
|
||||
'Failed to talk to Gemiin endpoint when seeing if conversation should continue.',
|
||||
'Failed to talk to Gemini endpoint when seeing if conversation should continue.',
|
||||
error,
|
||||
);
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user