Skip to content

fix(proxy): Headless auto-spawn, cache invalidation, and CLI integration fixes - #127

Open
GTanger wants to merge 14 commits into
L1M80:developfrom
GTanger:feature/headless-core
Open

fix(proxy): Headless auto-spawn, cache invalidation, and CLI integration fixes#127
GTanger wants to merge 14 commits into
L1M80:developfrom
GTanger:feature/headless-core

Conversation

@GTanger

@GTanger GTanger commented Aug 3, 2026

Copy link
Copy Markdown

Description

This PR bundles several fixes required for robust agy CLI integration and headless background execution:

  1. Headless Core Auto-Spawn & Failover:
    • Uses the script utility to bypass the TTY limitation when spawning agy headlessly.
    • The proxy now instantly invalidates its instance cache upon encountering unavailable or not_found RPC errors. This ensures seamless failover to ensureStandaloneCore when the user closes their manual terminal.
  2. CLI Discovery: Allows headless agy CLI discovery without requiring a CSRF token.
  3. Payload Fixes: Restores the correct permission payload for command actions.
  4. Data Directories: Adds antigravity-cli to KNOWN_APP_DATA_DIRS so that disk scanning successfully discovers CLI conversations.

Testing

  • Linting (pnpm run lint) passes.
  • Unit tests (pnpm run test) pass.
  • Tested locally with manual agy terminal teardown, confirming automatic background failover.

Tanger added 12 commits June 26, 2026 23:12
… defaults to strict sandbox permissions"

This reverts commit 995e7ec.
…om permission to commandAction"

This reverts commit 58de057.
… conversations instead of Desktop IDE ones
…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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread packages/proxy/src/core-manager.ts Outdated

if (binaryPath === "agy" || binaryPath.endsWith("/agy")) {
console.log(`[Core Manager] Starting standalone Antigravity CLI via script...`);
coreProcess = spawn("script", ["-q", "-c", binaryPath, "/dev/null"], {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment thread packages/proxy/src/platform/shared.ts Outdated
Comment on lines +73 to +76
if (executable.toLowerCase() === "agy" || executable.toLowerCase() === "agy.exe") {
csrfToken = "agy_no_csrf";
} else {
return undefined;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant