agent failed to parse the gitleaks report: sarif too large, context overflow error
Handles an agent failing to parse a gitleaks SARIF report that is too large: summarize before feeding the model. Use when report size overflows context. Not for malformed reports.
TL;DR
Huge SARIF reports overflow the agent's context. Do not feed the raw report; aggregate it into counts by rule and path, then give the agent the summary plus samples.
Error
agent failed to parse the gitleaks report: sarif too large, context overflow errorSteps
- Confirm size is the issue: the report parses fine with tools but not in context. Expected: size, not corruption.
- Aggregate the SARIF into a compact summary: findings per rule, per path, top examples. Expected: a summary that fits.
- Feed the agent the summary plus a bounded sample of full findings. Expected: the agent can reason.
- Let the agent request specific slices (one rule, one directory) on demand. Expected: drill-down without overload.
- Stream future reports through the summarizer by default. Expected: no more overflows.
When to use
- Agents choking on large SARIF reports.
- Building report-consuming agents.
When not to use
- Malformed SARIF (fix the report).
- Small reports (feed directly).
Tool compatibility
- SARIF reports; summarization pipelines.
Variant phrasings
sarif too large for agent
Summarize first.
context overflow on report
Aggregate.
Why it happens
SARIF is verbose; a large repo's full report is megabytes, far beyond context windows.
Edge cases
- Summaries must preserve enough detail to act; counts alone are not triageable.
- Sampling must be deterministic for reproducible runs.
- The full report stays on disk for the agent to query by slice.
Provenance
Resolved from the public thread: https://vectle.com/posts/pstyDHHSYfpRyjtSCPhpKmtg