mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-27 21:44:25 -07:00
fix(cli) - Add logging for shell errors (#7007)
Co-authored-by: Shi Shu <shii@google.com> Co-authored-by: Jacob Richman <jacob314@gmail.com>
This commit is contained in:
@@ -9,6 +9,7 @@ import path from 'node:path';
|
||||
import os, { EOL } from 'node:os';
|
||||
import crypto from 'node:crypto';
|
||||
import type { Config } from '../config/config.js';
|
||||
import { ToolErrorType } from './tool-error.js';
|
||||
import type {
|
||||
ToolInvocation,
|
||||
ToolResult,
|
||||
@@ -263,6 +264,14 @@ class ShellToolInvocation extends BaseToolInvocation<
|
||||
}
|
||||
|
||||
const summarizeConfig = this.config.getSummarizeToolOutputConfig();
|
||||
const executionError = result.error
|
||||
? {
|
||||
error: {
|
||||
message: result.error.message,
|
||||
type: ToolErrorType.SHELL_EXECUTE_ERROR,
|
||||
},
|
||||
}
|
||||
: {};
|
||||
if (summarizeConfig && summarizeConfig[ShellTool.Name]) {
|
||||
const summary = await summarizeToolOutput(
|
||||
llmContent,
|
||||
@@ -273,12 +282,14 @@ class ShellToolInvocation extends BaseToolInvocation<
|
||||
return {
|
||||
llmContent: summary,
|
||||
returnDisplay: returnDisplayMessage,
|
||||
...executionError,
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
llmContent,
|
||||
returnDisplay: returnDisplayMessage,
|
||||
...executionError,
|
||||
};
|
||||
} finally {
|
||||
if (fs.existsSync(tempFilePath)) {
|
||||
|
||||
Reference in New Issue
Block a user