fix(memory): defer startup until model profiles settle - #3839
Merged
Yeachan-Heo merged 2 commits intoAug 5, 2026
Conversation
The defers-memory-startup test creates a full agent session, which can exceed bun's default 5s per-test timeout on cold CI runners even though the session creation is not faulty. Raise the explicit timeout to 30s so the test asserts the deferral behavior without flaking on slow CI. Lore-id: 8ca3d1f2 Confidence: high Scope-risk: low Reversibility: revert-commit Tested: bun test packages/coding-agent/test/sdk-memory-startup.test.ts (passes) Not-tested: full CI re-run
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
Closes #3838.
Root cause
createAgentSession()started local-memory consolidation while the session still held its bootstrap catalog fallback. Root CLI profile activation happened only after session creation, so the stage-one extractor could capture retiredclaude-3-5-sonnet-20240620before the effective profile model was installed.Verification
bun test test/sdk-memory-startup.test.ts test/memories-runtime.test.ts test/cli-args-mpreset.test.ts— 59 pass, 0 failbun run check:typesbunx biome check --write src/sdk/session.ts src/main.ts test/sdk-memory-startup.test.tsgit diff --check