mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-25 12:34:38 -07:00
fix(cli): pass session id to interactive shell executions (#25114)
This commit is contained in:
committed by
GitHub
parent
b499562921
commit
7bba7f437c
@@ -133,6 +133,7 @@ describe('useExecutionLifecycle', () => {
|
|||||||
mockConfig = {
|
mockConfig = {
|
||||||
getTargetDir: () => '/test/dir',
|
getTargetDir: () => '/test/dir',
|
||||||
getEnableInteractiveShell: () => false,
|
getEnableInteractiveShell: () => false,
|
||||||
|
getSessionId: () => 'test-session-id',
|
||||||
getShellExecutionConfig: () => ({
|
getShellExecutionConfig: () => ({
|
||||||
terminalHeight: 20,
|
terminalHeight: 20,
|
||||||
terminalWidth: 80,
|
terminalWidth: 80,
|
||||||
@@ -246,11 +247,32 @@ describe('useExecutionLifecycle', () => {
|
|||||||
expect.any(Function),
|
expect.any(Function),
|
||||||
expect.any(Object),
|
expect.any(Object),
|
||||||
false,
|
false,
|
||||||
expect.any(Object),
|
expect.objectContaining({
|
||||||
|
sessionId: 'test-session-id',
|
||||||
|
}),
|
||||||
);
|
);
|
||||||
expect(onExecMock).toHaveBeenCalledWith(expect.any(Promise));
|
expect(onExecMock).toHaveBeenCalledWith(expect.any(Promise));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should pass the config sessionId into shell execution config', async () => {
|
||||||
|
const { result } = await renderProcessorHook();
|
||||||
|
|
||||||
|
await act(async () => {
|
||||||
|
result.current.handleShellCommand('top', new AbortController().signal);
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(mockShellExecutionService).toHaveBeenCalledWith(
|
||||||
|
expect.any(String),
|
||||||
|
'/test/dir',
|
||||||
|
expect.any(Function),
|
||||||
|
expect.any(Object),
|
||||||
|
false,
|
||||||
|
expect.objectContaining({
|
||||||
|
sessionId: 'test-session-id',
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
it('should handle successful execution and update history correctly', async () => {
|
it('should handle successful execution and update history correctly', async () => {
|
||||||
const { result } = await renderProcessorHook();
|
const { result } = await renderProcessorHook();
|
||||||
|
|
||||||
|
|||||||
@@ -409,6 +409,7 @@ export const useExecutionLifecycle = (
|
|||||||
const activeTheme = themeManager.getActiveTheme();
|
const activeTheme = themeManager.getActiveTheme();
|
||||||
const shellExecutionConfig = {
|
const shellExecutionConfig = {
|
||||||
...config.getShellExecutionConfig(),
|
...config.getShellExecutionConfig(),
|
||||||
|
sessionId: config.getSessionId(),
|
||||||
terminalWidth,
|
terminalWidth,
|
||||||
terminalHeight,
|
terminalHeight,
|
||||||
defaultFg: activeTheme.colors.Foreground,
|
defaultFg: activeTheme.colors.Foreground,
|
||||||
|
|||||||
Reference in New Issue
Block a user