Skip to content

fix(antigravity): launch POSIX hooks through an explicit shell - #21635

Merged
nwparker merged 4 commits into
nwparker/agy-hook-stdinfrom
nwparker/agy-hook-exec
Sep 21, 2026
Merged

nwparker merged 4 commits into
nwparker/agy-hook-stdinfrom
nwparker/agy-hook-exec

Conversation

@nwparker

@nwparker nwparker commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

Latest verification — 2026-09-20: Authenticated local generation now succeeds; the earlier 401 is resolved. Real captured hook payloads pass the branch POSIX script. Actual Zed/ACP recovery and live Linux/SSH wrapper execution remain unverified; do not infer them from the process tests. All checks at the unchanged PR head are green. Earlier screenshots and test notes below describe their original runs.

Files Added Deleted Net
Test 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​88 $\color{#cf222e}{\Huge{\mathbf{−}}}$​18 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​70
Prod 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​67 $\color{#cf222e}{\Huge{\mathbf{−}}}$​3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​64

ELI5

Some Antigravity hosts launch a hook as a program. Orca gave them a command starting with the shell keyword if, so the hook could not start and tool calls were denied. Orca now explicitly starts the shell that understands that command.

What Changed

Antigravity's local and remote POSIX installers wrap the existing guarded command in /bin/sh -c. The missing-script permission response, quoting, and current environment guard are preserved. Other agent installers and Windows commands keep their existing behavior.

This takes over the approach from @maxmilian's #16222 onto current code, preserving the newer environment guard and adding executable tests for missing environment, missing/non-executable files, and unusual paths. Stacked on #21634.

Why

Using an explicit shell works with both direct program launchers and callers that already invoke a shell. Launching the script directly would lose the guard and permission response when the script has been removed.

Linked Issue

Addresses #16087; continuation of #16222. No issue closure claimed until actual ACP integration is verified.

Visual Proof

Real Python shlex.split and subprocess execution, using generated hook scripts inside a hidden Orca terminal. The lower comparison uses this rebased source. Before: direct execution fails with ENOENT: if. After: both launch paths return {"decision":"ask"}, with the script present or missing. Paths include spaces, quotes, dollar signs, backticks, and Unicode.

Before and after launch verification

The terminal is an earlier renderer build hosting newly generated scripts. This proves the command-launch behavior; it is not a successful Zed/ACP tool-call demonstration.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated

macOS: 41 tests pass across the executable wrapper, Antigravity service, and remote installer suites. Full pnpm tc passes after adding the inherited bounded-reader CLI project entry and using the typed async process runner in the executable tests. Changed-code quality gate and pre-commit lint cover the changed files. Full build and other platforms remain for CI.

Review

Actual Zed/ACP recovery remains unverified. Installed agy has no advertised ACP subcommand. Authenticated generation now succeeds (see latest verification above). Linux/SSH execution and actual Windows regression testing remain pending. Remote installer tests verify generated commands, not a live SSH host. The missing-script fallback still expects EOF; #21634's bounded reader applies when the managed script exists.

Agent skill upstream boundary

  • Not applicable; no upstream skill source copied.

Checklist

  • Small, focused change with ELI5, mechanism and alternatives explained
  • Before/after evidence attached
  • Self-reviewed for correctness, security, performance, and platform/SSH impact
  • Full lint, typecheck, test, and build coverage (focused checks above; CI pending)

@nwparker

Copy link
Copy Markdown
Contributor Author

Independent verification update:

  • Installed agy 1.2.7 returned the exact sentinel AGY_HOOK_EXEC_LIVE_OK.
  • POSIX wrapper/Antigravity/remote-installer suites: 41 passed.
  • pnpm tc:node and pnpm tc:cli passed.
  • Changed-code quality passed with 0 new findings.
  • Replacement CI run 35434509245 passed typecheck, static analysis, all 8 test shards, managed hooks, verify, and both packages.

Scoped verdict: Approve after CI for explicit /bin/sh -c POSIX hook launching, stacked on #21634. Live Zed/ACP recovery, Linux/SSH wrapper execution, and Windows regression remain unverified.

@nwparker

Copy link
Copy Markdown
Contributor Author

Independent verification (2026-09-20):

  • POSIX shell-launch, hook, remote-installer, and payload suites: 59 passed, 2 skipped.
  • pnpm tc:node and pnpm tc:cli passed.
  • pnpm run check:code-quality:changed origin/main passed with 0 new findings across 37 changed files.
  • Installed agy 1.2.7 authenticated exact sentinel returned AGY_SHELL_HOOK_OK.
  • Full CI 35434509245 is green across test shards, typecheck, static analysis, managed hooks, and macOS/Windows packages.

Verdict: approve after CI, stacked on #21634, for explicit /bin/sh -c POSIX hook launch. Zed/ACP recovery, Linux/SSH, and Windows execution remain outside this proof. No merge performed.

@nwparker

Copy link
Copy Markdown
Contributor Author

Fresh CI rerun: green.

ELI5: POSIX hooks now run through the shell they need, so valid hook scripts do not fail because Orca launched them the wrong way. Scoped tests and CI are green; merge verdict: approve scoped hook behavior.

@nwparker
nwparker marked this pull request as ready for review September 21, 2026 03:58
@pullfrog

pullfrog Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

This run was cancelled 🛑

The workflow was cancelled before completion. Please check the link below for details.

Pullfrog  | View workflow run | via Pullfrog | 𝕏

@nwparker
nwparker merged commit 95ed84d into nwparker/agy-hook-stdin Sep 21, 2026
63 of 81 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.

1 participant