fix: show actual arg values (paths, queries) instead of parameter names in approval

This commit is contained in:
2026-03-10 13:30:01 +09:00
parent e107b70510
commit 47dbd38c7c
3 changed files with 21 additions and 12 deletions

View File

@@ -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 {