Skip to content

fix(windows): Antigravity hook sessions now display correctly#21

Open
23092003e wants to merge 1 commit into
ntd4996:mainfrom
23092003e:fix/antigravity-windows-hook
Open

fix(windows): Antigravity hook sessions now display correctly#21
23092003e wants to merge 1 commit into
ntd4996:mainfrom
23092003e:fix/antigravity-windows-hook

Conversation

@23092003e

Copy link
Copy Markdown

Problem

Antigravity sessions never appeared on Windows despite the feature being
installed and advertised in the hook catalog.

Root cause: cli.rs::run_hook extracted event name from fields
hook_event_name/eventName — none exist in Antigravity payloads.
Antigravity sends no event-name field; state must be inferred from
discriminator fields. Result: event always "", statemap dropped every
event silently.

Secondary issue: project extraction missed workspacePaths (Antigravity's
camelCase array field).

Fix

  • agent == "antigravity" branch before generic extraction, mirrors macOS
    AntigravityHookPayload.makeEvent:
    • terminationReason or fullyIdle → "done" (checked first)
    • toolCall, invocationNum, or stepIdx → "working"
    • none → None (early-exit)
  • workspacePaths added as third fallback in project extraction

Tests

11 unit tests: all 4 real payload shapes from macOS test suite, priority
edge case (terminationReason + stepIdx → done wins), None for unknown
payloads, all 3 project extraction paths.

Note: CI-verified only (windows-build.yml). Rust toolchain not available locally.

Antigravity sends no event-name field — state must be inferred from
discriminator fields (terminationReason/fullyIdle → done,
toolCall/invocationNum/stepIdx → working), mirroring the macOS
AntigravityHookPayload.makeEvent logic.

Before this fix, cli.rs looked for hook_event_name/eventName (absent in
Antigravity payloads), so event was always empty and statemap dropped
every event silently — the feature was installed but completely broken.

Also adds workspacePaths (Antigravity's camelCase array field) as a
project fallback alongside workspace_roots.

Includes 11 unit tests covering all real payload shapes and edge cases.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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