Skip to content

fix(hive): quote provider hooks for spaced POSIX paths - #369

Merged
chaitanyagiri merged 1 commit into
HarnessMD:mainfrom
drona23:fix/provider-hook-spaced-paths-364
Sep 6, 2026
Merged

chaitanyagiri merged 1 commit into
HarnessMD:mainfrom
drona23:fix/provider-hook-spaced-paths-364

Conversation

@drona23

@drona23 drona23 commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

What & why

Gemini and Antigravity lifecycle-hook JSON stored unquoted launcher and shim paths. On macOS/Linux, a valid user-selected hive path containing a space was split by /bin/sh, so both commands exited 127 before either shim started.

Use the existing quoted nodeRun() form for these two providers on POSIX while preserving their legacy Windows command shape. The regression executes the exact generated commands with a stripped hook PATH and verifies that both shims reach HIVE_SOCK.

Closes #364

This intentionally excludes Codex, which is already handled by #356, and does not alter the separate Windows cross-shell contract tracked in #350.

Type of change

  • Bug fix
  • New feature
  • Refactor / cleanup
  • Docs
  • Build / CI

Evidence

Before

Before: Gemini and Antigravity commands both exit 127 from a spaced hive path

After

After: both stored commands execute successfully from the same spaced path

How I tested it

  • OS: macOS arm64
  • node --test test/hive-hook-node.test.cjs — 11/11 pass
  • npm run test:focused — 746/746 pass
  • npm run typecheck — node and web pass
  • npm run build — production build succeeds
  • git diff --check — clean

Checklist

  • Before and after evidence is attached above.
  • npm run typecheck passes.
  • npm run test:focused passes.
  • npm run build succeeds.
  • This PR is one change.
  • I read the diff and removed the overlapping Codex/dependency changes.
  • No UI tokens or art are changed.

@drona23 drona23 mentioned this pull request Aug 28, 2026
13 tasks
mrlfarano added a commit to mrlfarano/munder-difflin that referenced this pull request Aug 31, 2026
@chaitanyagiri

Copy link
Copy Markdown
Collaborator

Reviewed by an agent on the Munder Difflin hive floor, posted from @chaitanyagiri.
First person statements below are the agent's, including the scope limits.
Replies here are read. Questions in this comment are real questions.
Base: origin/main at 956bfb4.


The comment rewrite is the honest part of this and worth keeping as written. The old one claimed
the hive root is space-free by construction, and the new one says the user selected path may
legitimately contain spaces. That assumption being wrong is the whole of #350 and #364, so
correcting the comment matters as much as correcting the code.

The test runs the generated command string for real and asserts both shims reach HIVE_SOCK,
which is much better than asserting the string looks right. That said, it proves the string works
under whatever run() executes it with, and the real consumer is agy's own hook runner. If agy
splits the command field on whitespace on POSIX instead of handing it to a shell, quoting breaks
it and this test would still pass.
You clearly know the executor differs per platform, since
win32 keeps nodeRunUnquoted. Can you say in the PR how you established that the POSIX side goes
through a shell? If it was measured against agy rather than inferred, that is the sentence that
makes this reviewable.

Minor: nodeRun quotes the launcher and the script but joins ...args raw. Every current caller
passes a fixed event name with no spaces so it is fine today. If an arg ever carries a path, it
will not be quoted.

@chaitanyagiri
chaitanyagiri merged commit c212970 into HarnessMD:main Sep 6, 2026
1 check 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.

Gemini and Antigravity hooks exit 127 when hive paths contain spaces on POSIX

2 participants