mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-13 15:40:57 -07:00
feat(core): separate stdout and stderr in discovered tool output
This commit is contained in:
@@ -550,8 +550,9 @@ describe('ToolRegistry', () => {
|
||||
expect(result.error?.type).toBe(
|
||||
ToolErrorType.DISCOVERED_TOOL_EXECUTION_ERROR,
|
||||
);
|
||||
expect(result.llmContent).toContain('<stdout>(empty)</stdout>');
|
||||
expect(result.llmContent).toContain(
|
||||
'<output>Something went wrong</output>',
|
||||
'<stderr>Something went wrong</stderr>',
|
||||
);
|
||||
expect(result.llmContent).toContain('<exit_code>1</exit_code>');
|
||||
});
|
||||
|
||||
@@ -104,7 +104,7 @@ class DiscoveredToolInvocation extends BaseToolInvocation<
|
||||
// if there is any error, non-zero exit code, signal, or stderr, return error details instead of stdout
|
||||
if (error || code !== 0 || signal || stderr) {
|
||||
const parts = [
|
||||
`<output>${(stdout + stderr).trim() || '(empty)'}</output>`,
|
||||
`<output>\n <stdout>${stdout.trim() || '(empty)'}</stdout>\n <stderr>${stderr.trim() || '(empty)'}</stderr>\n </output>`,
|
||||
];
|
||||
if (error) {
|
||||
parts.push(`<error>${error}</error>`);
|
||||
|
||||
Reference in New Issue
Block a user