Skip to content

fix(review): strip ANSI from gh JSON output - #10249

Draft
AaronZ345 wants to merge 2 commits into
QwenLM:mainfrom
AaronZ345:fix/10241-gh-json-ansi
Draft

fix(review): strip ANSI from gh JSON output#10249
AaronZ345 wants to merge 2 commits into
QwenLM:mainfrom
AaronZ345:fix/10241-gh-json-ansi

Conversation

@AaronZ345

Copy link
Copy Markdown
Contributor

Summary

  • Strip ANSI escape sequences from gh api JSON output before parsing.
  • Apply the same decoding path to paginated NDJSON records used by nested API helpers.
  • Add regression coverage for colorized JSON, arrays, and NDJSON records.

Root Cause

When gh emits colorized output, JSON parsing in the review helpers can fail because the raw payload contains ANSI control sequences. This can break review automation even though the underlying GitHub API response is valid JSON.

Fixes #10241.

Test Plan

  • npm run test --workspace packages/cli -- src/commands/review/lib/gh.test.ts --pool threads --maxWorkers 1
  • npx prettier --check packages/cli/src/commands/review/lib/gh.ts packages/cli/src/commands/review/lib/gh.test.ts

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@qwen-code-ci-bot

qwen-code-ci-bot commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

Qwen precheck requires maintainer approval before automated triage/review.

Head SHA: b444cd31e37bc82d45e4f3fc3700b7ca307ce604

Reason:

  • prompt_injection:run_gh

A maintainer with write access can inspect the PR and manually request a run with @qwen-code /triage or @qwen-code /review. A new push requires a fresh precheck.

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.

Deferred review findings from PR #9940

3 participants