fix: Guard MemoryClient creation and fix flaky memory test - #53
Open
ryanrishi wants to merge 3 commits into
Open
fix: Guard MemoryClient creation and fix flaky memory test#53ryanrishi wants to merge 3 commits into
ryanrishi wants to merge 3 commits into
Conversation
Only create MemoryClient when memoryStoreId is present in the conversation config. Previously it was always created, which meant the "memory not configured" test path would make real HTTP calls that could hang on CI, causing a 5s timeout flake. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ution Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to prevent the SDK from initializing Memory-related components when the Conversation Configuration response does not include a memoryStoreId, and updates a unit test intended to cover the “memory not configured” behavior (fixing a CI flake).
Changes:
- Conditionally create
MemoryClientonly whenconversationConfig.memoryStoreIdis present. - Only initialize
cintelProcessorwhen bothcintelConfigurationIdis set andmemoryClientexists. - Update the “memory not configured” test path to attempt to simulate a missing memory store ID.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| tests/memory.test.ts | Updates the “memory not configured” test to pass an explicit “no memory store” value to the test helper. |
| tests/helpers/tac.ts | Expands the test helper API to accept an undefined memoryStoreIdFromConfig (intended to simulate a missing store ID). |
| packages/core/src/lib/tac.ts | Adds guards around MemoryClient and OperatorResultProcessor initialization based on presence of memoryStoreId / memoryClient. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Make memoryStoreId optional in ConversationConfigurationSchema (not all configs have memory enabled) - Change test helper param from string|undefined to string|null so passing null bypasses the default (JS default params trigger on undefined) - Use null in "no memory" test to correctly simulate missing memoryStoreId Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
MemoryClientwhenmemoryStoreIdis present in the conversation config responsecintelProcessorcreation ontac.memoryClientbeing non-nullThe test was flaky because
TAC.createalways created aMemoryClientregardless of whether a memory store ID was configured. The test then calledfetchProfileexpecting to hit theif (!this.memoryClient)early return, but since a client existed, it made a real HTTP call that hung on CI.Type of Change
Checklist
SDK Parity