summaryrefslogtreecommitdiff
path: root/packages/core/src/tools/shell.ts
diff options
context:
space:
mode:
authorAkhil Appana <[email protected]>2025-08-08 04:33:42 -0700
committerGitHub <[email protected]>2025-08-08 11:33:42 +0000
commitf5e0f16157da6a0b0dbae3b4ebf920fdee81c461 (patch)
treee8f91ee92d41a5ac7280b2bad7e8cba103bc1ca7 /packages/core/src/tools/shell.ts
parent5ab184fcaf40d4e7dec9ba6a0526cac39b602ee2 (diff)
fix: properly report tool errors in telemetry (#5688)
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Diffstat (limited to 'packages/core/src/tools/shell.ts')
-rw-r--r--packages/core/src/tools/shell.ts7
1 files changed, 6 insertions, 1 deletions
diff --git a/packages/core/src/tools/shell.ts b/packages/core/src/tools/shell.ts
index 96423af1..6106c0cd 100644
--- a/packages/core/src/tools/shell.ts
+++ b/packages/core/src/tools/shell.ts
@@ -17,6 +17,7 @@ import {
ToolConfirmationOutcome,
Icon,
} from './tools.js';
+import { ToolErrorType } from './tool-error.js';
import { Type } from '@google/genai';
import { SchemaValidator } from '../utils/schemaValidator.js';
import { getErrorMessage } from '../utils/errors.js';
@@ -186,8 +187,12 @@ export class ShellTool extends BaseTool<ShellToolParams, ToolResult> {
});
if (validationError) {
return {
- llmContent: validationError,
+ llmContent: `Could not execute command due to invalid parameters: ${validationError}`,
returnDisplay: validationError,
+ error: {
+ message: validationError,
+ type: ToolErrorType.INVALID_TOOL_PARAMS,
+ },
};
}