Skip to content

[dotnet-port-api] Add Responses reasoning include control - #966

Merged
Quim Muntal (qmuntal) merged 5 commits into
mainfrom
dotnet-port-api-responses-reasoning-include-a85cadeb016ee9e2
Sep 3, 2026
Merged

Quim Muntal (qmuntal) merged 5 commits into
mainfrom
dotnet-port-api-responses-reasoning-include-a85cadeb016ee9e2

Conversation

@michelle-clayton-work

Copy link
Copy Markdown
Contributor

Summary

Added openaiprovider.ResponsesIncludeReasoningEncryptedContent(bool) so Go Responses agents can opt out of automatically requesting reasoning.encrypted_content while store=false, matching the split control that upstream .NET added around stateless stored-output handling. The existing default behavior stays intact, and the Foundry provider docs/tests now cover the same run-option passthrough.

Upstream commit: 4ca093371ebbf42b549093aa73f7788d7b7416a0 (microsoft/agent-framework@4ca0933).

Ported .NET PRs

Breaking Changes

No. Existing store=false behavior still auto-includes encrypted reasoning content by default; this change only adds a new public opt-out control.

Tests and Examples

  • go test ./provider/openaiprovider ./provider/foundryprovider
  • Added targeted coverage for direct OpenAI Responses usage and Foundry RunOptions passthrough with the new option.

Notes

Generated by .NET to Go API Porting Agent · gpt54 · 230.1 AIC · ⌖ 9.67 AIC · ⊞ 24.2K · ◷

Closes #827

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings September 1, 2026 20:43
@github-actions github-actions Bot added area:provider Changes files in the provider area area:provider/foundry Changes files in the provider / foundry area area:provider/openai Changes files in the provider / openai area size:large At most 300 changed lines across at most 10 files labels Sep 1, 2026

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.

🟢 Approval recommended

The new option is correctly wired behind existing store=false behavior, preserves defaults, and includes targeted coverage for both direct OpenAI and Foundry passthrough scenarios.

Pull request overview

Adds a new per-run OpenAI Responses provider option to control whether reasoning.encrypted_content is automatically included when Responses output storage is disabled (store=false), aligning Go behavior with upstream .NET’s split control while keeping the existing default behavior unchanged.

Changes:

  • Introduced openaiprovider.ResponsesIncludeReasoningEncryptedContent(bool) and gated the automatic include behavior behind it (default true).
  • Documented the default include behavior and the opt-out mechanism for both OpenAI and Foundry agent configs.
  • Added targeted tests covering direct OpenAI Responses usage and Foundry RunOptions passthrough.
File summaries
File Description
provider/openaiprovider/responses.go Adds the new option type + helper and gates automatic reasoning.encrypted_content inclusion on the option.
provider/openaiprovider/responses_test.go Adds a test ensuring include is omitted when the option disables automatic encrypted reasoning include while store=false.
provider/openaiprovider/chat.go Updates DisableStoreOutput docs to mention the default encrypted reasoning include and the per-run opt-out.
provider/foundryprovider/agent.go Updates Foundry agent config docs to describe the default include behavior and the opt-out via RunOptions.
provider/foundryprovider/agent_test.go Adds a test verifying Foundry RunOptions can disable the automatic include passthrough.
Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread provider/foundryprovider/agent_test.go Outdated
Comment thread provider/openaiprovider/responses.go Outdated
Resolve conflicts against main: keep both new helpers in responses.go, keep both test imports. Adapt the port to main's changes -- rename the option method Value -> MAFValue, and drop the now-removed Config.DisableFuncAutoCall from the tests (matches review feedback).
Comment thread provider/openaiprovider/responses.go Outdated
@github-actions

This comment has been minimized.

@github-actions github-actions Bot added the public-api-change Pull Request changes public APIs label Sep 3, 2026
@qmuntal
Quim Muntal (qmuntal) added this pull request to the merge queue Sep 3, 2026
@github-actions github-actions Bot added kind:code Changes production behavior or code kind:tests Changes tests, fixtures, or test infrastructure labels Sep 3, 2026
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Scope: public API

Changed Go contract: New exported openaiprovider.ResponsesIncludeReasoningEncryptedContent(bool) agent.Option, consumed via agent.GetOption in responsesBuildCompletionParams (provider/openaiprovider/responses.go) and documented on AgentConfig.DisableStoreOutput in both provider/openaiprovider/chat.go and provider/foundryprovider/agent.go.

Upstream evidence reviewed: dotnet/src/Microsoft.Agents.AI.Foundry.Hosting/FoundryResponsesOptions.cs (IncludeReasoningEncryptedContent, default true, applies only while AllowStoredOutputEnabled is false) and dotnet/src/Microsoft.Agents.AI.Foundry.Hosting/InputConverter.cs (DisableStoredOutput/LocalDisableStoredOutput, which conditionally adds IncludedResponseProperty.ReasoningEncryptedContent only when the flag is true), from commit 4ca093371ebbf42b549093aa73f7788d7b7416a0 (upstream PR microsoft/agent-framework#7572).

Result: aligned. The Go option preserves the existing default behavior (auto-include reasoning.encrypted_content while store=false) and adds an opt-out matching the semantics and default of .NET's IncludeReasoningEncryptedContent (default true, effective only when output storage is disabled). Naming is idiomatic (Go functional option vs. .NET settable property) but conceptually equivalent. Tests in responses_test.go and foundryprovider/agent_test.go verify both the default and opt-out paths. No divergence found.

Generated by Go API Consistency Review Agent for #966 · copilot · auto · 28.9 AIC · ⌖ 6.44 AIC · ⊞ 9.5K · ◷

Merged via the queue into main with commit 9932fe2 Sep 3, 2026
28 checks passed
@qmuntal
Quim Muntal (qmuntal) deleted the dotnet-port-api-responses-reasoning-include-a85cadeb016ee9e2 branch September 3, 2026 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:provider/foundry Changes files in the provider / foundry area area:provider/openai Changes files in the provider / openai area area:provider Changes files in the provider area kind:code Changes production behavior or code kind:tests Changes tests, fixtures, or test infrastructure public-api-change Pull Request changes public APIs size:large At most 300 changed lines across at most 10 files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[dotnet-port-api] Add Responses reasoning include control

3 participants