Skip to content

fix(acp): keep the ACP run temp folder short enough for unix sockets - #38968

Merged
nwparker merged 1 commit into
mainfrom
nwparker/agy-acp-temp-socket-path
Nov 6, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/agy-acp-temp-socket-path

Conversation

@nwparker

@nwparker nwparker commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Supersedes #33948 by @thefrikidude (Manan Chataut), with follow-ups from @Jinwoo-H. The original branch conflicts with main, so this ports it onto current main. The commit keeps Manan as author and credits the others with Co-authored-by trailers.

Fixes #33809

Problem

An ACP agent's TMPDIR lived inside the Orca data folder. On macOS, a child socket such as datacloud-mcp-dataAgentKit-antigravityide.sock then had a path 131 bytes long. The sun_path limit is 103 bytes, so Antigravity's MCP proxy could not bind its socket.

Fix

  • If a socket under <data>/acp-temp/<agent>/run-XXXXXX/ would not fit, the run root moves to /tmp/oacp-<uid>/<sha256(dataRoot)[0:8]>. That parent folder is checked with the existing ensureOwnedPrivateDir (mode 0700, owned by this user). The hash stops two Orca copies from wiping each other's runs.
  • The old data-root folder is wiped once, so leftover runs from before this change don't sit there (about 1 GB each).
  • Windows, and roots that already fit, keep the current behavior.

Port notes (conflicts with main)

  • acp-private-temp.ts: main now throws launchPreparationFailure(error) instead of new AgentSessionPreSpawnError(error). The PR's logic is kept and uses the new helper.
  • daemon-socket-endpoint-path.ts moved to src/main/daemon/endpoint/publication/. The import and the error-message tweak point there now.
  • structured-agent-launch-parity.test.ts was removed from main, so the PR's change to it is dropped.
  • The PR's daemon-init-fresh-import commit (test(daemon): import fresh daemon-init modules one at a time #34085) is already on main, so it is not included.
  • New: acp-text-task.test.ts makes its scratch root as a short /tmp/o… folder on POSIX, the same pattern the PR uses in other fixtures. Without this, the private-temp stage test waits for a path containing acp-temp that never appears once the root moves.

Verification

  • pnpm typecheck:node passes.
  • pnpm test src/main/acp src/main/antigravity src/main/daemon/endpoint passes, including the PR's real-socket relocation test.
  • pnpm check:changed: every gate passes except unit tests. The unit-test failures are in the cross-version wire harness (tar -xf timed out after 45000ms while extracting old releases, plus a shared release-lock clash), orcad-chat-restart-offer and structured-agent-launch-support. They happened with machine load around 70–90. On rerun, orcad-chat-restart-offer and the others pass; two cross-version harness tests still time out extracting releases. None of these touch ACP temp paths.
Files Added Deleted Net
Test 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​70 $\color{#cf222e}{\Huge{\mathbf{−}}}$​3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​67
Prod 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​57 $\color{#cf222e}{\Huge{\mathbf{−}}}$​18 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​39

An ACP agent's TMPDIR sat inside the data folder. On macOS that path made
a socket such as datacloud-mcp-dataAgentKit-antigravityide.sock 131 bytes
long, over the 103-byte limit, so child programs could not bind it.

When a socket under the data-folder root would not fit, use a short
per-user folder in /tmp (mode 0700, owner checked via ensureOwnedPrivateDir,
keyed by a hash of the data root so Orca copies never wipe each other), and
clear the old data root once. Roots that fit, and Windows, keep the current
behavior.

Ported from #33948 onto current main (acp-private-temp now uses
launchPreparationFailure; daemon-socket-endpoint-path moved under
daemon/endpoint/publication; the launch-parity test it touched was removed).

Co-authored-by: Jinwoo-H <jinwoo0825@gmail.com>
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 52 seconds.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: bbe8f144-2147-4791-b0d0-0e477173aa96
Commits

Reviewing files that changed from the base of the PR and between 054482e and 5c11cf8.

Files selected for processing: 6

  • src/main/acp/acp-private-temp.ts
  • src/main/acp/acp-structured-adapter.test-support.ts
  • src/main/acp/acp-structured-private-temp.test.ts
  • src/main/acp/acp-text-task.test.ts
  • src/main/antigravity/antigravity-chat-sign-in.test.ts
  • src/main/daemon/endpoint/publication/daemon-socket-endpoint-path.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@nwparker
nwparker merged commit 18e9927 into main Nov 6, 2026
59 checks passed
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.

[Bug]: ACP run TMPDIR under ~/Library/Application Support breaks agent-side unix-socket MCPs with EINVAL (macOS)

1 participant