Skip to content

fix: back off failed compaction summary saves - #128

Merged
MaheshtheDev merged 1 commit into
mainfrom
ishaan/summary-retry-backoff
Nov 18, 2026
Merged

MaheshtheDev merged 1 commit into
mainfrom
ishaan/summary-retry-backoff

Conversation

@ishaanxgupta

Copy link
Copy Markdown
Contributor

On OpenCode 2, a compaction summary that failed to save stayed in the in-memory pending list forever and was re-sent on every session event with no backoff, so a single free user who ran out of credits during a long autonomous job turned ~100 stuck summaries into ~1M requests (402s, then 429s) against POST /ns/{tag}/document in a few hours. This change gives each pending summary an attempt count and a next-retry time: events only re-send summaries whose retry time has passed, each failure doubles the delay (about 15s, 30s, 60s, 120s with jitter), and the summary is dropped after 5 failed attempts, so a failing save now costs at most 5 requests instead of one per event.

@MaheshtheDev MaheshtheDev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@MaheshtheDev
MaheshtheDev merged commit 9f0af37 into main Nov 18, 2026
3 checks passed
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.

2 participants