Skip to content

fix(plugin-dev): report missing jq dependency - #83990

Open
RerankerGuo wants to merge 1 commit into
anthropics:mainfrom
RerankerGuo:fix/83802-report-missing-jq
Open

fix(plugin-dev): report missing jq dependency#83990
RerankerGuo wants to merge 1 commit into
anthropics:mainfrom
RerankerGuo:fix/83802-report-missing-jq

Conversation

@RerankerGuo

Copy link
Copy Markdown

Summary

Fixes #83802.

test-hook.sh previously treated every failure from jq empty as invalid JSON. When jq was not installed, the shell error was suppressed and valid input was reported as malformed.

This change checks for jq before its first use and reports the missing dependency with an installation link.

Verification

  • Reproduced the original behavior with a valid JSON fixture and a PATH that does not contain jq: the script reported Test input is not valid JSON.
  • Re-ran the same fixture after the change: the script reports jq is required but not installed and exits with status 1.
  • Verified the normal path with jq available and a successful hook: the script exits with status 0.
  • Ran bash -n plugins/plugin-dev/skills/hook-development/scripts/test-hook.sh.
  • Ran git diff --check.

Scope

This PR only improves dependency diagnosis. It does not change JSON validation or hook result semantics, and it does not address platform availability of the separate timeout command.

Check for jq before validating hook test input so a missing binary is not misreported as invalid JSON.\n\nRefs anthropics#83802
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.

test-hook.sh reports valid JSON as invalid when jq is not installed

1 participant