anthropics / anthropics/claude-code-action

jq parse error on Unicode escape sequences causes workflow failure

Abierto
#712 2 comentarios 1 reacción 0 asignados Ver en GitHub
bug p2
Lenguaje dominante
TypeScript
Estrellas
8.9k
Forks
2.1k
Merge medio
3 d 9 h
PR fusionados (30 d)
10

Descripción

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

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.