anthropics / anthropics/claude-code-action

jq parse error on Unicode escape sequences causes workflow failure

オープン
#712 コメント 2 件 リアクション 1 件 担当者 0 名 GitHub で見る
bug p2
主要言語
TypeScript
スター
8.9k
フォーク
2.1k
平均マージ
3日 9時間
マージ済み PR(30日)
10

説明

## Bug Description

The `claude-code-action` fails during post-processing when the Claude output contains certain Unicode escape sequences that `jq` cannot parse.

## Error Message

```
##[warning]Failed to process output for execution metrics: Error: Command failed: jq -s '.' output.txt
jq: parse error: Invalid \uXXXX\uXXXX surrogate pair escape at line 60, column 9541

cat: /home/runner/work/_temp/claude-execution-output.json: No such file or directory
##[error]Process completed with exit code 1.
```

## Context

- The Claude review itself completed successfully
- The failure occurs in the action's post-processing step when trying to format output
- The `jq` parser fails on invalid Unicode surrogate pair escapes in the JSON output
- This causes the entire workflow to fail even though the actual task completed

## Reproduction

1. Run a code review workflow that produces output with Unicode characters
2. The output JSON contains escape sequences like `\uXXXX\uXXXX` that form invalid surrogate pairs
3. The `jq -s '.' output.txt` command fails
4. The workflow reports failure despite successful task completion

## Workflow Run

https://github.com/petter-b/homelab/actions/runs/19856099603

## Expected Behavior

The action should either:
1. Sanitize Unicode escape sequences before passing to `jq`
2. Handle `jq` parse errors gracefully without failing the workflow
3. Use a more robust JSON parser

## Environment

- Action version: `a7e4c51380c42dd89b127f5e5f9be7b54020bc6b`
- Runner: `ubuntu-latest`
- Model: `opus`

## Workaround

None currently - the workflow fails even when the review task completes successfully.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。