Skip to content

fix: route /compact through retry wrapper - #18007

Merged
steipete merged 1 commit into
openclaw:mainfrom
amabito:fix/compact-retry-clean
Feb 16, 2026
Merged

steipete merged 1 commit into
openclaw:mainfrom
amabito:fix/compact-retry-clean

Conversation

@amabito

@amabito amabito commented Feb 16, 2026 •

Copy link
Copy Markdown

/compact currently bypasses the standard retry wrapper used by other user-facing LLM operations.
This wires /compact through the existing retryAsync path (no fallback changes), so transient failures
are handled consistently and we avoid a single-point "zero fault tolerance" path.

Scope

  • Minimal wiring only (no behavior changes outside retry handling)
  • No new dependencies
  • shouldRetry callback skips AbortError (user cancellation) — no retry on intentional abort
  • Tests included for retry wrapper integration and non-retryable errors

Test plan

  • npx vitest run src/agents/compaction.retry.test.ts — 5/5 passed
  • npx vitest run src/agents/ — 254/254 passed (no regression)
  • npx oxfmt --check — clean

Related: #14543

Greptile Summary

Wraps /compact command's generateSummary calls through the existing retryAsync wrapper to handle transient failures consistently with other LLM operations. The change adds retry logic with exponential backoff (3 attempts, 500-5000ms delays) and properly skips retries on AbortError to respect user cancellations.

Confidence Score: 5/5

  • Safe to merge - minimal, well-tested change that improves resilience
  • The change is minimal and focused, wrapping a single call path with existing retry infrastructure. Tests comprehensively cover success, retry, abort handling, and backoff behavior. The retry config matches patterns used elsewhere in the codebase (telegram, discord). The shouldRetry callback correctly filters AbortError to prevent retrying user cancellations, consistent with how other parts of the codebase handle aborts.
  • No files require special attention

Last reviewed commit: 3fd58cb

(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!

Integrate retry logic with abort-classifier for /compact endpoint:
- Wrap generateSummary calls in retryAsync with exponential backoff
- Auto-skip retry on user cancellation and gateway restart (AbortError)
- Config: 3 attempts, 500ms-5s delay, 20% jitter
- Add comprehensive Vitest tests (5/5 passed)

Related: openclaw#16809, openclaw#5744, openclaw#17143
@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: M labels Feb 16, 2026
@amabito

amabito commented Feb 16, 2026

Copy link
Copy Markdown
Author

CI is now fully green (including node + Windows test suites).

This PR is intentionally small and fully independent of #17940.
It only routes /compact through existing retry wrapper semantics (no fallback changes, no new deps),
using a local shouldRetry callback to avoid coupling to the AbortError classifier PR.

Related: #14543

@steipete
steipete merged commit 068b9c9 into openclaw:main Feb 16, 2026
26 checks passed
@amabito
amabito deleted the fix/compact-retry-clean branch February 17, 2026 01:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants