Skip to content

Python: Select Foundry hosting conversation history source - #6

Closed
eavanvalkenburg wants to merge 5 commits into
mainfrom
foundry-history-source
Closed

Python: Select Foundry hosting conversation history source#6
eavanvalkenburg wants to merge 5 commits into
mainfrom
foundry-history-source

Conversation

@eavanvalkenburg

Copy link
Copy Markdown
Owner

Motivation & Context

Foundry-hosted Responses agents can restore a downstream service conversation ID while also replaying the complete AgentServer response transcript. The model then receives duplicated history, and the duplication compounds on each turn. Always disabling downstream storage avoids that defect but introduces a measured multi-second streaming delay on the Foundry project endpoint and prevents applications from using their normal Agent history configuration.

This change makes the model-history source explicit while retaining AgentServer response persistence and session storage as independent concerns.

Description & Review Guide

  • What are the major changes? Adds history_source="agent_server" | "agent" to ResponsesHostServer. The default AgentServer mode replays response-provider history, forces downstream store=False, clears stale service IDs, rejects conflicting history/default conversation configuration, and refuses to persist a session if a client still stores downstream. Agent mode passes only current request input and preserves normal Agent history-provider and service-storage behavior. The PR also adds focused regression coverage, package documentation, and ADR 0039 with the considered alternatives and latency evidence.
  • What is the impact of these changes? Existing applications retain AgentServer response history as the default and stop feeding duplicated history to the model. Applications that need service-side storage, InMemoryHistoryProvider persisted through FoundryAgentSessionStore, or an external history provider can explicitly select history_source="agent".
  • What do you want reviewers to focus on? The separation between AgentServer response persistence and model-history ownership, the compatibility behavior for existing sessions containing service_session_id, and whether the two-value API communicates that distinction clearly.

Related Issue

Fixes microsoft#7955

The earlier PR microsoft#7957 was closed unmerged for design discussion; there is no other open PR for this issue.

Contribution Checklist

  • The code builds clean without any errors or warnings
  • All unit tests pass, and I have added new tests where possible
  • The PR follows the Contribution Guidelines
  • This PR is linked to an issue and there is no other open PR for this issue (see Related Issue above).
  • This is not a breaking change. If it is a breaking change, add the breaking change label (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and the title prefix in sync automatically.

BenGearset and others added 2 commits September 1, 2026 14:03
…ock.MEAI (microsoft#7983)

* `AWSSDK.Extensions.Bedrock.MEAI` -> `AWS.Bedrock.MEAI`

* Update `AgentWithMemory_Step03_MemoryUsingValkey_Bedrock` project
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: a4c73599-9f66-4c22-bd66-96fe676e0ce6
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: a4c73599-9f66-4c22-bd66-96fe676e0ce6
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: a4c73599-9f66-4c22-bd66-96fe676e0ce6
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: a4c73599-9f66-4c22-bd66-96fe676e0ce6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants