Skip to content

fix: recover stale session summaries after late capture and restart - #1551

Merged
rohitg00 merged 3 commits into
fix/compression-recoveryfrom
fix/session-summary-recovery
Oct 16, 2026
Merged

rohitg00 merged 3 commits into
fix/compression-recoveryfrom
fix/session-summary-recovery

Conversation

@rohitg00

@rohitg00 rohitg00 commented Oct 13, 2026 •

Copy link
Copy Markdown
Owner

Completed sessions can retain stale summaries when compression finishes after close or an observation is replayed later. A restart previously lost the remaining background work, leaving the session stale until another explicit request.

Persist summary repair intent before close and recover it at worker startup and on the existing finalization tick. Reuse scoped compression recovery before summarizing, keep failed work with bounded backoff, and make duplicate capture replay a no-op. Preserve disabled idle-finalization behavior.

Replace timestamp-only coverage with an observation-content fingerprint and guard summary publication against concurrent observation changes, session replacement, deletion, and imported summaries. Partial chunk output remains retryable. Recovery does not repeat graph extraction or consolidation. Compression callers independently validate scope and revisions when joining existing work, and a replacement retry processes only its current source.

This is stacked on #1546 and should merge after it. It is separate from the capture privacy and truncation changes requested on #1510.

Validation:

  • Full suite: 282 test files passed, 2 skipped; 3,452 tests passed, 4 skipped.
  • Build, skills generation/check, documentation sync/check and diff check passed.
  • Regression coverage includes late and duplicate replay, older/equal observation timestamps, partial summaries, provider/storage failures, missing source, stalled model calls, concurrent repair tokens, disabled idle finalization, session replacement/deletion, import/restore/eviction interleavings and compression caller scope/revision changes.
  • The unfixed prerequisite archive reproduces the restart failure: the final observation remains pending and the summary omits its processed result.
  • The current fixed npm archive passes all four native gate scenarios: three boots, two hard crashes, automatic compression/summary recovery, late replay after provider failure, and duplicate replay across a 35-second recovery window with no extra model work. Installed package files remain unchanged and all seven test ports close. Archive SHA-256: 95461ea82e7c7b175087a31d7482b0062003a7b081bb71527aa9c236b66fa627.

The packaged recovery gate runs in the existing Linux/macOS release-gate workflow and uploads its receipts. Generated documentation changes update the source-derived function, file, and KV scope counts.

The local packaged check uses Node 24.19.0 on macOS arm64, native iii 0.22.1, a deterministic loopback model and cached dependencies. It does not establish a clean dependency installation or live-model behavior. Process-loss tests allow ordinary state flush before killing the worker and engine. Older summaries without repair records rebuild on their next summarize request; this change does not scan every historical session.

@vercel

vercel Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
agentmemory Ready Ready Preview Oct 16, 2026 8:11am UTC

Request Review

@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 87ac71cc-25c2-4697-9348-d4c06d0496b1

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@rohitg00
rohitg00 merged commit 6fb755a into fix/compression-recovery Oct 16, 2026
13 checks passed
@rohitg00
rohitg00 deleted the fix/session-summary-recovery branch October 16, 2026 08:15
rohitg00 added a commit that referenced this pull request Oct 16, 2026
* fix: recover failed observation compression safely

* fix: preserve legacy raw evidence until compression succeeds

* fix(compression): validate callers joining in-flight recovery

* fix: recover session summaries after late capture and restart (#1551)

* test: allow Hermes contract suite time on busy CI runners

* docs: align localized inventories and numeral agreement

This branch was successfully deployed

1 active deployment
Preview — 5b1dff43 Deployed Oct 16, 2026 by vercel[bot]
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