Skip to content

fix(ci): strip both agent env vars so pint emits checkstyle - #444

Merged
oxyc merged 1 commit into
masterfrom
fix/pint-agent-env-checkstyle
Aug 1, 2026
Merged

fix(ci): strip both agent env vars so pint emits checkstyle#444
oxyc merged 1 commit into
masterfrom
fix/pint-agent-env-checkstyle

Conversation

@oxyc

@oxyc oxyc commented Aug 1, 2026

Copy link
Copy Markdown
Member

composer ci fails 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/cs2pr pipe gets {"tool":"pint","result":"passed"} and dies with Start tag expected, '<' not found, exiting 2.

Both CLAUDECODE and AI_AGENT trigger it, and stripping only one is not enough. The env -u CLAUDECODE -u CLAUDE_CODE form previously committed across several repos does not work — CLAUDE_CODE is not a real variable (the real ones are CLAUDECODE, AI_AGENT, and CLAUDE_CODE_*), so AI_AGENT survives and still forces JSON. Verified against a repo carrying that fix: composer ci still exits 2.

This is a no-op in CI. Neither variable is set there, and env -u FOO cmd with FOO unset is exactly cmd — verified. Only local agent-driven runs change behaviour. All existing flags and path arguments are preserved verbatim.

🤖 Generated with Claude Code

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>
@oxyc
oxyc merged commit 829c37a into master Aug 1, 2026
1 check passed
@oxyc
oxyc deleted the fix/pint-agent-env-checkstyle branch August 1, 2026 21:33
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