Skip to content

Make Foundry MemoryProvider store request/response message filters configurable - #680

Draft
PratikDhanave wants to merge 1 commit into
microsoft:mainfrom
PratikDhanaveFork:foundry-memory-store-filters
Draft

Make Foundry MemoryProvider store request/response message filters configurable#680
PratikDhanave wants to merge 1 commit into
microsoft:mainfrom
PratikDhanaveFork:foundry-memory-store-filters

Conversation

@PratikDhanave

Copy link
Copy Markdown
Contributor

What

Adds two fields to MemoryProviderConfig in provider/foundryprovider/memory.go:

  • StoreInputRequestFilter messagefilter.Filter — filters request messages before they are stored as memories (default ExternalOnly).
  • StoreInputResponseFilter messagefilter.Filter — filters response messages before they are stored as memories (default PassThrough).

newMemoryProvider now defaults these to ExternalOnly / PassThrough when nil and passes both into the underlying agent.ContextProviderConfig (StoreInputRequestMessageFilter / StoreInputResponseMessageFilter).

Why

Previously the request store filter was hardcoded to ExternalOnly and the response store filter was left unset, so callers had no way to customize which request or response messages get persisted as memories — even though the base agent/context.go already supports all three store/provide filters.

The chosen defaults preserve current behavior and match the .NET / Python SDKs, where an unset request filter defaults to external-only and an unset response filter defaults to pass-through. This closes a missing-configurability parity gap without changing observable defaults.

Tests

provider/foundryprovider/memory_test.go:

  • TestNewMemoryProviderUsesCustomStoreFilters — supplies custom request and response store filters and asserts both are invoked during Invoked (mirrors the existing TestNewMemoryProviderUsesCustomSearchInputFilter).
  • TestNewMemoryProviderStoreFiltersDefaultToExternalOnlyRequestAndPassThroughResponse — with no filters set, a non-external request message is dropped (default ExternalOnly) while a non-external response message is kept (default PassThrough), verified through the recorded update request.

go build ./..., go vet ./provider/foundryprovider/..., and go test ./provider/foundryprovider/... all pass.

Open design questions

  • Scope: kept to the two store filters plus their defaults; ProvideInputMessageFilter is already exposed via SearchInputFilter, so no rename is proposed here.
  • API shape: field names StoreInputRequestFilter / StoreInputResponseFilter mirror SearchInputFilter in this config rather than the longer ...MessageFilter names used on the base ContextProviderConfig. Happy to align to either convention.
  • Follow-ups: none required; defaults are unchanged so this is backwards compatible.

@PratikDhanave
PratikDhanave force-pushed the foundry-memory-store-filters branch from efdb5bb to 82c763e Compare July 24, 2026 01:40
@github-actions

This comment has been minimized.

@github-actions github-actions Bot added the public-api-change Pull Request changes public APIs label Jul 24, 2026
Add StoreInputRequestFilter and StoreInputResponseFilter to
MemoryProviderConfig and wire them into the underlying
ContextProviderConfig. Previously the request store filter was
hardcoded to ExternalOnly and the response store filter was left
unset, so callers could not customize which request or response
messages are persisted as memories.

Defaults are preserved to match .NET/Python parity: request messages
default to ExternalOnly and response messages default to PassThrough.
@PratikDhanave
PratikDhanave force-pushed the foundry-memory-store-filters branch from 82c763e to dded81a Compare July 24, 2026 09:34
@github-actions

Copy link
Copy Markdown
Contributor

Parity Review: ✅ Approved

This PR adds two new exported fields to MemoryProviderConfig in provider/foundryprovider:

  • StoreInputRequestFilter messagefilter.Filter (default ExternalOnly)
  • StoreInputResponseFilter messagefilter.Filter (default PassThrough)

Cross-repo alignment

The upstream .NET SDK exposes semantically identical fields on ChatHistoryMemoryProviderOptions:

  • StorageInputRequestMessageFilter — null defaults to ExternalOnly (matches Go ExternalOnly)
  • StorageInputResponseMessageFilter — null means no filtering / include all (matches Go PassThrough)

The Go field names (StoreInput*Filter) are slightly shorter than the .NET equivalents (StorageInput*MessageFilter), but this is a minor idiomatic difference already noted by the PR author under "API shape". The semantic contract and defaults are identical.

I was unable to locate a Foundry-specific memory provider in the upstream Python packages (the Python SDK has a ChatHistoryMemoryProvider analogue but not a Foundry memory store provider), so no Python parity gap is identified here.

Verdict

No cross-repo inconsistencies found. The change closes a genuine configurability gap while preserving existing defaults and aligning with the .NET SDK pattern. The public-api-change label is correctly present.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • awmgmcpg

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "awmgmcpg"

See Network Configuration for more information.

Generated by Go API Consistency Review Agent · 33.4 AIC · ⌖ 5.62 AIC · ⊞ 5.9K ·

@github-actions github-actions Bot added the parity-approved Go API consistency review found no parity issues label Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

parity-approved Go API consistency review found no parity issues public-api-change Pull Request changes public APIs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant