Skip to content

fix(plugin-dev): prevent validate-agent.sh exiting on first warning - #84427

Open
erichanwang wants to merge 1 commit into
anthropics:mainfrom
erichanwang:fix/validate-agent-errexit
Open

fix(plugin-dev): prevent validate-agent.sh exiting on first warning#84427
erichanwang wants to merge 1 commit into
anthropics:mainfrom
erichanwang:fix/validate-agent-errexit

Conversation

@erichanwang

Copy link
Copy Markdown

Summary

Follow-up to #76985.

Prevent validate-agent.sh from terminating after the first warning or error when running under set -e.

Problem

The validator increments counters using:

((error_count++))
((warning_count++))

In Bash these expressions return a non-zero exit status when the previous value is zero, which can trigger errexit and stop validation before the remaining checks and summary are reached.

PR #76985 intentionally left this issue out of scope.

Changes

Replace postfix increments with:

((error_count += 1))
((warning_count += 1))

This preserves the counter values while allowing validation to continue through all validation checks.

Verification

  • Reproduced the premature exit before the fix.
  • Verified the validator now reaches the final summary.
  • bash -n plugins/plugin-dev/skills/agent-development/scripts/validate-agent.sh
  • git diff --check

Scope

This PR only changes counter increments to avoid unintended errexit behavior. No validation rules or output were modified.

🤖 Generated with Claude Code

https://claude.ai/code/session_016A6KkbNjaUq7QKa99jAcfW

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.

1 participant