Skip to content

fix(agents): repair stale codemie paths in installed extension hooks - #619

Closed
Semert wants to merge 4 commits into
codemie-ai:mainfrom
Semert:EPMCDME-15769_claude-hooks-stale-path
Closed

Semert wants to merge 4 commits into
codemie-ai:mainfrom
Semert:EPMCDME-15769_claude-hooks-stale-path

Conversation

@Semert

@Semert Semert commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Jira: https://jiraeu.epam.com/browse/EPMCDME-15769

Hooks written into an installed extension (~/.codemie/claude-plugin/hooks/hooks.json) kept pointing at a removed codemie, because BaseExtensionInstaller.install() returned early on already_exists and never looked at the hooks again. Every Claude Code start then showed a SessionStart hook error and no CodeMie hooks ran.

Changes

  • hook-command.ts: new hasStaleCodemieCommand / repairStaleHooksCommandTree. They match only a leading absolute codemie path (or the Windows quoted node.exe + codemie*.js pair, including paths with spaces) that is missing on disk. Bare codemie, relative paths and other programs are left alone.
  • BaseExtensionInstaller: the already_exists branch now calls repairStaleHooks. It reads hooks.json and does an existsSync per command, and only calls resolveCodemieBinary() when something is stale. It writes only when the tree changed, skips quietly when hooks.json is missing (Kimi), and never rewrites to a bare codemie fallback.
  • resolveHookCommand is unchanged, so migration 006 and codemie-code.plugin.ts behave as before. This applies to every extension that goes through BaseExtensionInstaller.

Impact

Before: install at path A, remove A, install again gives already_exists and hooks still point at A. After: hooks are rewritten to the current codemie; a path that still exists is untouched and hooks.json is not written.

Checklist

  • Self-reviewed
  • Manual testing performed (lint, typecheck, --project unit and --project cli pass; mutation check: removing the repair makes the new tests fail; replayed the reported case with the built CLI's ClaudePluginInstaller on a test HOME: hooks are repaired, a valid path is left untouched)
  • Documentation updated (if needed) (none needed)
  • No breaking changes (or clearly documented)

@codemie-ai

Copy link
Copy Markdown
Owner

[AUTO_CLOSE_WARNING] ⏰ This pull request has had no activity for 7 days (last activity: 2026-10-09).

It will be automatically closed no earlier than 2026-10-23 (UTC) (~6 more days).

Any activity from anyone — a comment, a push, a review, reopening — restarts the countdown from that moment. This warning will be deleted automatically once that happens.

@codemie-ai

Copy link
Copy Markdown
Owner

[AUTO_CLOSE_NOTICE] 🔒 Closed automatically: no activity for 14 days (last activity: 2026-10-09).

Nothing is lost — the branch is untouched. Reopen the PR to continue; housekeeping will give it a fresh 7/14-day cycle starting from the reopen moment.

@codemie-ai codemie-ai closed this Oct 24, 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.

3 participants