openclaw - ✅(Solved) Fix [Bug]: Compaction summarization repeatedly fails with 'fetch failed', causing stuck sessions [1 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#61465Fetched 2026-04-08 02:58:21
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Author
Timeline (top)
unsubscribed ×2closed ×1commented ×1cross-referenced ×1

Error Message

  1. Logs show this error repeating in a loop (10+ times per minute)

Fix Action

Fix / Workaround

  • Issue first appeared after upgrading from 2026.3.28 to 2026.4.2
  • May be related to 2026.4.x changes; please confirm if compaction/summarization logic changed in 2026.4.1 or 2026.4.2
  • A /clear command successfully broke the loop
  • Compaction thresholds were adjusted as a workaround

PR fix notes

PR #61603: Agents: skip redundant partial compaction summarization

Description (problem / solution / changelog)

Summary

  • Problem: When full summarization failed and no messages were marked oversized, summarizeWithFallback still ran a "partial" pass over the same transcript, duplicating failing API work (including retries) and the second warning log.
  • Why it matters: Under transport failures (for example fetch failed), this doubled load and log noise and worsened responsiveness during compaction.
  • What changed: Only run the partial summarization path when smallMessages is a strict subset of the original messages (i.e. at least one oversized message was excluded).
  • What did NOT change: When oversized messages exist, partial summarization still runs on the smaller set; staged summarization and other compaction behavior are unchanged.

Change Type (select all)

  • Bug fix

Scope (select all touched areas)

  • Gateway / orchestration

Linked Issue/PR

  • Closes #61465
  • This PR fixes a bug or regression

Root Cause (if applicable)

  • Root cause: Fallback logic treated "partial" as always distinct from "full", but when nothing was oversized the two inputs were identical.
  • Missing detection / guardrail: No check that partial would use a different message set than the failed full attempt.
  • Contributing context (if known): N/A

Regression Test Plan (if applicable)

  • Coverage level: Unit test
  • Target test or file: src/agents/compaction.summarize-fallback.test.ts
  • Scenario the test should lock in: When all messages are non-oversized and summarization fails, generateSummary is invoked only for the full path retries (3), not again for a duplicate partial pass. When one message is oversized, full and partial paths each run (6 total mock calls).
  • Why this is the smallest reliable guardrail: Asserts call counts without coupling to provider error strings.

User-visible / Behavior Changes

  • Fewer redundant summarization attempts and one fewer warning line when full summarization fails and there are no oversized messages to drop. Final text fallback behavior is unchanged.

Diagram (if applicable)

N/A

Security Impact (required)

  • New permissions/capabilities? No

Testing

  • pnpm test on src/agents/compaction.test.ts, compaction.retry.test.ts, compaction.tool-result-details.test.ts, compaction.summarize-fallback.test.ts
  • oxlint on touched TypeScript files

Changed files

  • CHANGELOG.md (modified, +1/-0)
  • src/agents/compaction.summarize-fallback.test.ts (added, +103/-0)
  • src/agents/compaction.ts (modified, +4/-2)

Code Example

{"subsystem":"compaction"} Full summarization failed, trying partial: Summarization failed: fetch failed
{"subsystem":"compaction"} Partial summarization also failed: Summarization failed: fetch failed
{"subsystem":"agent/embedded"} [timeout-compaction] LLM timed out with high prompt token usage (126%); attempting compaction before retry (attempt 1/2)
RAW_BUFFERClick to expand / collapse

Bug Description

Session compaction enters a failure loop that causes severe responsiveness issues and eventually renders the session unusable.

Symptoms

  1. Compaction repeatedly fails with: Full summarization failed, trying partial: Summarization failed: fetch failed
  2. Logs show this error repeating in a loop (10+ times per minute)
  3. Session becomes unresponsive or extremely slow
  4. Only remedy is /clear to break the loop

Environment

  • OpenClaw: 2026.4.2 (d74a122) ← upgraded from 2026.3.28 prior to bug appearing
  • macOS: 26.4 (arm64)
  • Node: v22.22.1
  • Runtime: agent=main (tUI/main session)

Relevant Log Entries

{"subsystem":"compaction"} Full summarization failed, trying partial: Summarization failed: fetch failed
{"subsystem":"compaction"} Partial summarization also failed: Summarization failed: fetch failed
{"subsystem":"agent/embedded"} [timeout-compaction] LLM timed out with high prompt token usage (126%); attempting compaction before retry (attempt 1/2)

Additional Context

  • Issue first appeared after upgrading from 2026.3.28 to 2026.4.2
  • May be related to 2026.4.x changes; please confirm if compaction/summarization logic changed in 2026.4.1 or 2026.4.2
  • A /clear command successfully broke the loop
  • Compaction thresholds were adjusted as a workaround

Tags

bug, compaction, regression

extent analysis

TL;DR

  • Adjusting compaction thresholds or using the /clear command may temporarily mitigate the session compaction failure loop.

Guidance

  • Review the changes in compaction and summarization logic between OpenClaw versions 2026.3.28 and 2026.4.2 to understand potential causes.
  • Verify if the issue persists after adjusting compaction thresholds, as this has been noted as a temporary workaround.
  • Investigate the fetch failed error in the context of session compaction to identify any network or resource issues that might be contributing to the failure loop.
  • Consider testing with a previous version of OpenClaw (e.g., 2026.3.28) to confirm if the issue is indeed a regression introduced in version 2026.4.2.

Example

No specific code example is provided due to the lack of direct code references in the issue.

Notes

  • The exact cause of the fetch failed error during session compaction is not specified, which might require additional logging or debugging to resolve.
  • The issue's appearance after upgrading OpenClaw suggests a potential regression, but confirmation of changes in compaction logic between versions is necessary.

Recommendation

  • Apply workaround: Adjust compaction thresholds as a temporary measure to mitigate the issue, given that this has shown some success in breaking the failure loop.

FAIL-SAFE: Given the information provided, focusing on adjusting compaction thresholds and investigating the fetch failed error seems to be the safest approach without guessing or inferring missing technical details.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - ✅(Solved) Fix [Bug]: Compaction summarization repeatedly fails with 'fetch failed', causing stuck sessions [1 pull requests, 1 comments, 2 participants]