anthropics / anthropics/claude-code-action

GITHUB_STEP_SUMMARY exceeds 1024k limit on long sessions

Ouverte
#927 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
bug p2
Langage dominant
TypeScript
Étoiles
8.9k
Forks
2.1k
Merge moyen
3 j 9 h
PR mergées (30 j)
10

Description

## Bug Description

When Claude runs a long session (1h+ with many tool calls), the step summary output exceeds GitHub's 1024k hard limit, causing the error:

```
$GITHUB_STEP_SUMMARY upload aborted, supports content up to a size of 1024k, got 1026k.
```

## Root Cause

In `src/entrypoints/run.ts`, `writeStepSummary()` formats the entire execution output into markdown via `formatTurnsFromData()` and appends it to `$GITHUB_STEP_SUMMARY` with no total size check.

While `formatResultContent()` in `format-turns.ts` truncates individual tool results to 3000 chars, the total accumulated markdown from many turns can easily exceed 1MB.

## Steps to Reproduce

1. Tag `@claude` on a complex issue that requires many tool calls (planning a multi-step feature, etc.)
2. Let the session run for 30+ minutes
3. The step summary upload fails with the 1024k error

## Expected Behavior

The step summary should be truncated to stay under GitHub's 1024k limit. Possible approaches:
- Truncate the formatted markdown to ~900k with a "... truncated ..." message
- Collapse older turns and only show recent activity in detail
- Add an input option to control max summary size (related: #206)

## Actual Behavior

The action errors with the `$GITHUB_STEP_SUMMARY upload aborted` message. The error is non-fatal (the Claude work itself still succeeds), but it's noisy and prevents viewing the execution summary.

## Environment

- `anthropics/claude-code-action@v1`
- Session duration: ~1h with many tool calls
- Generated summary size: 1026k (just over the 1024k limit)

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.