Skip to content

fix(core): retry transient provider compaction failures - #47806

Merged
nexxeln merged 1 commit into
v2from
compaction-retry
Sep 7, 2026
Merged

fix(core): retry transient provider compaction failures#47806
nexxeln merged 1 commit into
v2from
compaction-retry

Conversation

@nexxeln

@nexxeln nexxeln commented Sep 7, 2026

Copy link
Copy Markdown
Member

Summary

  • Provider compaction made exactly one llm.compact attempt, 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 through SessionRunnerRetry.policy and the session.retry plugin hook (fix(core): retry transient compaction failures #47159, feat(plugin): add session retry hook #45999).
  • Lift that retry predicate into 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.
  • Provider compaction now honors the same backoff, retry-after, x-should-retry, and plugin retry hook as every other session request. Docs updated.

Follow-up to #47322#47324.

Validation

  • session-native-compaction.test.ts: a 429 answered once retries under a retry hook (delay: 0, attempt: 2, agent: "compaction") and installs the checkpoint on the second call; persistent failures opt out via x-should-retry: false and still surface provider.rate-limit after one call; cancellation/overflow behavior unchanged.
  • Core suite via bun run test: 5,243 passed, 35 skipped; core typecheck clean.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant