[GH-ISSUE #583] install-hooks overwrites Codex config.toml notify array, discarding user-defined entries #184

Closed
opened 2026-03-02 04:12:41 +03:00 by kerem · 1 comment
Owner

Originally created by @yoshi47 on GitHub (Feb 25, 2026).
Original GitHub issue: https://github.com/git-ai-project/git-ai/issues/583

When git-ai install-hooks runs (including during auto-upgrade), it completely
replaces the notify array in ~/.codex/config.toml with only its own entries,
silently discarding any user-defined commands.

Steps to Reproduce

  1. Set up ~/.codex/config.toml with git-ai's hook entries plus an additional command:
notify = [
    "/root/.git-ai/bin/git-ai",
    "checkpoint",
    "codex",
    "--hook-input",
    "afplay ~/Documents/celebration.wav",
]
  1. Run git-ai install-hooks

Actual Behavior

The user-defined entry is silently removed:

notify = [
    "/root/.git-ai/bin/git-ai",
    "checkpoint",
    "codex",
    "--hook-input",
]

Output shows:

✓ Codex: Hooks updated

git-ai detected a difference and overwrote the entire array, even though its own hook was already present.

Expected Behavior

install-hooks should merge its hook into the existing notify array,
preserving any other user-defined entries alongside it:

notify = [
    "/root/.git-ai/bin/git-ai",
    "checkpoint",
    "codex",
    "--hook-input",
    "afplay ~/Documents/celebration.wav",  # preserved
]

Impact

Users lose custom notifications without warning on every install-hooks run.

Environment

  • git-ai version: 1.1.5
  • OS: macOS (darwin arm64)
Originally created by @yoshi47 on GitHub (Feb 25, 2026). Original GitHub issue: https://github.com/git-ai-project/git-ai/issues/583 When `git-ai install-hooks` runs (including during auto-upgrade), it completely replaces the `notify` array in `~/.codex/config.toml` with only its own entries, silently discarding any user-defined commands. ## Steps to Reproduce 1. Set up `~/.codex/config.toml` with git-ai's hook entries **plus** an additional command: ```toml notify = [ "/root/.git-ai/bin/git-ai", "checkpoint", "codex", "--hook-input", "afplay ~/Documents/celebration.wav", ] ``` 2. Run `git-ai install-hooks` ## Actual Behavior The user-defined entry is silently removed: ```toml notify = [ "/root/.git-ai/bin/git-ai", "checkpoint", "codex", "--hook-input", ] ``` Output shows: ``` ✓ Codex: Hooks updated ``` git-ai detected a difference and overwrote the entire array, even though its own hook was already present. ## Expected Behavior `install-hooks` should merge its hook into the existing notify array, preserving any other user-defined entries alongside it: ```toml notify = [ "/root/.git-ai/bin/git-ai", "checkpoint", "codex", "--hook-input", "afplay ~/Documents/celebration.wav", # preserved ] ``` ## Impact Users lose custom notifications without warning on every `install-hooks` run. ## Environment - git-ai version: 1.1.5 - OS: macOS (darwin arm64)
kerem 2026-03-02 04:12:41 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@svarlamov commented on GitHub (Feb 26, 2026):

I'm extremely sorry that you ran into this issue... We do our best to make sure that git ai doesn't break anything for developers, and we made a mistake this time. I'm working on a PR (#592) that will be part of our next release with a fix and a regression test to make sure that this cannot be reintroduced in the future.

<!-- gh-comment-id:3963906186 --> @svarlamov commented on GitHub (Feb 26, 2026): I'm extremely sorry that you ran into this issue... We do our best to make sure that git ai doesn't break _anything_ for developers, and we made a mistake this time. I'm working on a PR (#592) that will be part of our next release with a fix and a regression test to make sure that this cannot be reintroduced in the future.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/git-ai#184
No description provided.