Skip to content

feat(hooks): edit and remove unmanaged Antigravity and Copilot hooks in place - #948

Merged
runkids merged 1 commit into
mainfrom
runkids/hooks-native-edit-copilot-antigravity
Nov 17, 2026
Merged

runkids merged 1 commit into
mainfrom
runkids/hooks-native-edit-copilot-antigravity

Conversation

@runkids

@runkids runkids commented Nov 17, 2026

Copy link
Copy Markdown
Owner

Type

  • Bug fix
  • Small improvement (docs, typo, minor refactor)
  • Feature proposal (proposals/ only — see CONTRIBUTING.md)
  • Approved feature or large change (the linked issue has the approved label)

Linked Issue

None. Requested by the maintainer.

What changed

The Hooks in targets dialog could edit or remove a hook without importing it only for Agents that keep hooks as events of one settings file (Claude, Codex, Gemini, Cursor, Qwen, Droid). Antigravity and Copilot rows had no Edit or Remove. Both now do.

  • Import candidates carry source: the Antigravity block name or the Copilot file name they were read from. NativeEdit takes the same source.
  • Antigravity: the edit replaces or removes the whole named block. A disabled block (enabled: false) stays disabled. A block whose name is not a valid hook name is found by its own name.
  • Copilot: the edit rewrites only the file's hooks key, keeping version and the rest of the file; removing the hook deletes its file. A file Skillshare owns, a source outside the hooks folder, a file without a hooks key, and a file whose hooks are empty are refused or not offered.
  • Both keep what the other Agents have: preview diff, stale-file check at apply, backup and restore, and the hook stays unmanaged. Code hooks (Pi, Oh My Pi, Amp, OpenCode) still need importing.
  • Dialog rows are keyed by source, so two Copilot files that read as the same hook name (lint.json, skillshare-lint.json) cannot be removed together. Copilot rows are titled by file name, the editor footer names the file, and removal says the file is deleted (hooks.importWillDeleteFile, hooks.importSum.deleteFileHint, all 11 locales).
  • reference/commands/hooks.md and its ja, ko, zh-Hans, zh-Hant translations describe which hooks can be edited in place.

Checks

  • make check in a task container: passed.
  • Go: internal/hooks tests for edit, remove, restore after each, stale file, project scope, invalid block name, path outside the hooks folder.
  • UI: full Vitest run (975 tests), tsc --noEmit, eslint on src/components/hooks.
  • python3 scripts/ai-context.py check: ok.
  • End to end with the built binary and the Vite dashboard (zh-TW, Playful light): removed one Copilot file, edited another, edited the first command of a two-event Antigravity block, reviewed the diff and applied; the files on disk matched.

Not run: pnpm run build, website build (Markdown paragraphs only), screenshots in Clean and dark.

Not covered

  • Errors from the in-place edit (for example a file changed since it was read) are shown in English, as they already were for the other Agents.
  • A Copilot file that does not parse still says it can be changed after importing, although it cannot be imported either. This predates the change.
  • The edited block or hook is laid out in the file's indent style, so a one-line element becomes multi-line; the rest of the file keeps its bytes.

Checklist

  • I've read CONTRIBUTING.md, including its AI-assisted contributions section
  • I've reviewed every line of the diff and can explain it
  • Tests included and passing (make check) — for code changes
  • No unrelated changes in the diff
  • Scope is focused — one concern per PR

…in place

The "Hooks in targets" dialog could change or remove a hook without
importing it only when the Agent keeps hooks as events of one settings
file. Antigravity blocks and Copilot hook files had to be imported first,
even though both are plain configuration the dialog can address exactly.

Candidates now carry the block or file they were read from (source), and
NativeEdit uses it: an Antigravity edit replaces or removes the whole named
block, keeping enabled: false; a Copilot edit rewrites only the file's
hooks key or deletes the file. Both keep the preview diff, the stale-file
check, the backup, and the hook stays unmanaged. Code hooks (Pi, Oh My Pi,
Amp, OpenCode) still need importing.

Dialog rows are keyed by source, so two Copilot files that read as the same
hook name (lint.json, skillshare-lint.json) can no longer be removed
together. Copilot rows show the file name, the editor names the file, and
removal says the file is deleted.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-17T17:58:20.446898Z 5c42c07 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@runkids
runkids merged commit 6869c39 into main Nov 17, 2026
8 of 9 checks passed
@runkids
runkids deleted the runkids/hooks-native-edit-copilot-antigravity branch November 17, 2026 18:10
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