Skip to content

[dotnet-port-api] Forward A2A request config to hosted agents #765

Description

@github-actions

Summary

Ported the .NET hosted-A2A request-configuration forwarding behavior so Go hosted agents can observe inbound message/send configuration. This adds agent.WithAdditionalProperties, adds a2aprovider.NewHandler plus a2aprovider.WithRequestConfigForwarding(), forwards request metadata/config into hosted-agent run options under a2aprovider.RequestConfigurationPropertyKey, and updates the hosted A2A example and parity docs.

Ported .NET PRs

Breaking Changes

No.

Tests and Examples

  • go test ./agent ./provider/a2aprovider ./examples/05-end-to-end/a2a_client_server/a2a_server
  • Added hosted A2A tests covering forwarded request metadata/config and preserved server-controlled run mode
  • Updated examples/05-end-to-end/a2a_client_server/a2a_server/main.go to use a2aprovider.NewHandler

Notes

  • a2aprovider.NewHandler enables request-config forwarding by default for hosted A2A handlers.
  • Lower-level integrations that still call a2asrv.NewHandler(a2aprovider.NewExecutor(...)) can opt in explicitly with a2aprovider.WithRequestConfigForwarding().
  • This keeps Go aligned with the upstream hosted-A2A behavior without changing server-side background-response policy.

Generated by .NET to Go API Porting Agent · 1.6K AIC · ⌖ 26.8 AIC · ⊞ 21.7K ·


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-api-a2a-config-forwarding-20260729-7f85380fc8eff07b.

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 (265 of 265 lines)
From c49159a55fcd85b734e15eb1df02b008d5a7e2f3 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]" <github-actions[bot]@users.noreply.github.com>
Date: Wed, 29 Jul 2026 06:28:28 +0000
Subject: [PATCH] [dotnet-port-api] Forward A2A request config to hosted agents

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
 agent/options.go                              |  9 ++
 docs/dotnet-go-sdk-feature-comparison.md      |  2 +-
 .../a2a_client_server/a2a_server/main.go      |  5 +-
 provider/a2aprovider/executor.go              |  4 +
 provider/a2aprovider/handler.go               | 50 +++++++++++
 provider/a2aprovider/hosting_test.go          | 82 ++++++++++++++++++-
 6 files changed, 148 insertions(+), 4 deletions(-)
 create mode 100644 provider/a2aprovider/handler.go

diff --git a/agent/options.go b/agent/options.go
index 309b62139..1aca81b5b 100644
--- a/agent/options.go
+++ b/agent/options.go
@@ -4,6 +4,7 @@ package agent
 
 import (
 	"iter"
+	"maps"
 	"reflect"
 	"slices"
 	"strings"
@@ -31,6 +32,7 @@ type (
 	toolModeOpt                 tool.ToolMode
 	streamOpt                   bool
 	allowBackgroundResponsesOpt bool
+	additionalPropertiesOpt     struct{ props map[string]any }
 
 	structuredOutputOpt struct{ any }
 )
@@ -40,6 +42,7 @@ func (o streamOpt) Value() any                   { return bool(o) }
 func (o continuationTokenOpt) Value() any        { return string(o) }
 func (o instructionsOpt) Value() any             { return string(o) }
 func (o allowBackgroundResponsesOpt) Value() any { return bool(o) }
+func (o additionalPropertiesOpt) Value() any     { return o.props }
 func (o toolModeOpt) Value() any                 { return tool.ToolMode(o) }
 func (o toolOpt) Value() any                     { return o.Tool }
 func (o structuredOutputOpt) Value() any         { return o.any }
@@ -169,3 +172,9 @@ func WithInstructions(instructions string) Option {
 func AllowBackgroundResponses(allow bool) Option {
 	return allowBackgroundResponsesOp
... (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