Merge branch 'main' into mb/atui/00-display-content

This commit is contained in:
Michael Bleigh
2026-04-10 11:44:16 -07:00
committed by GitHub
5 changed files with 132 additions and 1 deletions
+47
View File
@@ -304,6 +304,53 @@ describe('Server Config (config.ts)', () => {
});
});
describe('setShellExecutionConfig', () => {
it('should preserve existing shell execution fields that are not being updated', () => {
const config = new Config({
...baseParams,
sandbox: {
enabled: true,
command: 'windows-native',
networkAccess: false,
},
shellBackgroundCompletionBehavior: 'notify',
});
expect(config.getShellExecutionConfig()).toEqual(
expect.objectContaining({
sandboxConfig: expect.objectContaining({
enabled: true,
command: 'windows-native',
networkAccess: false,
}),
backgroundCompletionBehavior: 'notify',
}),
);
config.setShellExecutionConfig({
terminalWidth: 123,
terminalHeight: 45,
showColor: true,
pager: 'cat',
sanitizationConfig: config.sanitizationConfig,
sandboxManager: config.sandboxManager,
});
expect(config.getShellExecutionConfig()).toEqual(
expect.objectContaining({
terminalWidth: 123,
terminalHeight: 45,
sandboxConfig: expect.objectContaining({
enabled: true,
command: 'windows-native',
networkAccess: false,
}),
backgroundCompletionBehavior: 'notify',
}),
);
});
});
beforeEach(() => {
// Reset mocks if necessary
vi.clearAllMocks();
+1
View File
@@ -3334,6 +3334,7 @@ export class Config implements McpContext, AgentLoopContext {
setShellExecutionConfig(config: ShellExecutionConfig): void {
this.shellExecutionConfig = {
...this.shellExecutionConfig,
terminalWidth:
config.terminalWidth ?? this.shellExecutionConfig.terminalWidth,
terminalHeight: