mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-13 15:40:57 -07:00
Update shell.ts
Wrap XML content in CDATA
This commit is contained in:
@@ -354,16 +354,15 @@ export class ShellToolInvocation extends BaseToolInvocation<
|
||||
} else {
|
||||
// Create a formatted error string for display, replacing the wrapper command
|
||||
// with the user-facing command.
|
||||
const output = result.output || '(empty)';
|
||||
const parts = [`<output>${output}</output>`];
|
||||
|
||||
const output = result.output || '(empty)';
|
||||
const parts = [`<output><![CDATA[${output}]]></output>`];
|
||||
if (result.error) {
|
||||
const finalError = result.error.message.replaceAll(
|
||||
commandToExecute,
|
||||
this.params.command,
|
||||
);
|
||||
parts.push(`<error>${finalError}</error>`);
|
||||
}
|
||||
parts.push(`<error><![CDATA[${finalError}]]></error>`);
|
||||
|
||||
if (result.exitCode !== null) {
|
||||
parts.push(`<exit_code>${result.exitCode}</exit_code>`);
|
||||
|
||||
Reference in New Issue
Block a user