mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-14 05:42:54 -07:00
feat(core): refine shell tool description display logic (#24903)
This commit is contained in:
@@ -63,6 +63,7 @@ export const OUTPUT_UPDATE_INTERVAL_MS = 1000;
|
||||
|
||||
// Delay so user does not see the output of the process before the process is moved to the background.
|
||||
const BACKGROUND_DELAY_MS = 200;
|
||||
const SHOW_NL_DESCRIPTION_THRESHOLD = 150;
|
||||
|
||||
export interface ShellToolParams {
|
||||
command: string;
|
||||
@@ -136,9 +137,12 @@ export class ShellToolInvocation extends BaseToolInvocation<
|
||||
}
|
||||
|
||||
getDescription(): string {
|
||||
return this.params.description?.trim()
|
||||
? this.params.description
|
||||
: this.params.command;
|
||||
const descStr = this.params.description?.trim();
|
||||
const commandStr = this.params.command;
|
||||
return Array.from(commandStr).length <= SHOW_NL_DESCRIPTION_THRESHOLD ||
|
||||
!descStr
|
||||
? commandStr
|
||||
: descStr;
|
||||
}
|
||||
|
||||
private simplifyPaths(paths: Set<string>): string[] {
|
||||
|
||||
Reference in New Issue
Block a user