Repository navigation
Recover background memory updates after transient timeouts - #1901
Merged
Merged
Conversation
santoshkumarradha
marked this pull request as ready for review
October 22, 2026 22:16
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.
A stalled background memory request could consume all 45 seconds, leaving its fallback no time and dropping the exchange. Reserve half the remaining deadline for the configured small-work model, then retry the original exchange once after two seconds if the pass still fails transiently. The chat stays responsive and successful recovery saves normally without a failure notice.
Cancellation stops recovery; permanent failures do not cause repeated requests. Exhausted recovery retains the technical journal record and explains the direct
/rememberpath. Pending exchanges remain owned by the open chat and are not persisted across restarts. The system prompt now acknowledges automatic capture instead of incorrectly claiming/rememberis required.Proof
The real terminal acceptance test
TestMemoryRecoversFromTimeoutOnTheRealTerminalpassed on7a6ed127d3e5e70a53f73ad524ad323cb8c6fd9cin 106.58 seconds using OpenRouterdeepseek/deepseek-v4.1-flashfor every model role. All data below are fictional:packaging.jsonwith{"weekend_envelope_color":"copper"}.Reproduce after
make buildwith an OpenRouter key configured:Focused regressions also cover the exact 22.5-second primary / 45-second overall deadline split, same-model recovery, cancellation, bounded exhaustion, technical journal retention, direct manual saving after exhaustion, and session-close lifecycle. Reflex tests pass under the race detector.
make pr-readypassed: build, vet, manual gates, structural laws and all affected-package tests (including all eight session shards). All seven GitHub check/status results passed on the tested head: PR gate.