Skip to content

[dotnet-port-fixes] Add workflow checkpoint identity regression coverage #772

Description

@github-actions

Summary

Add Go regression coverage for checkpointed workflow-as-agent sessions so we keep parity with the .NET guidance around stable hosted-agent identities.

The new workflow/agentworkflow tests prove three cases:

  1. Reconstructing the outer workflow agent resumes correctly when the hosted inner agent keeps the same agent.Config.ID and agent.Config.Name.
  2. Reconstructing with a fresh random inner agent ID fails checkpoint compatibility.
  3. Reconstructing with the same inner agent ID but a different name also fails compatibility, because the hosted executor identity includes both values.

The updated workflow samples now document that requirement and assign stable IDs in the workflow-as-agent examples so checkpointed sessions remain resumable when the workflow is rebuilt.

Ported .NET PRs

Upstream commit inspected: 6a3d5352042959eb276dc52e1e7f69a6fe5e4e8a.

Breaking Changes

No.

Tests and Examples

  • go test ./workflow/agentworkflow -run 'TestNew_(WorkflowAgentSession|SerializedSessionResumes)'
  • go test ./examples/03-workflows/checkpoint/checkpoint_and_rehydrate ./examples/03-workflows/agents/workflow_as_an_agent ./examples/03-workflows/observability/workflow_as_an_agent
  • Updated examples:
    • examples/03-workflows/checkpoint/checkpoint_and_rehydrate/main.go
    • examples/03-workflows/agents/workflow_as_an_agent/main.go
    • examples/03-workflows/observability/workflow_as_an_agent/main.go

Notes

The upstream .NET change was test/sample guidance rather than a runtime code change, and the Go port follows the same scope: regression coverage plus sample guidance, with no exported API changes.

Generated by .NET to Go Fixes and Test Porting Agent · gpt54 · 251.5 AIC · ⌖ 18.1 AIC · ⊞ 24.2K ·


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 copilot/dotnet-port-fixes-stable-agent-ids-7a2dda3966258588.

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 (295 of 295 lines)
From 5ce631d24e9748a63668856d3e0a46cd3ef947cc Mon Sep 17 00:00:00 2001
From: "github-actions[bot]" <github-actions[bot]@users.noreply.github.com>
Date: Fri, 31 Jul 2026 03:41:40 +0000
Subject: [PATCH] Add workflow checkpoint identity coverage

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
 .../agents/workflow_as_an_agent/main.go       |   6 +
 .../checkpoint_and_rehydrate/main.go          |   6 +
 .../workflow_as_an_agent/main.go              |  13 +-
 workflow/agentworkflow/workflow_test.go       | 153 ++++++++++++++++++
 4 files changed, 177 insertions(+), 1 deletion(-)

diff --git a/examples/03-workflows/agents/workflow_as_an_agent/main.go b/examples/03-workflows/agents/workflow_as_an_agent/main.go
index 4d9282c..c2a7f35 100644
--- a/examples/03-workflows/agents/workflow_as_an_agent/main.go
+++ b/examples/03-workflows/agents/workflow_as_an_agent/main.go
@@ -19,6 +19,9 @@ var logger = demo.NewLogger(
 
 func main() {
 	token := demo.FoundryTokenCredential()
+	// Keep hosted-agent IDs and names stable if this workflow is ever rebuilt and
+	// resumed from a checkpointed session; hosted executor identities derive from
+	// both values.
 	french := foundryprovider.NewAgent(
 		demo.FoundryProjectEndpoint,
 		token,
@@ -26,6 +29,7 @@ func main() {
 		foundryprovider.AgentConfig{
 			Instructions: "Respond in French. Keep the answer concise.",
 			Config: agent.Config{
+				ID:          "french-agent",
 				Name:        "French",
 				Middlewares: []agent.Middleware{logger},
 			},
@@ -38,6 +42,7 @@ func main() {
 		foundryprovider.AgentConfig{
 			Instructions: "Respond in English. Keep the answer concise.",
 			Config: agent.Config{
+				ID:          "english-agent",
 				Name:        "English",
 				Middlewares: []agent.Middleware{logger},
 			},
@@ -51,6 +56,7 @@ func main() {
 	wfAgent, err := agentworkflow.NewAgent(wf, agentworkflow.AgentConfig{
 		IncludeOutputsInResponse: true,
 		Config: agent.Config{
+			ID:   "bilingual-workflow-ag
... (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