fix(proxy): Headless auto-spawn, cache invalidation, and CLI integration fixes - #127
fix(proxy): Headless auto-spawn, cache invalidation, and CLI integration fixes#127GTanger wants to merge 14 commits into
Conversation
…ssion to commandAction
…s to strict sandbox permissions
… defaults to strict sandbox permissions" This reverts commit 995e7ec.
…om permission to commandAction" This reverts commit 58de057.
… conversations instead of Desktop IDE ones
…ng finds CLI conversations
…idation - Use script utility to spawn standalone agy without requiring TTY - Invalidate instance cache immediately on unavailable/not_found RPC error - Retry routing directly instead of dropping the connection, ensuring automatic spawn if 0 instances remain
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7e580d4549
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| if (binaryPath === "agy" || binaryPath.endsWith("/agy")) { | ||
| console.log(`[Core Manager] Starting standalone Antigravity CLI via script...`); | ||
| coreProcess = spawn("script", ["-q", "-c", binaryPath, "/dev/null"], { |
There was a problem hiding this comment.
Use a platform-compatible PTY launcher
When PORTA_STANDALONE_CORE=true on Windows, this unconditionally spawns the Unix script utility even though Windows is a supported Tier 2 platform (README.md:93-103) and the repository contains no bundled wrapper. spawn therefore emits ENOENT, the error handler swallows it, and discovery continues to return no instances, making auto-spawn unusable from the documented PowerShell/cmd deployment. Select the launcher by platform or provide a portable PTY implementation.
Useful? React with 👍 / 👎.
| if (executable.toLowerCase() === "agy" || executable.toLowerCase() === "agy.exe") { | ||
| csrfToken = "agy_no_csrf"; | ||
| } else { | ||
| return undefined; |
There was a problem hiding this comment.
Normalize agy paths before applying the token fallback
When agy is invoked by absolute path without a CSRF argument—for example the /usr/local/bin/agy value explicitly accepted by PORTA_CORE_BINARY_PATH—the executable regex recognizes it, but this comparison checks the entire path rather than its basename and drops the process candidate. If daemon-file discovery is unavailable, process discovery can therefore never find the spawned CLI and the proxy remains without an instance; compare a normalized basename such as agy/agy.exe instead.
Useful? React with 👍 / 👎.
Description
This PR bundles several fixes required for robust
agyCLI integration and headless background execution:scriptutility to bypass the TTY limitation when spawningagyheadlessly.unavailableornot_foundRPC errors. This ensures seamless failover toensureStandaloneCorewhen the user closes their manual terminal.agyCLI discovery without requiring a CSRF token.antigravity-clitoKNOWN_APP_DATA_DIRSso that disk scanning successfully discovers CLI conversations.Testing
pnpm run lint) passes.pnpm run test) pass.agyterminal teardown, confirming automatic background failover.