fix(ci): strip both agent env vars so pint emits checkstyle - #444
Merged
Conversation
Pint 1.30 detects a coding-agent environment and emits JSON regardless of --format=checkstyle, so `pint --format=checkstyle | cs2pr` dies with "Start tag expected, '<' not found" and `composer ci` exits 2 on clean code. Both CLAUDECODE and AI_AGENT trigger the detection, and stripping only one is not enough -- which is why the previously committed `env -u CLAUDECODE -u CLAUDE_CODE` form does not work: CLAUDE_CODE is not a real variable, so AI_AGENT survives and still forces JSON. No-op in CI, where neither variable is set: `env -u FOO cmd` with FOO unset is exactly `cmd`. Only local agent-driven runs change behaviour. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
composer cifails on clean code whenever it runs from a coding-agent session.Pint 1.30 detects an agent environment and emits JSON regardless of
--format=checkstyle, so the| vendor/bin/cs2prpipe gets{"tool":"pint","result":"passed"}and dies withStart tag expected, '<' not found, exiting 2.Both
CLAUDECODEandAI_AGENTtrigger it, and stripping only one is not enough. Theenv -u CLAUDECODE -u CLAUDE_CODEform previously committed across several repos does not work —CLAUDE_CODEis not a real variable (the real ones areCLAUDECODE,AI_AGENT, andCLAUDE_CODE_*), soAI_AGENTsurvives and still forces JSON. Verified against a repo carrying that fix:composer cistill exits 2.This is a no-op in CI. Neither variable is set there, and
env -u FOO cmdwithFOOunset is exactlycmd— verified. Only local agent-driven runs change behaviour. All existing flags and path arguments are preserved verbatim.🤖 Generated with Claude Code