fix(core): retry transient provider compaction failures - #47806
Merged
Conversation
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.
Summary
llm.compactattempt, so a transient 429/5xx/transport failure on the trigger call failed the compaction and, for automatic compaction, the step. Local compaction already retried these throughSessionRunnerRetry.policyand thesession.retryplugin hook (fix(core): retry transient compaction failures #47159, feat(plugin): add session retry hook #45999).SessionRunnerRetry.transient(policy, { agent, model, hook })and use it for both local summary attempts and the provider trigger/endpoint calls. Retrying is safe: nothing is installed until the provider returns a checkpoint, and context overflow is excluded so the existing local-recovery path still handles it.retry-after,x-should-retry, and pluginretryhook as every other session request. Docs updated.Follow-up to #47322–#47324.
Validation
session-native-compaction.test.ts: a 429 answered once retries under aretryhook (delay: 0,attempt: 2,agent: "compaction") and installs the checkpoint on the second call; persistent failures opt out viax-should-retry: falseand still surfaceprovider.rate-limitafter one call; cancellation/overflow behavior unchanged.bun run test: 5,243 passed, 35 skipped; core typecheck clean.