Skip to content

rtk init --codex --uninstall says "not installed (nothing to remove)" and then "the hook may still be registered" #4589

Open

Description

@KuSh

When the containment guard refuses .codex/hooks.json and nothing else was removed, the report opens with a line that says there is nothing to do and then says the opposite:

W=$(mktemp -d); mkdir -p "$W/proj" "$W/out"; cd "$W/proj"; git init -q .
ln -s "$W/out" .codex; printf '{"hooks":{}}\n' > "$W/out/hooks.json"
rtk init --codex --uninstall; echo "exit=$?"

RTK was not installed for Codex CLI (nothing to remove)
  Not checked: the Codex hook in .codex/hooks.json, which may still be registered:
    .codex/hooks.json resolves to <W>/out/hooks.json, outside the project at <W>/proj.
    Remove the symlink, or use --global to configure Codex outside the project.
exit=0

A reader who stops at the first line concludes there is nothing to do. When the hook was not checked, the first line should not claim RTK was not installed. codex_uninstall_report in src/hooks/init/codex.rs. Related: #4164 (exit code for the same state).

Activity

  1. added
    bug
    good first issue
    on Oct 15, 2026
  2. rtk-wshm-sync-bot commented on Oct 15, 2026

    @rtk-wshm-sync-bot

    wshm · Automated triage by AI

    🔍 Automated Triage

    🐛 Category bug
    🟡 Priority medium
    🎯 Confidence 90%

    Summary

    codex_uninstall_report's opening line says 'nothing to remove' while the body contradicts it, saying the hook may still be registered; fix message ordering/wording in src/hooks/init/codex.rs

    This looks like a simple fix that could be auto-resolved. Repo maintainers can use /wshm fix to attempt it.

    📁 Relevant files
    • src/hooks/init/codex.rs

    Suggested Actions

    1. Fix codex_uninstall_report in src/hooks/init/codex.rs to avoid claiming 'not installed' when the hook was never check…
    2. Cross-reference rtk init --codex --uninstall exits 0 when the hook path was refused and the hook may still be registered #4164, which also covers the exit code for this same containment-guard-refused state
    3. Reword the opening line to reflect 'uninstall skipped due to symlink' rather than 'not installed'

    Triaged automatically by wshm · This is an automated analysis, not a human review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:clibuggood first issuepriority:medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions