Repository navigation
fix: route /compact through retry wrapper - #18007
Merged
Merged
Conversation
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
Author
|
CI is now fully green (including node + Windows test suites). This PR is intentionally small and fully independent of #17940. Related: #14543 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
/compactcurrently bypasses the standard retry wrapper used by other user-facing LLM operations.This wires
/compactthrough the existingretryAsyncpath (no fallback changes), so transient failuresare handled consistently and we avoid a single-point "zero fault tolerance" path.
Scope
shouldRetrycallback skipsAbortError(user cancellation) — no retry on intentional abortTest plan
npx vitest run src/agents/compaction.retry.test.ts— 5/5 passednpx vitest run src/agents/— 254/254 passed (no regression)npx oxfmt --check— cleanRelated: #14543
Greptile Summary
Wraps
/compactcommand'sgenerateSummarycalls through the existingretryAsyncwrapper 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 onAbortErrorto respect user cancellations.Confidence Score: 5/5
shouldRetrycallback correctly filtersAbortErrorto prevent retrying user cancellations, consistent with how other parts of the codebase handle aborts.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!