Repository navigation
Add DisableStoreOutput for Responses agents - #428
Conversation
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Pull request overview
Adds a DisableStoreOutput configuration switch for OpenAI/Foundry Responses-backed agents to disable service-side output storage (store=false), avoid persisting response IDs into sessions, and replay locally-managed history (including assistant tool calls) in a Responses-compatible input form. This supports scenarios where conversation state is owned by local history/session providers rather than the upstream service.
Changes:
- Add
DisableStoreOutputto Responses-backed agent configs (OpenAI + Foundry) and examples. - When disabled, send
store=falseand prevent saving response IDs intoagent.Session. - Update Responses history replay to include assistant
function_callitems and to useoutput_textfor assistant message replay; add/adjust tests accordingly.
Show a summary per file
| File | Description |
|---|---|
| provider/openaiprovider/responses.go | Implements store=false, skips persisting response IDs when disabled, and changes history replay formatting for assistant/function-call content. |
| provider/openaiprovider/responses_test.go | Updates expected request bodies for new replay format and adds test coverage for DisableStoreOutput behavior. |
| provider/openaiprovider/chat.go | Extends OpenAI agent config with DisableStoreOutput and documents its scope (Responses-only). |
| provider/foundryprovider/agent.go | Plumbs DisableStoreOutput through Foundry agent config into the OpenAI Responses agent. |
| provider/foundryprovider/agent_test.go | Verifies Foundry agent sets store=false and does not persist response IDs when disabled. |
| message/messagefilter/filter.go | Adds NotSourceTypes message filter utility. |
| message/messagefilter/filter_test.go | Adds unit test for NotSourceTypes. |
| examples/02-agents/providers/azure/openai_responses/main.go | Demonstrates a DisableStoreOutput (store=false) Responses agent configuration. |
| examples/02-agents/agents/step17_additional_ai_context/main.go | Switches example to DisableStoreOutput and uses NotSourceTypes for history filtering. |
| examples/02-agents/agents/step07_3rdparty_session_storage/main.go | Enables DisableStoreOutput for local session/history ownership scenario. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 10/10 changed files
- Comments generated: 1
- Review effort level: Low
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Generated by Go API Consistency Review Agent for #428 · 824.4 AIC · ⌖ 21.2 AIC · ⊞ 28.8K
Cross-Repo Parity ReviewScope: Verdict: ✅ Aligned — no blocking parity issues found.
|
| Go (this PR) | .NET | |
|---|---|---|
| Setting | AgentConfig.DisableStoreOutput = true |
AsIChatClientWithStoredOutputDisabled() |
| Effect | store=false on requests |
StoredOutputEnabled = false |
| Reasoning continuity | Always appends reasoning.encrypted_content to Include |
includeReasoningEncryptedContent param, defaults true |
| Session ID behavior | Skips saving response ID when disabled | Same — prevents replay from non-stored response |
The naming is inverted (DisableStoreOutput=true vs .StoredOutputEnabled = false) but semantically equivalent. The one minor difference from .NET: .NET exposes includeReasoningEncryptedContent as an opt-out parameter (defaults true), while Go always appends reasoning.encrypted_content when DisableStoreOutput=true with no escape hatch. This matches the intended default behavior for most users and is not a blocking issue, but could be worth a follow-up if users need to opt out.
Python note: Python handles this via a per-run store=false option rather than a config-level flag. The _get_conversation_id method already short-circuits to None when store is False. The Go approach is config-level (like .NET), which is a deliberate design choice consistent with Go idioms, not a parity gap.
NotSourceTypes filter (messagefilter)
This is a new Go-internal utility filter. Python's exclude_sources filters by string source ID (not by type), and no direct .NET equivalent is visible in the public API. The Go approach extends an existing filter pattern (NotSources by identity → NotSourceTypes by class). No parity concern.
Responses assistant message replay (FunctionCall items)
The fix to send FunctionCallContent as ResponseInputItemParamOfFunctionCall (rather than silently dropping them) restores correct Responses-API-compatible local history replay. This is a correctness fix with no upstream parity conflict.
Generated by Go API Consistency Review Agent for #428 · 333.6 AIC · ⌖ 12.6 AIC · ⊞ 27.1K · ◷
Summary
This ports the .NET SDK's stored-output-disabled Responses behavior to Go, so apps that manage their own local history can opt out of service-side Responses output storage in the same way.
The change adds
DisableStoreOutputto OpenAI and Foundry Responses-backed agent configs, sendsstore=falsewhen enabled, includesreasoning.encrypted_contentfor stateless reasoning continuity, and avoids saving response IDs into sessions that cannot safely continue from non-stored outputs. Per-runResponsesNewParams.Storeis also supported and takes precedence over the instance-levelDisableStoreOutputsetting for that run.It also teaches the Responses provider to replay local assistant messages and function-call history in a Responses-compatible shape while preserving the original assistant content order, then updates the related examples to use local history with output storage disabled.
Validation
go test -count=1 ./provider/openaiprovider ./provider/foundryprovider ./message/messagefilter ./examples/02-agents/agents/step07_3rdparty_session_storage ./examples/02-agents/agents/step17_additional_ai_context ./examples/02-agents/providers/azure/openai_responses