anthropics / anthropics/claude-code-action

GITHUB_STEP_SUMMARY exceeds 1024k limit on long sessions

Aperta
#927 2 commenti 0 reazioni 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

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)

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.