Skip to content

[dotnet-port-api] Add Foundry hosted session stickiness #875

Description

@github-actions

Summary

Ports the hosted-session portion of upstream commit 74808cb6c7979be6e4513115e35cd8497b38bbaf from microsoft/agent-framework#7648 by adding sticky Foundry hosted-agent session support to the Go SDK. The Go change adds a per-run foundryprovider.WithHostedAgentSessionID(...) option, session helpers for reading and storing the sticky hosted session ID, request stamping for agent_session_id, response capture from x-agent-session-id, targeted tests, a persisted-session example update, and a feature-comparison doc update.

Ported .NET PRs

Breaking Changes

No.

Tests and Examples

  • go test ./provider/foundryprovider ./examples/02-agents/providers/foundry/step06_persisted_conversations
  • Added Foundry hosted-session coverage in provider/foundryprovider/hostedsession_test.go
  • Updated examples/02-agents/providers/foundry/step06_persisted_conversations/main.go to surface the captured hosted session ID that now persists with the serialized session

Notes

  • Upstream reference: microsoft/agent-framework@74808cb6c7979be6e4513115e35cd8497b38bbaf and microsoft/agent-framework#7648.
  • The related hosted user-identity pass-through work is already tracked separately in Go (#856), so this PR keeps the nightly change set narrow.
  • Go still does not expose Foundry hosted-session lifecycle/admin APIs; this change only aligns hosted-session reuse on agent runs.

Generated by .NET to Go API Porting Agent · gpt54 · 306.3 AIC · ⌖ 14 AIC · ⊞ 24.1K ·


Note

This was originally intended as a pull request, but GitHub Actions is not permitted to create or approve pull requests in this repository.
The changes have been pushed to branch dotnet-port-api-foundry-hosted-session-f82e4ea7cb4917de.

Click here to create the pull request

To fix the permissions issue, go to SettingsActionsGeneral and enable Allow GitHub Actions to create and approve pull requests. See also: gh-aw FAQ

Show patch preview (425 of 425 lines)
From 4e34e5ebce201ef1270a0cb623611eb35af48e4f Mon Sep 17 00:00:00 2001
From: "github-actions[bot]" <github-actions[bot]@users.noreply.github.com>
Date: Thu, 20 Aug 2026 05:52:53 +0000
Subject: [PATCH] [dotnet-port-api] Add Foundry hosted session stickiness

Port .NET Foundry hosted-agent session stickiness by adding a per-run hosted session option, sticky session helpers, request/response plumbing, tests, and a persisted-session example update.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
 docs/dotnet-go-sdk-feature-comparison.md      |   2 +-
 .../step06_persisted_conversations/main.go    |   4 +
 provider/foundryprovider/agent.go             |   3 +-
 provider/foundryprovider/hostedsession.go     | 179 ++++++++++++++++++
 .../foundryprovider/hostedsession_test.go     | 162 ++++++++++++++++
 5 files changed, 348 insertions(+), 2 deletions(-)
 create mode 100644 provider/foundryprovider/hostedsession.go
 create mode 100644 provider/foundryprovider/hostedsession_test.go

diff --git a/docs/dotnet-go-sdk-feature-comparison.md b/docs/dotnet-go-sdk-feature-comparison.md
index 22f52a521..62a9c6913 100644
--- a/docs/dotnet-go-sdk-feature-comparison.md
+++ b/docs/dotnet-go-sdk-feature-comparison.md
@@ -53,7 +53,7 @@ Within overlapping features, the main misalignments are API shape and ecosystem
 | AGUI agent/client | AGUI chat client and shared conversions. | `provider/aguiprovider`, AGUI SSE client integration. | Aligned | Type models differ but feature categories line up. |
 | AGUI hosting | ASP.NET Core AGUI hosting, end-to-end web chat samples. | `provider/aguiprovider`, JSON HTTP handler, backend/frontend tools, HITL, state examples, reasoning event emission. | Partial | Go has handlers and examples, but no ASP.NET/Blazor-style end-to-end web app equivalent. |
 | Azure AI Persistent agents | `Microsoft.Agents.AI.AzureAI.Persistent`, lifecycle and persistent conversation samples. | No equivalent package. | .NET only | Go currently uses OpenA
... (truncated)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions