fix(agents): codemie-claude hook command-not-found and unsupported effort param (EPMCDME-14035) - #484
fix(agents): codemie-claude hook command-not-found and unsupported effort param (EPMCDME-14035)#484SleepySML wants to merge 12 commits into
Conversation
…te codemie path [EPMCDME-14035]
…aths [EPMCDME-14035]
…k [EPMCDME-14035]
…ble [EPMCDME-14035]
… recursive walk [EPMCDME-14035]
…PTY cleanup [EPMCDME-14035]
Automated review — critical findingFocused on architecture, patterns, correctness, DRY, YAGNI. Minor issues intentionally omitted. 1. Migration hardcodes
|
… ~/.codemie [EPMCDME-14035]
|
Done — addressed in |
Summary
Fixes two independent
codemie-claudefailures reported in EPMCDME-14035:/usr/bin/bash: line 1: codemie: command not found.claude-4-5-sonnetfailing withAPI Error: 400 "This model does not support the effort parameter".Both were reproduced before fixing.
Root causes
codemiecommand. Claude Code runs hooks in a freshbash -c "codemie hook"shell; when that shell's PATH doesn't include the codemie bin dir (a user-prefix install without admin rights), every hook fails with command-not-found.claude-request-normalizeronly ever addedoutput_config.effortfor adaptive-thinking models and never stripped it for models that don't support it. Newer Claude Code emitseffortfrom its--effortflag, so aclaude-4-5-sonnetrequest carriedeffortthrough untouched → upstream 400.Changes
Bug 1 — absolute, PATH-independent hook commands
src/utils/hook-command.ts(new) — shared resolver:resolveCodemieBinary()(getCommandPath('codemie')→process.argv[1]fallback; quotes paths with spaces; prefixesnodefor a Windows.jsfallback),resolveHookCommand()(rewrites the leadingcodemietoken),rewriteHooksCommandTree()(walks a hooks config). Resolution never throws.src/agents/core/extension/BaseExtensionInstaller.ts— post-copylocalizeInstalledHooks()rewrites the installedhooks.jsonto an absolute path (covers Claude and Gemini via the shared base class). Non-fatal.src/agents/plugins/codemie-code.plugin.ts— inlineOPENCODE_HOOKSdefault hooks (buildDefaultHooks) use the resolved absolute path.src/migrations/006-resolve-hook-command-paths.migration.ts(new) — one-time repair of already-installed Claude/Gemini hooks for users whose plugin version didn't bump. Idempotent; returns failure on a write error so the runner retries.Bug 2 — strip unsupported
effortsrc/providers/plugins/sso/proxy/plugins/claude-request-normalizer.plugin.ts— newhandleUnsupportedEffort()stripsoutput_config.effortand any top-leveleffortfor models not matching the adaptive-thinking patterns; runs regardless of whetherthinkingis present. Adaptive models (opus-4-7+, sonnet-5) keepeffort.Testing
lint,typecheck,build,commitlint, and the gitleaks secrets scan all green.license-checkand the integration/agent suites were skipped locally for environmental reasons (npm-cache perms / live-SSO / env-heavy) — all enforced by CI.Code review
A three-lens review (blind / edge-case / acceptance) ran on the diff and this PR fixes what it found:
.jsargv[1]fallback wasn't directly invocable as a hook command → nownode-prefixed.Acceptance criteria
codemieavailable to hook execution aftercodemie-claudesetupSessionStarthooks no longer fail with command-not-foundUserPromptSubmithooks no longer fail with command-not-foundclaude-4-5-sonnetrequests no longer include unsupportedeffortNotes