mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-21 02:24:09 -07:00
fix: ACP: separate conversational text from execute tool command title (#23179)
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user