fix(utils): use absolute path for check_replied.py in address-reviews - #315
Conversation
…ss-reviews The script path was relative (`plugins/utils/scripts/check_replied.py`), which only resolves when the working directory contains a plugins/ directory. In practice, the skill runs from whatever project the user is working in, so the script is never found (exit code 2). Use `find ~/.claude/plugins` to dynamically locate the script regardless of whether the plugin is installed via marketplace or as a local plugin. Also explicitly error when the script cannot be found, and instruct the agent to stop and investigate on exit code 2 rather than proceeding without the duplicate check. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
f1ea125 to
d442f3b
Compare
WalkthroughVersion bump for the utils plugin from 0.0.4 to 0.0.5 in manifests and docs, plus replacement of hardcoded Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error)
✅ Passed checks (7 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
|
Updated to use Note: I initially tried using |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@plugins/utils/commands/address-reviews.md`:
- Around line 196-199: The current FIND pipeline that sets CHECK_REPLIED by
scanning the entire home tree for check_replied.py is unsafe and
non-deterministic; change the search to only probe known plugin install roots
(the trusted plugin install directories), use find with constrained depth and
-type f (and -executable if appropriate), pipe through sort for determinism, and
then assign the first match to CHECK_REPLIED; ensure the subsequent python3
"$CHECK_REPLIED" <owner> <repo> <pr_number> <comment_id> --type <type> still
runs the selected file and fail with a clear error if no match is found.
… path Try CLAUDE_PLUGIN_ROOT first (future-proof for when Claude Code fixes the env var in markdown commands), then fall back to searching ~/.claude/plugins with constrained scope. Errors explicitly when the script cannot be found. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
f7f32b8 to
ca7b7ca
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@plugins/utils/commands/address-reviews.md`:
- Around line 196-201: The fallback find logic for locating check_replied.py
(variable CHECK_REPLIED) currently only searches under ~/.claude/plugins; update
the fallback to also search Cursor installs by adding a second find path that
looks for ~/.cursor/commands/*/plugins/utils/scripts/check_replied.py (or
include both find patterns in one command) so that if the first path isn't
present the script can be found under Cursor's install layout; ensure the final
existence check ([ -z "$CHECK_REPLIED" ] || [ ! -f "$CHECK_REPLIED" ]) and the
error/exit behavior remain unchanged and still reference CHECK_REPLIED and the
target filename check_replied.py.
|
@celebdor — addressing your concern about plugins not necessarily living at The latest commit ( The This was tested end-to-end by running One remaining gap: the CI job ( |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bryan-cox, celebdor The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Summary
check_replied.pyscript path in theaddress-reviewsskill was relative (plugins/utils/scripts/check_replied.py), which only resolves when the working directory contains aplugins/directoryChanges
find ~ -name "check_replied.py" -path "*/utils/scripts/*"to dynamically locate the script regardless of install method or location (marketplace, manual clone, symlink, etc.)Test plan
/utils:address-reviewson a PR in a non-ai-helpers repo and verify thecheck_replied.pyscript is found and runs correctlymake lint)🤖 Generated with Claude Code
Summary by CodeRabbit
Chores
Documentation