Skip to content

lib/hook-utils.sh: PATH-probed notice may drop the plugin's own bin and hooks entries on Windows #5787

Closed as not planned

Description

@kyle-sexton

Lead from a read-only review on 2026-10-01; not yet reproduced on a Windows host.

lib/hook-utils.sh (vendored into every plugin) builds the "PATH probed" notice by keeping a PATH entry under /plugins/.../bin or /hooks only when it starts with $CLAUDE_PLUGIN_ROOT ("$p" != "$plugin_root"*, around line 228). If CLAUDE_PLUGIN_ROOT arrives with backslashes on Windows while PATH entries use forward slashes (or the reverse), the prefix test never matches, so the plugin's own entries are counted as omitted. This only changes the notice text; it enforces nothing.

Acceptance:

  • Probe on a Windows lane (Git Bash) whether the notice drops the plugin's own entries.
  • If it does, normalize separators before the comparison, with a test, and resync every vendored copy.

Activity

  1. added
    needs-triageNot yet classified. Floor until a type and one priority tier are set.
    on Oct 2, 2026
  2. kyle-sexton commented on Oct 4, 2026

    @kyle-sexton
    MemberAuthor

    This was generated by AI during triage.

    Triage

    Routing: delegable, priority low (it changes only notice text), work class scoped (bug fix).

    Verification: confirmed at function level; the form Claude Code actually supplies for the plugin root on Windows is not verified here (that live check stays with #5692, check 3). Feeding the PATH-trim function a PATH entry /c/Users/u/.claude/plugins/cache/m/p/1.0/bin with three plugin-root forms:

    • /c/Users/u/... keeps the entry;
    • C:\Users\u\... drops it (+1 omitted);
    • C:/Users/u/... drops it too.

    So the fix is drive-form normalization, not only separator normalization. Git Bash PATH entries are in /c/... form (seen in recorded notices on this host).
    Basis: verified, lib/hook-utils.sh:216 and :228 (prefix compare), probe run on origin/main e3bef1210.

    Related, not part of this item: #5924 (a separate backslash bug in the same utility's file-directory resolution) and #5692 (the human-gated live Windows checks).

    Agent Brief

    Type: Bug
    Summary: The PATH-probed notice should keep the plugin's own bin and hooks entries whatever form the plugin root arrives in.

    Current behavior:
    hook::format_path_probed keeps a PATH entry under a plugin bin or hooks directory only when the entry starts with CLAUDE_PLUGIN_ROOT as text. When the root is in Windows form (C:\... or C:/...) and PATH entries are in Git Bash form (/c/...), the prefix never matches and the plugin's own entries are counted as omitted.

    Desired behavior:
    The comparison treats C:\x\y, C:/x/y and /c/x/y as the same path (drive letter case-insensitive, either separator), so the plugin's own entries are kept and other plugins' entries are still omitted. An empty root keeps today's behavior. Behavior on Linux and macOS is unchanged.

    Key interfaces:

    • hook::format_path_probed [raw_path] in the shared hook utility, and every vendored per-plugin copy of that utility (resynced through the repository's existing vendoring mechanism).

    Acceptance criteria:

    • A test in the shared hook utility's suite runs the function with each of the three root forms against a /c/... PATH entry under that root's bin and hooks, and both entries are kept.
    • The same test shows another plugin's bin entry is still omitted, and a POSIX root on a POSIX PATH behaves as before.
    • Every vendored copy matches the shared copy, and the repository's vendoring check passes.
    • Each plugin whose vendored copy changes gets a version bump and CHANGELOG entry, and the changelog parity check passes.

    Out of scope:

  3. added
    priority: lowNice-to-have, cosmetic, or speculative; opportunistic.
    agent-readyFully specified and briefed; eligible for autonomous pickup from the frontier.
    work-class: scopedA briefed fix or small feature; blast radius bounded by the brief, tests exist.
    status: readyTriaged, unblocked, and fully specified; eligible to pick up.
    and removed
    needs-triageNot yet classified. Floor until a type and one priority tier are set.
    on Oct 4, 2026
  4. kyle-sexton commented on Oct 4, 2026

    @kyle-sexton
    MemberAuthor

    This was generated by AI during work-loop.

    Ratify autonomous dispatch of this C3 bug-fix item?

    Classification: work-class: scoped (C3), bug-fix-shaped (confirmed at triage this cycle). Intended dispatch: the work-loop worker lane, through /work-items:work, to a draft PR the lane never merges. First drain is not complete and no item-level ratification exists, so it is queued here. Ratify through /work-items:attend-queue and it dispatches on a later cycle.

    Lane: work-loop, instance melo-worker-1, cycle 1.

  5. added
    needs-humanHuman-in-the-loop required; autonomous sessions must not resolve items carrying this.
    and removed
    agent-readyFully specified and briefed; eligible for autonomous pickup from the frontier.
    on Oct 4, 2026
  6. kyle-sexton commented on Oct 11, 2026

    @kyle-sexton
    MemberAuthor

    Obsolete: merged PR #6267 (2026-10-04) removed hook::format_path_probed, the function this issue fixes. git grep format_path_probed origin/main -- lib plugins scripts returns nothing on current main. Closed by the coordinating agent session under the owner's autonomous-run authorization; reopen if the PATH-probed notice drop reappears in the replacement code.

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

    needs-humanHuman-in-the-loop required; autonomous sessions must not resolve items carrying this.priority: lowNice-to-have, cosmetic, or speculative; opportunistic.status: readyTriaged, unblocked, and fully specified; eligible to pick up.work-class: scopedA briefed fix or small feature; blast radius bounded by the brief, tests exist.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions