anthropics / anthropics/claude-code-action

jq parse error on Unicode escape sequences causes workflow failure

Aperta
#712 2 commenti 1 reazione 0 assegnatari Vedi su GitHub
bug p2
Lingua principale
TypeScript
Stelle
8.9k
Fork
2.1k
Merge medio
3g 9h
PR unite (30g)
10

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.