Skip to content

fix: Guard MemoryClient creation and fix flaky memory test - #53

Open
ryanrishi wants to merge 3 commits into
mainfrom
fix/flaky-memory-test
Open

fix: Guard MemoryClient creation and fix flaky memory test#53
ryanrishi wants to merge 3 commits into
mainfrom
fix/flaky-memory-test

Conversation

@ryanrishi

Copy link
Copy Markdown
Member

Summary

  • Only create MemoryClient when memoryStoreId is present in the conversation config response
  • Guard cintelProcessor creation on tac.memoryClient being non-null
  • Fix flaky test "should return undefined when memory not configured" that was timing out on CI

The test was flaky because TAC.create always created a MemoryClient regardless of whether a memory store ID was configured. The test then called fetchProfile expecting to hit the if (!this.memoryClient) early return, but since a client existed, it made a real HTTP call that hung on CI.

Type of Change

  • Bug fix

Checklist

  • Tests added/updated
  • Documentation updated
  • Tested E2E

SDK Parity

  • Change is TypeScript-specific (no Python update needed)

ryanrishi and others added 2 commits May 11, 2026 12:14
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>
@ryanrishi
ryanrishi requested a review from xinghaohuang91 as a code owner May 11, 2026 17:55
Copilot AI review requested due to automatic review settings May 11, 2026 17:55
@ryanrishi
ryanrishi requested a review from ryanrouleau as a code owner May 11, 2026 17:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 MemoryClient only when conversationConfig.memoryStoreId is present.
  • Only initialize cintelProcessor when both cintelConfigurationId is set and memoryClient exists.
  • 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.

Comment thread tests/helpers/tac.ts
Comment thread packages/core/src/lib/tac.ts
- 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>
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