anthropics / anthropics/claude-code-action

jq parse error on Unicode escape sequences causes workflow failure

Đang mở
#712 2 bình luận 1 reaction 0 người được giao Xem trên GitHub
bug p2
Ngôn ngữ chính
TypeScript
Star
8.9k
Fork
2.1k
Merge trung bình
3 ngày 9 giờ
Pull request đã merge (30 ngày)
10

Mô tả

## 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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.