fix: show actual arg values (paths, queries) instead of parameter names in approval
This commit is contained in:
@@ -1666,9 +1666,12 @@ function setupMonitor() {
|
||||
if (args.CommandLine)
|
||||
command = `${toolName}: ${args.CommandLine.substring(0, 1500)}`;
|
||||
else if (args.TargetFile)
|
||||
command = `${toolName}: ${args.TargetFile.split(/[\\/]/).pop()}`;
|
||||
else
|
||||
command = `${toolName}: ${Object.keys(args).join(', ')}`;
|
||||
command = `${toolName}: ${args.TargetFile}`;
|
||||
else {
|
||||
// Show first meaningful value (path, query, etc.)
|
||||
const val = args.DirectoryPath || args.SearchPath || args.AbsolutePath || args.Url || args.Query || args.Prompt || Object.values(args).find((v) => typeof v === 'string' && v.length > 2);
|
||||
command = val ? `${toolName}: ${String(val).substring(0, 500)}` : `${toolName}: ${Object.keys(args).join(', ')}`;
|
||||
}
|
||||
}
|
||||
catch {
|
||||
command = toolName;
|
||||
@@ -1716,13 +1719,14 @@ function setupMonitor() {
|
||||
try {
|
||||
const args = JSON.parse(toolCall.argumentsJson);
|
||||
if (args.CommandLine) {
|
||||
command = `${toolName}: ${args.CommandLine.substring(0, 150)}`;
|
||||
command = `${toolName}: ${args.CommandLine.substring(0, 1500)}`;
|
||||
}
|
||||
else if (args.TargetFile) {
|
||||
command = `${toolName}: ${args.TargetFile.split(/[\\/]/).pop()}`;
|
||||
command = `${toolName}: ${args.TargetFile}`;
|
||||
}
|
||||
else {
|
||||
command = `${toolName}: ${Object.keys(args).join(', ')}`;
|
||||
const val = args.DirectoryPath || args.SearchPath || args.AbsolutePath || args.Url || args.Query || args.Prompt || Object.values(args).find((v) => typeof v === 'string' && v.length > 2);
|
||||
command = val ? `${toolName}: ${String(val).substring(0, 500)}` : `${toolName}: ${Object.keys(args).join(', ')}`;
|
||||
}
|
||||
}
|
||||
catch {
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user