Skip to content

Warn when a foreign PostToolUse hook silently shadows the Antigravity adapter #9

Description

@SuperLogicAI

The Antigravity (agy) adapter has a silent failure mode documented in CLAUDE.md and in the README's caveats: agy does not merge multiple named hooks on PostToolUse, despite its own docs promising it does. If the user already has their own PostToolUse hook in ~/.gemini/config/hooks.json, Logic Loop's may never fire — and the toggle still reads "on".

The result is the worst kind of bug: adapter installed, UI says it's working, zero rows ever land, nothing on screen says why.

We can't fix agy's dispatch. We can stop the user from debugging it blind.

What to do

When the Antigravity toggle is on, check ~/.gemini/config/hooks.json for a PostToolUse hook that isn't ours (ours is identifiable — see MARKER usage in src-tauri/src/ingest.rs and how antigravity.rs writes its entry). If one exists, surface a warning in the UI.

The side panel already has a warning strip used for tailer failures (search ingest://tailer-failed) — reuse that presentation rather than inventing a second warning style. AgentStatusBar.tsx is where the toggle itself lives.

Constraints

  • Detection only. Never rewrite or remove the user's foreign hook — install/remove must stay idempotent and byte-identically reversible. That property is unit-tested; keep those tests passing.
  • Fail open. If the file is missing, unreadable, or malformed, show nothing and carry on — an ingestion-side check must never affect terminals.
  • Add a unit test in antigravity.rs's existing tests module for the detection function, covering: no file, our hook only, foreign hook present, both present.

Done when: cargo test and cargo clippy --all-targets -- -D warnings pass, npx tsc --noEmit clean, and a hand-added foreign PostToolUse hook produces a visible warning.

Metadata

Metadata

Assignees

No one assigned

    Labels

    adapterAgent adapter (Claude, Codex, OpenCode, Antigravity, new)good first issueGood for newcomers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions