Skip to content

Commit 512853b

Browse files
committed
fix(agents): distinguish explicit node workdirs
1 parent 1ae7195 commit 512853b

4 files changed

Lines changed: 5 additions & 3 deletions

File tree

src/agents/bash-tools.exec-host-node-phases.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@ export function shouldSkipNodeApprovalPrepare(params: {
5151
hostSecurity: ExecSecurity;
5252
hostAsk: ExecAsk;
5353
strictInlineEval?: boolean;
54-
workdir?: string;
54+
workdirExplicit?: boolean;
5555
}): boolean {
5656
return (
5757
params.hostSecurity === "full" &&
5858
params.hostAsk === "off" &&
5959
params.strictInlineEval !== true &&
60-
params.workdir === undefined
60+
params.workdirExplicit !== true
6161
);
6262
}
6363

src/agents/bash-tools.exec-host-node.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export async function executeNodeHostCommand(
4444
hostSecurity,
4545
hostAsk,
4646
strictInlineEval: params.strictInlineEval,
47-
workdir: params.workdir,
47+
workdirExplicit: params.workdirExplicit,
4848
})
4949
) {
5050
return await invokeNodeSystemRunDirect({ request: params, target });

src/agents/bash-tools.exec-host-node.types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import type { ExecAsk, ExecSecurity } from "../infra/exec-approvals.js";
33
export type ExecuteNodeHostCommandParams = {
44
command: string;
55
workdir: string | undefined;
6+
workdirExplicit?: boolean;
67
env: Record<string, string>;
78
requestedEnv?: Record<string, string>;
89
requestedNode?: string;

src/agents/bash-tools.exec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1609,6 +1609,7 @@ export function createExecTool(
16091609
return executeNodeHostCommand({
16101610
command: params.command,
16111611
workdir,
1612+
workdirExplicit: explicitWorkdir !== undefined,
16121613
env,
16131614
requestedEnv: params.env,
16141615
requestedNode: params.node?.trim(),

0 commit comments

Comments
 (0)