Make Foundry MemoryProvider store request/response message filters configurable - #680
Make Foundry MemoryProvider store request/response message filters configurable#680PratikDhanave wants to merge 1 commit into
Conversation
efdb5bb to
82c763e
Compare
This comment has been minimized.
This comment has been minimized.
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.
82c763e to
dded81a
Compare
Parity Review: ✅ ApprovedThis PR adds two new exported fields to
Cross-repo alignmentThe upstream .NET SDK exposes semantically identical fields on
The Go field names ( I was unable to locate a Foundry-specific memory provider in the upstream Python packages (the Python SDK has a VerdictNo cross-repo inconsistencies found. The change closes a genuine configurability gap while preserving existing defaults and aligning with the .NET SDK pattern. The Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "awmgmcpg"See Network Configuration for more information.
|
What
Adds two fields to
MemoryProviderConfiginprovider/foundryprovider/memory.go:StoreInputRequestFilter messagefilter.Filter— filters request messages before they are stored as memories (defaultExternalOnly).StoreInputResponseFilter messagefilter.Filter— filters response messages before they are stored as memories (defaultPassThrough).newMemoryProvidernow defaults these toExternalOnly/PassThroughwhen nil and passes both into the underlyingagent.ContextProviderConfig(StoreInputRequestMessageFilter/StoreInputResponseMessageFilter).Why
Previously the request store filter was hardcoded to
ExternalOnlyand 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 baseagent/context.goalready 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 duringInvoked(mirrors the existingTestNewMemoryProviderUsesCustomSearchInputFilter).TestNewMemoryProviderStoreFiltersDefaultToExternalOnlyRequestAndPassThroughResponse— with no filters set, a non-external request message is dropped (defaultExternalOnly) while a non-external response message is kept (defaultPassThrough), verified through the recorded update request.go build ./...,go vet ./provider/foundryprovider/..., andgo test ./provider/foundryprovider/...all pass.Open design questions
ProvideInputMessageFilteris already exposed viaSearchInputFilter, so no rename is proposed here.StoreInputRequestFilter/StoreInputResponseFiltermirrorSearchInputFilterin this config rather than the longer...MessageFilternames used on the baseContextProviderConfig. Happy to align to either convention.