Repository navigation
feat(antigravity): add cross-platform Windows support for agy CLI plugin - #184
Open
Joy Mondal (Equlient-Joy) wants to merge 6 commits into
Open
Joy Mondal (Equlient-Joy) wants to merge 6 commits into
Joy Mondal (Equlient-Joy) wants to merge 6 commits into
Conversation
Author
|
@microsoft-github-policy-service agree |
Aaron Li (aaron-jx-li)
requested changes
Nov 10, 2026
Aaron Li (aaron-jx-li)
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for the contribution. This PR needs a bit of refinements before it can be merged:
plugin/hooks.jsonis what agy runs on macOS and Linux too, throughsh -c. There,scripts\te-hook.cmdbecomesscriptste-hook.cmd, which is not found, and2>nulwrites a file namednulinto the plugin directory on every hook call. One option to try (we haven't tested it on Windows): put the POSIX launcher first (./scripts/te-hook … || scripts\te-hook.cmd …).te-hookfails open with exit 0, so sh never reaches the Windows half.- In both
.cmdfiles, everyexit /b %ERRORLEVEL%sits inside a( … )block. cmd expands it when it reads the block, before Python runs, so the launcher always exits 0. Please usesetlocal EnableDelayedExpansionwith!ERRORLEVEL!, or move the call out of the block. - Please have the Windows launcher pick the first Python >= 3.10, as #194 does for POSIX.
- Please keep the docs to what was tested: the agy version and Windows version you ran, and no "dual .cmd/.sh launchers" (there is no .sh launcher). The docs also still send Windows users to
~/.tokeneconomizer/bin/te, which is a/bin/shscript. - Please move the Antigravity 2.0 parts (
write_file/edit_file, theproductdetection) to a separate PR, with a redacted real transcript showing those tool names. Nothing in the repo shows them yet, and theproductbranch never runs becausehooks.jsonalways passes--host antigravity. - Please mark the
.cmdfileseol=crlfin.gitattributes.
added 6 commits
November 14, 2026 22:38
… Antigravity 2.0 Add Windows batch hook and CLI launchers (plugin/scripts/te-hook.cmd, te.cmd) to support cmd.exe /c execution. Update plugin/hooks.json to execute cleanly across Windows, macOS, and Linux. Add support for Antigravity 2.0 native tool signatures (write_file, edit_file) and document universal cross-platform support.
Joy Mondal (Equlient-Joy)
force-pushed
the
feat/antigravity-crossplatform-windows
branch
from
November 14, 2026 18:42
1f16760 to
3c1ad11
Compare
Author
|
Thanks for the thorough review and guidance Aaron Li (@aaron-jx-li)! All 6 feedback items have been addressed and the branch has been rebased on the latest \main: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat(antigravity): add cross-platform Windows support for agy CLI plugin
Extends the experimental
antigravityhost adapter (#147) with robust cross-platform Windows support for theagyCLI plugin.Background & Context
In #147, the Antigravity host adapter was introduced with a limitation noting "macOS and Linux only: on Windows agy runs hook commands through cmd /c, and this plugin's launcher is a POSIX shell script."
Following review feedback from Aaron Li (@aaron-jx-li), this PR adds native Windows batch launchers and cross-platform hooks for
agyCLI while keeping changes strictly focused, cleanly separating CLI support from Desktop 2.0 app tool mappings, and avoiding side effects across platforms.Key Changes
Inverted Launcher Execution in
plugin/hooks.json:"./scripts/te-hook --host antigravity --event <event> || scripts\\te-hook.cmd --host antigravity --event <event>"||branch never executes. This eliminates the previous2>nulredirect that inadvertently created a straynulfile on POSIX systems.cmd.exe /cfails to execute the./scripts/te-hookPOSIX path and falls through cleanly toscripts\te-hook.cmd.Native Windows Batch Launchers (
plugin/scripts/te-hook.cmd&te.cmd):te-hookandtePOSIX launchers.setlocal EnableDelayedExpansionand!ERRORLEVEL!handling to ensure accurate exit code propagation without being shadowed by batch expansion quirks.Python >= 3.10 Probing with Graceful Fallback:
TE_PYTHON,py -3,python.exe, andpython3.exefor Python >= 3.10 via an inline sys.version_info probe, filtering out non-functionalWindowsAppsstore alias stubs.te_bootstrap.pycan fail open on hooks or output human-readable requirement errors on CLI commands, aligning with PR Launchers: skip a python3 older than the bootstrap needs #194.Line Endings in
.gitattributes:*.cmd text eol=crlfin.gitattributesto ensure Windows batch files preserve CRLF line endings across git checkouts.Scoped Documentation Strictly to Tested Versions:
README.md,plugin/README.md, anddocs/PLUGIN.mdto verified versions:agy1.5.1 and 1.5.2 on Windows 11, macOS, and Linux.scripts\te.cmd --host antigravity <command>from the plugin directory for Windows terminal users.Deferred Antigravity 2.0 Desktop Tool Mappings:
write_file,edit_file) andproductdetection have been removed from this PR and deferred to a dedicated follow-up PR backed by real transcript fixtures.Verification Results
pytest tests/test_antigravity.py tests/test_plugin_package.py -v: 55 passed, 3 skipped (Windows ACL / symlink privilege skips).test_windows_hook_launcher_fails_open_with_no_python: passes (exits 0 with{}).test_windows_te_launcher_reports_missing_python: passes (exits 1 with clear stderr message).test_windows_hook_launcher_executes_with_valid_python: passes (executes hook payload cleanly and outputs valid response).test_the_plugin_declares_the_three_events_and_never_pretooluse: passes with updated inverted hook syntax..gitattributes,README.md,docs/PLUGIN.md,plugin/README.md,plugin/hooks.json,plugin/scripts/te-hook.cmd,plugin/scripts/te.cmd,tests/test_antigravity.py).