fix: ACP: separate conversational text from execute tool command title (#23179)

This commit is contained in:
Sri Pasumarthi
2026-03-23 17:39:15 -07:00
committed by GitHub
parent a7bed2cc4c
commit 84caf00cd4
7 changed files with 247 additions and 19 deletions
+20 -8
View File
@@ -72,23 +72,35 @@ export class ShellToolInvocation extends BaseToolInvocation<
super(params, messageBus, _toolName, _toolDisplayName);
}
getDescription(): string {
let description = `${this.params.command}`;
private getContextualDetails(): string {
let details = '';
// append optional [in directory]
// note description is needed even if validation fails due to absolute path
// note explanation is needed even if validation fails due to absolute path
if (this.params.dir_path) {
description += ` [in ${this.params.dir_path}]`;
details += `[in ${this.params.dir_path}]`;
} else {
description += ` [current working directory ${process.cwd()}]`;
details += `[current working directory ${process.cwd()}]`;
}
// append optional (description), replacing any line breaks with spaces
if (this.params.description) {
description += ` (${this.params.description.replace(/\n/g, ' ')})`;
details += ` (${this.params.description.replace(/\n/g, ' ')})`;
}
if (this.params.is_background) {
description += ' [background]';
details += ' [background]';
}
return description;
return details;
}
getDescription(): string {
return `${this.params.command} ${this.getContextualDetails()}`;
}
override getDisplayTitle(): string {
return this.params.command;
}
override getExplanation(): string {
return this.getContextualDetails().trim();
}
override getPolicyUpdateOptions(