fix(coding-agent): resolve shell config from session settings
Stop shell resolution from consulting ambient process.cwd() during bash execution and use the active session's shellPath setting instead. closes #3452
This commit is contained in:
@@ -409,6 +409,28 @@ describe("Coding Agent Tools", () => {
|
||||
await expect(bashWithBadShell.execute("test-call-12", { command: "echo test" })).rejects.toThrow(/ENOENT/);
|
||||
});
|
||||
|
||||
it("should pass shellPath through to shell resolution", async () => {
|
||||
const getShellConfigSpy = vi.spyOn(shellModule, "getShellConfig");
|
||||
const bashWithCustomShell = createBashTool(testDir, {
|
||||
shellPath: "/custom/bash",
|
||||
operations: {
|
||||
exec: async () => ({ exitCode: 0 }),
|
||||
},
|
||||
});
|
||||
|
||||
await bashWithCustomShell.execute("test-call-12b", { command: "echo test" });
|
||||
|
||||
expect(getShellConfigSpy).not.toHaveBeenCalled();
|
||||
|
||||
const ops = createLocalBashOperations({ shellPath: "/custom/bash" });
|
||||
await expect(
|
||||
ops.exec("echo test", testDir, {
|
||||
onData: () => {},
|
||||
}),
|
||||
).rejects.toThrow("Custom shell path not found: /custom/bash");
|
||||
expect(getShellConfigSpy).toHaveBeenCalledWith("/custom/bash");
|
||||
});
|
||||
|
||||
it("should prepend command prefix when configured", async () => {
|
||||
const bashWithPrefix = createBashTool(testDir, {
|
||||
commandPrefix: "export TEST_VAR=hello",
|
||||
|
||||
Reference in New Issue
Block a user