fix(daemon): restore Antigravity STDIN pipe by omitting legacy -p flag#6060
fix(daemon): restore Antigravity STDIN pipe by omitting legacy -p flag#6060pratikforge wants to merge 6 commits into
Conversation
agy's -p/--print/--prompt takes the prompt as a command-line argument; it does not read from stdin and has no '-' stdin sentinel. The adapter invoked 'agy -p -' with promptViaStdin, so agy received the literal '-' as an empty prompt and replied "your request was empty or a placeholder (-)". - antigravity.ts: emit ['-p', <prompt>] and set promptViaStdin: false - executables.ts / app-config.ts: add missing AGY_BIN override key + allowlist entry so agy can be pointed at an explicit binary when auto-detection fails (parity with every other agent) - agent-args.test.ts: assert the new argv contract
…payload files" This reverts commit 9bfbe3d.
…cal agy environment
lefarcen
left a comment
There was a problem hiding this comment.
Hey @pratikforge — the regression write-up and the Windows reproduction are clear, especially the way you tied the ENAMETOOLONG failure back to the Antigravity prompt-delivery path. Before pool review picks this up, could you add the missing Surface area checklist and a short Validation section describing exactly what you ran to verify the fix?
Related: #5585 and #5997 are also open against this same Antigravity prompt-delivery area, so it would be good to compare approaches and avoid duplicate merge work.
|
🧪 Queued for QA validation — this PR changes a live runtime path, so we’ll keep the |
There was a problem hiding this comment.
Pull request overview
This PR updates the daemon’s Antigravity (agy) runtime integration to avoid the legacy -p - prompt-flag contract and improve compatibility with newer agy behavior (notably on Windows where long argv can trigger ENAMETOOLONG).
Changes:
- Adjust Antigravity runtime argument construction to stop relying on the legacy
-p -stdin-sentinel behavior. - Add
AGY_BINas a supported env override for resolving the Antigravity executable. - Update unit tests that pin the Antigravity argv/prompt-delivery contract.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| apps/daemon/src/runtimes/defs/antigravity.ts | Changes Antigravity runtime startup behavior (argv building, PATH handling, prompt delivery assumptions). |
| apps/daemon/tests/runtimes/agent-args.test.ts | Updates the pinned Antigravity argv/prompt-delivery expectations. |
| apps/daemon/src/runtimes/executables.ts | Adds AGY_BIN as the env var override key for Antigravity binary resolution. |
| apps/daemon/src/app-config.ts | Allows AGY_BIN in the agent CLI env allowlist for Antigravity. |
Comments suppressed due to low confidence (2)
apps/daemon/tests/runtimes/agent-args.test.ts:563
- The model-selection argv assertion still expects
-p <prompt>, but after switching antigravity back to stdin prompt delivery,buildArgsshould stay prompt-free and only include--log-file(plus any other non-prompt flags). Update this deep-equality assertion accordingly.
agentLogFilePath: '/tmp/od-agy-test.log',
antigravitySettingsPath: join(settingsDir, 'settings.json'),
});
assert.equal(withModel.includes('--model'), false);
assert.deepEqual(withModel, ['--log-file', '/tmp/od-agy-test.log', '-p', 'hi']);
apps/daemon/tests/runtimes/agent-args.test.ts:580
- Follow-up/first-turn assertions still expect
-p <prompt>argv. With stdin prompt delivery,buildArgsshould return the same prompt-free argv regardless of turn (and should still avoid-c). Update these expectations to match the new contract.
const followUp = antigravity.buildArgs('next message', [], [], {}, {
hasPriorAssistantTurn: true,
});
assert.deepEqual(followUp, ['-p', 'next message']);
assert.equal(followUp.includes('-c'), false);
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| import { dirname, join, delimiter } from 'node:path'; | ||
|
|
||
| const localAgyPath = join(process.cwd(), '.agy'); | ||
| if (existsSync(localAgyPath) && !process.env.PATH?.includes(localAgyPath)) { | ||
| process.env.PATH = localAgyPath + delimiter + process.env.PATH; | ||
| } |
| // plain-stream models like Gemini 3.5 Flash. | ||
| buildArgs: ( | ||
| _prompt, | ||
| prompt, | ||
| _imagePaths, | ||
| _extra = [], |
| // Flag order is load-bearing on agy: `agy -p --log-file /tmp/x <prompt>` | ||
| // runs, while the reverse leaves the log empty. | ||
| if (runtimeContext.agentLogFilePath) { | ||
| args.push('--log-file', runtimeContext.agentLogFilePath); | ||
| } |
| test('antigravity passes the prompt as the -p argument (print mode)', () => { | ||
| assert.equal(antigravity.bin, 'agy'); | ||
| assert.equal(antigravity.streamFormat, 'plain'); | ||
| assert.equal(antigravity.promptViaStdin, true); | ||
| assert.equal(antigravity.promptViaStdin, false); | ||
|
|
|
Hey @pratikforge — there are a couple of concrete follow-ups in the current review thread now: the test expectations still need to match the stdin-based prompt contract, and the module-level PATH mutation in 💡 To drive this PR to merge hands-free, paste this to your AI coding agent (Claude Code / Codex / opencode / Cursor …): |
lefarcen
left a comment
There was a problem hiding this comment.
Hey @pratikforge — thanks for updating the PR body; the added sections make the intent much easier to follow. There’s still one template pass left before pool review can scope this quickly: could you turn Surface area into the checklist form from the template, and make Bug fix verification / Validation a bit more concrete about the exact red→green repro and command(s) you ran?
|
Hey @lefarcen , thanks for the review! I've just pushed a new commit that addresses all the follow-ups:
Everything is green on my end, let me know if anything else is needed for merge! |
|
All done! Updated the description to match the template checklist and added the exact test path + repro details. @lefarcen |
|
Thanks @pratikforge — I can see the body updates landed, and the bot-side follow-ups you were responding to are covered now. From here the next step is pool review on the current head; once the PR is merge-ready, QA can pick up the |
Fixes #5495
Why
This fixes the ENAMETOOLONG crash on Windows when using the latest agy 1.1.x versions with large plugins (like the Default design router).
As noted in #5495, agy 1.1.x broke the legacy -p - CLI flag contract, treating the dash as an empty prompt rather than a STDIN sentinel. However, the background STDIN pipe itself still works natively in 1.1.x if the flag is omitted entirely.
This PR removes the explicit -p flag argument from buildArgs. When promptViaStdin is enabled, the daemon now correctly pipes the payload natively, completely resolving the Windows limit crash without needing temporary files or legacy binary downgrades.
What users will see
Proof it works!
Here is Open Design flawlessly rendering a massive payload using the latest agy 1.1.x on Windows without crashing:
Surface area
apps/weborapps/desktop(including Electron menu bar)odsubcommand or flag, newtools-dev/tools-pack/tools-prflag, or newOD_*env var/api/*endpoint, new SSE event, or changed shape inpackages/contractsskills/,design-systems/,design-templates/, orcraft/, or change to the skills protocolTRANSLATIONS.mdfor the locale workflow)package.jsonBug fix verification
apps/daemon/tests/runtimes/agent-args.test.tsmainand green on this branch? yesagy 1.1.5on Windows where a 30KB payload previously triggeredENAMETOOLONG.Validation
npx vitest run tests/runtimes/agent-args.test.tsnpx pnpm run tools-dev.