Skip to content

Commit ceb2bc9

Browse files
committed
fix(antigravity): add prompt dir to workspace instead of cwd
1 parent 872cad1 commit ceb2bc9

2 files changed

Lines changed: 3 additions & 11 deletions

File tree

apps/daemon/src/runtimes/defs/antigravity.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,9 +228,7 @@ export const antigravityAgentDef = {
228228
args.push('--log-file', runtimeContext.agentLogFilePath);
229229
}
230230

231-
if (runtimeContext.cwd) {
232-
args.push('--add-dir', runtimeContext.cwd);
233-
}
231+
args.push('--add-dir', dirname(runtimeContext.promptFilePath));
234232

235233
args.push('-p');
236234
args.push(`Read the system instructions, conversation history, and user request from the file ${runtimeContext.promptFilePath}. Follow the instructions strictly and provide the final response to the user's latest request.`);

apps/daemon/tests/runtimes/agent-args.test.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -549,19 +549,13 @@ test('antigravity delivers prompt via managed temp file instead of stdin', () =>
549549
const args = antigravity.buildArgs('write hello world', [], [], {}, {
550550
promptFilePath: '/tmp/managed-prompt.md'
551551
});
552-
assert.deepEqual(args, ['-p', expectedFileText]);
552+
assert.deepEqual(args, ['--add-dir', '/tmp', '-p', expectedFileText]);
553553

554554
const argsWithLog = antigravity.buildArgs('write hello world', [], [], {}, {
555555
agentLogFilePath: '/tmp/od-agy-test.log',
556556
promptFilePath: '/tmp/managed-prompt.md'
557557
});
558-
assert.deepEqual(argsWithLog, ['--log-file', '/tmp/od-agy-test.log', '-p', expectedFileText]);
559-
560-
const argsWithCwd = antigravity.buildArgs('write hello world', [], [], {}, {
561-
cwd: '/fake/project/dir',
562-
promptFilePath: '/tmp/managed-prompt.md'
563-
});
564-
assert.deepEqual(argsWithCwd, ['--add-dir', '/fake/project/dir', '-p', expectedFileText]);
558+
assert.deepEqual(argsWithLog, ['--log-file', '/tmp/od-agy-test.log', '--add-dir', '/tmp', '-p', expectedFileText]);
565559

566560
// No `--model` flag exists upstream, so buildArgs argv must stay the
567561
// same regardless of which label the user picks.

0 commit comments

Comments
 (0)