Skip to content

.NET: Foundry hosting rejects Harness local chat history marker when AllowStoredOutputEnabled is false #8707

Description

Description

Microsoft.Agents.AI.Foundry.Hosting fails requests from HarnessAgent (and any ChatClientAgent using per-service-call local chat history persistence) with agent_stored_output_not_disabled when FoundryResponsesOptions.AllowStoredOutputEnabled is left at its default false.

Root cause

  • HarnessAgent defaults to InMemoryChatHistoryProvider, which keeps history in AgentSession.StateBag.
  • After each service call, PerServiceCallChatHistoryPersistingChatClient writes the internal sentinel LocalHistoryConversationId ("_agent_local_chat_history") into ChatClientAgentSession.ConversationId. The sentinel means "history is persisted locally", not "the service stored this conversation".
  • AgentFrameworkResponseHandler.CheckNotAllowedStoreUsage treats every non-null ConversationId as service storage, so the local sentinel triggers the stored-output rejection.

Impact

Hosted Harness agents only work if developers opt in to AllowStoredOutputEnabled = true, even though the host still sends store=false and no conversation is stored by the service. The public foundry-samples Harness samples currently carry that opt-in as a workaround.

Expected behavior

  • The local history sentinel is allowed when AllowStoredOutputEnabled is false.
  • A real service-stored conversation ID is still rejected.
  • The host continues to request store=false by default.

Related

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    .NETUsage: [Issues, PRs], Target: .Net

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions