feat(shell): Standardize pager to 'cat' for shell execution by model (#13878)

This commit is contained in:
Gal Zahavi
2025-11-26 17:23:31 -08:00
committed by GitHub
parent 69188c8538
commit b9dc8eb14d
3 changed files with 7 additions and 5 deletions
@@ -221,6 +221,7 @@ export class ShellExecutionService {
GEMINI_CLI: '1', GEMINI_CLI: '1',
TERM: 'xterm-256color', TERM: 'xterm-256color',
PAGER: 'cat', PAGER: 'cat',
GIT_PAGER: 'cat',
}, },
}); });
@@ -434,6 +435,7 @@ export class ShellExecutionService {
GEMINI_CLI: '1', GEMINI_CLI: '1',
TERM: 'xterm-256color', TERM: 'xterm-256color',
PAGER: shellExecutionConfig.pager ?? 'cat', PAGER: shellExecutionConfig.pager ?? 'cat',
GIT_PAGER: shellExecutionConfig.pager ?? 'cat',
}, },
handleFlowControl: true, handleFlowControl: true,
}); });
+4 -4
View File
@@ -222,7 +222,7 @@ describe('ShellTool', () => {
expect.any(Function), expect.any(Function),
expect.any(AbortSignal), expect.any(AbortSignal),
false, false,
{}, { pager: 'cat' },
); );
expect(result.llmContent).toContain('Background PIDs: 54322'); expect(result.llmContent).toContain('Background PIDs: 54322');
// The file should be deleted by the tool // The file should be deleted by the tool
@@ -247,7 +247,7 @@ describe('ShellTool', () => {
expect.any(Function), expect.any(Function),
expect.any(AbortSignal), expect.any(AbortSignal),
false, false,
{}, { pager: 'cat' },
); );
}); });
@@ -268,7 +268,7 @@ describe('ShellTool', () => {
expect.any(Function), expect.any(Function),
expect.any(AbortSignal), expect.any(AbortSignal),
false, false,
{}, { pager: 'cat' },
); );
}); });
@@ -295,7 +295,7 @@ describe('ShellTool', () => {
expect.any(Function), expect.any(Function),
expect.any(AbortSignal), expect.any(AbortSignal),
false, false,
{}, { pager: 'cat' },
); );
}, },
20000, 20000,
+1 -1
View File
@@ -241,7 +241,7 @@ export class ShellToolInvocation extends BaseToolInvocation<
}, },
combinedController.signal, combinedController.signal,
this.config.getEnableInteractiveShell(), this.config.getEnableInteractiveShell(),
shellExecutionConfig ?? {}, { ...shellExecutionConfig, pager: 'cat' },
); );
if (pid && setPidCallback) { if (pid && setPidCallback) {