Skip to content

Commit a703dca

Browse files
committed
fix(exec): qualify unavailable-workdir diagnostic as gateway-local
The shared formatUnavailableWorkdirFailure formatter is used by gateway, node, and sandbox exec paths. The previous wording "for local execution" implied the message applied globally. Changing to "for gateway-local execution" makes the scope accurate for all callers. P2: make unavailable-workdir guidance host-aware.
1 parent f8f3cba commit a703dca

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/agents/bash-tools.exec-foreground-failures.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ async function expectUnavailableWorkdir(params: {
100100
const text = requireTextContent(result);
101101
expect(text).toContain(`workdir "${params.workdir}" is unavailable or not a directory`);
102102
expect(text).toContain("command was not executed");
103-
expect(text).toContain('Leading "~" is expanded to the home directory for local execution');
103+
expect(text).toContain('Leading "~" is expanded for gateway-local execution');
104104
const details = requireFailedDetails(result.details);
105105
expect(details.exitCode).toBeNull();
106106
expect(details.timedOut).toBe(false);

src/agents/bash-tools.exec-workdir.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ async function resolveSandboxWorkdir(params: {
329329
export function formatUnavailableWorkdirFailure(workdir: string): string {
330330
return [
331331
`workdir "${workdir}" is unavailable or not a directory: command was not executed.`,
332-
'Leading "~" is expanded to the home directory for local execution.',
332+
'Leading "~" is expanded for gateway-local execution.',
333333
"Use an existing directory, omit an explicit workdir to use the default cwd, or update the configured default cwd.",
334334
].join(" ");
335335
}

src/agents/bash-tools.exec.path.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ describe("exec PATH login shell merge", () => {
234234
expect(result.details?.status).toBe("failed");
235235
expect(value).toContain(`workdir "${missingWorkdir}" is unavailable or not a directory`);
236236
expect(value).toContain("command was not executed");
237-
expect(value).toContain('Leading "~" is expanded to the home directory for local execution');
237+
expect(value).toContain('Leading "~" is expanded for gateway-local execution');
238238
expect(value).not.toMatch(/^ok/);
239239
});
240240

0 commit comments

Comments
 (0)