mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-13 15:40:57 -07:00
Update shell.ts
Add exit_code before output or error to signal the model
This commit is contained in:
@@ -355,6 +355,10 @@ export class ShellToolInvocation extends BaseToolInvocation<
|
||||
// Create a formatted error string for display, replacing the wrapper command
|
||||
// with the user-facing command.
|
||||
|
||||
if (result.exitCode !== null) {
|
||||
parts.push(`<exit_code>${result.exitCode}</exit_code>`);
|
||||
}
|
||||
|
||||
const output = result.output || '(empty)';
|
||||
const parts = [`<output><![CDATA[${output}]]></output>`];
|
||||
if (result.error) {
|
||||
@@ -365,10 +369,6 @@ export class ShellToolInvocation extends BaseToolInvocation<
|
||||
parts.push(`<error><![CDATA[${finalError}]]></error>`);
|
||||
}
|
||||
|
||||
if (result.exitCode !== null) {
|
||||
parts.push(`<exit_code>${result.exitCode}</exit_code>`);
|
||||
}
|
||||
|
||||
if (result.signal) {
|
||||
parts.push(`<signal>${result.signal}</signal>`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user