Skip to content

feat(hooks): add Qoder, CodeBuddy, Qwen Code, Droid and Antigravity hook integrations - #518

Open
WilliamWang1721 wants to merge 3 commits into
Kuddev:mainfrom
WilliamWang1721:feat/hooks-claude-compatible-20261007
Open

WilliamWang1721 wants to merge 3 commits into
Kuddev:mainfrom
WilliamWang1721:feat/hooks-claude-compatible-20261007

Conversation

@WilliamWang1721

@WilliamWang1721 WilliamWang1721 commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Result / 用户结果

Qoder, CodeBuddy, Qwen Code, Droid and Antigravity CLI can be enabled in Settings → Agents like the other optional hook integrations. When enabled, their turn start and turn end drive the pane state and notifications (Qoder, CodeBuddy, Qwen Code and Droid also report permission waits; Antigravity documents no such event). The settings page shows icons for Qoder, Qwen Code, CodeBuddy and Antigravity; Droid keeps its glyph. Off by default.

Design / 设计边界

  • Responsibility and affected modules: Qoder, CodeBuddy, Qwen Code and Droid document Claude Code's hook contract (JSON on stdin, Stop, Notification with notification_type, UserPromptSubmit, session events, user-level settings.json). Each signs its own source and shares Claude's parsing branch in ai_hook/protocol.rs; session ids still come only from session_id, and camelCase payloads are rejected as another runner's. Installation (local/claude_style.rs) follows cursor.rs: one pure edit installs, removes and inspects, and claims only a complete helper invocation. The command builder and ownership check live in extended.rs and are reused by Grok and Cursor.
  • Antigravity (local/antigravity.rs) writes one pebrel group into ~/.gemini/config/hooks.json with SessionStart, PreInvocation and Stop. Its payload has no event name, so each command passes --event, the contract Grok, Copilot and Cursor already use. A stop is classified only from error and the observed terminationReason values; anything else returns the pane to idle rather than announcing completion. The helper prints {} for this source because Antigravity reads hook stdout as a decision. A same-named group that is not entirely ours is never rewritten.
  • PreToolUse is not subscribed anywhere; Droid gets only the events its reference documents; Antigravity's tool events are not subscribed because 1.2.7 was observed ignoring them.
  • Rejected: the args exec form on Windows (only Claude documents it), adding *_PROJECT_DIR to the foreign-runner gate (could silently drop real Claude notifications), reading fullyIdle as background work. Rationale in architecture/notes/nebula_app/ai_hook/2026-10-07-claude-style-agents.md and 2026-10-07-antigravity-hooks.md.
  • Dependency, data-format, threading changes: none. New settings keys ai_hooks_{qoder,codebuddy,qwen,droid,antigravity}, default off. Local installation only (as with Kimi, Grok, Cursor); no resume or fork commands.

Evidence / 验证依据

  • Fork CI (not upstream CI), Full native tests at head 431b04fe (the four Claude-style agents): lint and all five native jobs passed (https://github.com/WilliamWang1721/pebrel/actions/runs/37603589151). The Antigravity commits are newer; at the time of writing a run for the latest head is pending. Upstream checks on this PR show the current state.
  • Regression tests: installation, repair of a stale helper, idempotence, removal and preservation of foreign hooks and settings; malformed and busy files left untouched; another agent's entry never claimed; Droid's event subset; the named Antigravity group, a same-named foreign group, the argv event contract, conversation id and stop classification; parsed lifecycle, attention filtering and foreign-payload rejection for each source; nebula-hook accepts the new sources and drains stdin.
  • Not verified: none of the five CLIs was run against the installed configuration. Whether omitting matcher fires Droid's tool events, how each Windows shell runs the encoded command, and whether Antigravity accepts {} on every event rest on documentation and third-party captures (cited in the notes; the Antigravity reference does not enumerate terminationReason). CodeBuddy asks the user to review externally edited hooks in /hooks; Qwen's disableAllHooks and Antigravity's group enabled flag make installed hooks inert; the page reports file state only.
  • UI: icons are alpha-mask SVGs like Cursor and Copilot; no screenshots, DPI or keyboard re-check beyond the existing row.
  • No local builds or tests were run.

Required Review / 必须确认

  • I followed CONTRIBUTING.md, docs/architecture.md, and docs/project-constraints.md.
  • I split responsibilities, not arbitrary line ranges; the shared command and ownership logic was extracted rather than copied.
  • Architecture contracts passes; budgets were not changed.
  • Tests cover success and failure; the native matrix for the latest head is pending and live CLI behavior is unverified (stated above).
  • No new messages; no i18n change.
  • No governance change.

AI assistance: implemented with Claude Sonnet 5.5 (claude-sonnet-5-5); reasoning effort not confirmed.

These agents document Claude Code's hook contract, so each signs its own source and shares Claude's parsing branch. Installation edits their user settings.json through one pure edit that installs, removes and inspects, claiming only a complete helper invocation, and reuses the command builder and ownership check shared with Grok and Cursor.

PreToolUse is not subscribed, Droid gets only the events it documents, and the settings page gains icons for Qoder, Qwen Code and CodeBuddy.
Install one named group into ~/.gemini/config/hooks.json with SessionStart, PreInvocation and Stop. The payload carries no event name, so each command passes it as --event like Grok, Copilot and Cursor. A stop is classified only from its error and the observed termination reasons; the helper answers with an empty JSON object because Antigravity reads hook stdout as a decision.
@WilliamWang1721 WilliamWang1721 changed the title feat(hooks): add Qoder, CodeBuddy, Qwen Code and Droid hook integrations feat(hooks): add Qoder, CodeBuddy, Qwen Code, Droid and Antigravity hook integrations Oct 7, 2026
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