Skip to content

Add DisableStoreOutput for Responses agents - #428

Merged
Quim Muntal (qmuntal) merged 4 commits into
mainfrom
copilot/disable-store-output-examples
Jul 6, 2026
Merged

Quim Muntal (qmuntal) merged 4 commits into
mainfrom
copilot/disable-store-output-examples

Conversation

@qmuntal

@qmuntal Quim Muntal (qmuntal) commented Jul 6, 2026 •

Copy link
Copy Markdown
Member

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 DisableStoreOutput to OpenAI and Foundry Responses-backed agent configs, sends store=false when enabled, includes reasoning.encrypted_content for stateless reasoning continuity, and avoids saving response IDs into sessions that cannot safely continue from non-stored outputs. Per-run ResponsesNewParams.Store is also supported and takes precedence over the instance-level DisableStoreOutput setting 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

Copilot AI review requested due to automatic review settings July 6, 2026 13:05
@qmuntal
Quim Muntal (qmuntal) requested a review from a team as a code owner July 6, 2026 13:05
@github-actions

This comment has been minimized.

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

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 DisableStoreOutput to Responses-backed agent configs (OpenAI + Foundry) and examples.
  • When disabled, send store=false and prevent saving response IDs into agent.Session.
  • Update Responses history replay to include assistant function_call items and to use output_text for 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

Comment thread provider/openaiprovider/responses.go
@qmuntal
Quim Muntal (qmuntal) added this pull request to the merge queue Jul 6, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 6, 2026
@github-actions

This comment has been minimized.

@github-actions github-actions Bot 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.

Generated by Go API Consistency Review Agent for #428 · 824.4 AIC · ⌖ 21.2 AIC · ⊞ 28.8K

Comment thread provider/openaiprovider/responses.go Outdated
@qmuntal
Quim Muntal (qmuntal) added this pull request to the merge queue Jul 6, 2026
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Cross-Repo Parity Review

Scope: provider/openaiprovider, provider/foundryprovider, message/messagefilter, examples/

Verdict: ✅ Aligned — no blocking parity issues found.


DisableStoreOutput (openaiprovider + foundryprovider)

The Go DisableStoreOutput bool config field maps cleanly to the upstream .NET surface:

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 · ◷

Merged via the queue into main with commit 1489f08 Jul 6, 2026
19 checks passed
@qmuntal
Quim Muntal (qmuntal) deleted the copilot/disable-store-output-examples branch July 6, 2026 13:59
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.

3 participants