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) if (args.CommandLine)
command = `${toolName}: ${args.CommandLine.substring(0, 1500)}`; command = `${toolName}: ${args.CommandLine.substring(0, 1500)}`;
else if (args.TargetFile) else if (args.TargetFile)
command = `${toolName}: ${args.TargetFile.split(/[\\/]/).pop()}`; command = `${toolName}: ${args.TargetFile}`;
else else {
command = `${toolName}: ${Object.keys(args).join(', ')}`; // 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 { catch {
command = toolName; command = toolName;
@@ -1716,13 +1719,14 @@ function setupMonitor() {
try { try {
const args = JSON.parse(toolCall.argumentsJson); const args = JSON.parse(toolCall.argumentsJson);
if (args.CommandLine) { if (args.CommandLine) {
command = `${toolName}: ${args.CommandLine.substring(0, 150)}`; command = `${toolName}: ${args.CommandLine.substring(0, 1500)}`;
} }
else if (args.TargetFile) { else if (args.TargetFile) {
command = `${toolName}: ${args.TargetFile.split(/[\\/]/).pop()}`; command = `${toolName}: ${args.TargetFile}`;
} }
else { 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 { catch {

File diff suppressed because one or more lines are too long

View File

@@ -1642,8 +1642,12 @@ function setupMonitor() {
try { try {
const args = JSON.parse(toolCall.argumentsJson); const args = JSON.parse(toolCall.argumentsJson);
if (args.CommandLine) command = `${toolName}: ${args.CommandLine.substring(0, 1500)}`; if (args.CommandLine) command = `${toolName}: ${args.CommandLine.substring(0, 1500)}`;
else if (args.TargetFile) command = `${toolName}: ${args.TargetFile.split(/[\\/]/).pop()}`; else if (args.TargetFile) command = `${toolName}: ${args.TargetFile}`;
else command = `${toolName}: ${Object.keys(args).join(', ')}`; 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: any) => typeof v === 'string' && v.length > 2);
command = val ? `${toolName}: ${String(val).substring(0, 500)}` : `${toolName}: ${Object.keys(args).join(', ')}`;
}
} catch { command = toolName; } } catch { command = toolName; }
} }
const actualIndex = offset + osi; const actualIndex = offset + osi;
@@ -1690,11 +1694,12 @@ function setupMonitor() {
try { try {
const args = JSON.parse(toolCall.argumentsJson); const args = JSON.parse(toolCall.argumentsJson);
if (args.CommandLine) { if (args.CommandLine) {
command = `${toolName}: ${args.CommandLine.substring(0, 150)}`; command = `${toolName}: ${args.CommandLine.substring(0, 1500)}`;
} else if (args.TargetFile) { } else if (args.TargetFile) {
command = `${toolName}: ${args.TargetFile.split(/[\\/]/).pop()}`; command = `${toolName}: ${args.TargetFile}`;
} else { } 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: any) => typeof v === 'string' && v.length > 2);
command = val ? `${toolName}: ${String(val).substring(0, 500)}` : `${toolName}: ${Object.keys(args).join(', ')}`;
} }
} catch { command = toolName; } } catch { command = toolName; }
} }