Skip to content

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

Open
Michelle Clayton (michelle-clayton-work) wants to merge 3 commits into
mainfrom
copilot/dotnet-port-api-a2a-config-forwarding-20260729-7f85380fc8eff07b
Open

[dotnet-port-api] Forward A2A request config to hosted agents#999
Michelle Clayton (michelle-clayton-work) wants to merge 3 commits into
mainfrom
copilot/dotnet-port-api-a2a-config-forwarding-20260729-7f85380fc8eff07b

Conversation

@michelle-clayton-work

Copy link
Copy Markdown
Contributor

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 ·

Closes #765

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings September 4, 2026 22:28
@github-actions github-actions Bot added area:agent Changes files in the agent area area:examples Changes files in the examples area area:provider Changes files in the provider area area:provider/a2a Changes files in the provider / a2a area size:large At most 300 changed lines across at most 10 files labels Sep 4, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The change set is cohesive and tested, with only a minor non-blocking performance nit (redundant map cloning) noted.

Pull request overview

Ports the hosted-A2A request configuration forwarding behavior so Go hosted agents can observe inbound message/send configuration and request metadata via agent run options, aligning with upstream .NET behavior.

Changes:

  • Added agent.WithAdditionalProperties to carry provider/protocol-specific request metadata into an agent run.
  • Introduced a2aprovider.NewHandler and a2aprovider.WithRequestConfigForwarding() to forward inbound A2A configuration into hosted-agent run options under a2aprovider.RequestConfigurationPropertyKey.
  • Updated hosted A2A tests, the end-to-end hosted A2A example, and parity docs to reflect the new handler helper and forwarding behavior.
File summaries
File Description
agent/options.go Adds WithAdditionalProperties option for passing request metadata into agent runs.
provider/a2aprovider/executor.go Forwards request metadata into hosted-agent run options.
provider/a2aprovider/handler.go New helper handler + interceptor to inject request config into metadata under a stable key.
provider/a2aprovider/hosting_test.go Adds coverage for metadata/config forwarding and run-mode preservation.
examples/05-end-to-end/a2a_client_server/a2a_server/main.go Migrates sample to a2aprovider.NewHandler.
docs/dotnet-go-sdk-feature-comparison.md Updates feature parity notes for hosted A2A forwarding behavior.
Review details
  • Files reviewed: 6/6 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread provider/a2aprovider/executor.go Outdated
@github-actions github-actions Bot added kind:code Changes production behavior or code kind:docs Changes documentation or comments kind:examples Changes examples or example-support metadata kind:tests Changes tests, fixtures, or test infrastructure pending-auto-risk Automatic risk classification is in progress risk:medium Contained production impact requiring normal review depth and removed pending-auto-risk Automatic risk classification is in progress labels Sep 4, 2026
@michelle-clayton-work

Copy link
Copy Markdown
Contributor Author

Copilot resolve merge conflicts and address PR feedback

Copilot AI and others added 2 commits September 5, 2026 03:46
…pi-a2a-config-forwarding-20260729-7f85380fc8eff07b

# Conflicts:
#	agent/options.go
#	docs/dotnet-go-sdk-feature-comparison.md
#	provider/a2aprovider/executor.go
#	provider/a2aprovider/hosting_test.go

Co-authored-by: michelle-clayton-work <262183035+michelle-clayton-work@users.noreply.github.com>
Co-authored-by: michelle-clayton-work <262183035+michelle-clayton-work@users.noreply.github.com>

Copilot AI commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Copilot resolve merge conflicts and address PR feedback

Resolved the merge conflicts and addressed the metadata-cloning feedback in 84bfcc9; added the required workflow permission fix in c214815.

@github-actions github-actions Bot added area:github Changes files in the github area pending-auto-risk Automatic risk classification is in progress risk:medium Contained production impact requiring normal review depth and removed risk:medium Contained production impact requiring normal review depth pending-auto-risk Automatic risk classification is in progress labels Sep 6, 2026
@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Scope: public API, user-visible behavior, examples

Changed Go contract:

  • agent.WithAdditionalProperties(props map[string]any) Option (new exported run option)
  • a2aprovider.NewHandler(hostedAgent *agent.Agent, cfg ExecutorConfig, options ...a2asrv.RequestHandlerOption) a2asrv.RequestHandler (new)
  • a2aprovider.WithRequestConfigForwarding() a2asrv.RequestHandlerOption (new)
  • a2aprovider.RequestConfigurationPropertyKey = "a2a.configuration" (new)
  • executor.newRunOptions now forwards execCtx.Metadata via agent.WithAdditionalProperties
  • examples/05-end-to-end/a2a_client_server/a2a_server/main.go updated to use a2aprovider.NewHandler

Upstream evidence reviewed:

  • dotnet/src/Microsoft.Agents.AI.Hosting.A2A/A2AAgentHandler.csCreateRunOptions(RequestContext, ...) unconditionally sets AgentRunOptions.AdditionalProperties["a2a.configuration"] = context.Configuration whenever context.Configuration is non-null, for all three request paths (HandleNewMessageAsync, HandleTaskUpdateAsync, streaming). No opt-in flag gates this in A2AAgentHandler or A2AServerRegistrationOptions.cs.
  • dotnet/tests/Microsoft.Agents.AI.Hosting.A2A.UnitTests/A2AAgentHandlerTests.cs (via PR #7365) — verifies config forwarding is on by default.
  • .NET: Forward A2A MessageSendParams.Configuration in the A2A adapter agent-framework#7365 — confirms this is an unconditional default-on forward, matching the Go PR's a2aprovider.NewHandler default.

Result: aligned

The Go port's default-on config forwarding via a2aprovider.NewHandler matches the .NET A2AAgentHandler.CreateRunOptions behavior, which also forwards MessageSendParams.Configuration unconditionally with no opt-in gate. The Go WithRequestConfigForwarding() escape hatch for lower-level a2asrv.NewHandler(a2aprovider.NewExecutor(...)) integrations is a reasonable Go-specific accommodation and doesn't diverge from upstream semantics, since upstream has no equivalent lower-level composition seam to gate. agent.WithAdditionalProperties is a straightforward parallel to AgentRunOptions.AdditionalProperties, and naming (RequestConfigurationPropertyKey / ConfigurationPropertyKey, same "a2a.configuration" string value) is consistent. No behavior or naming divergence found.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • github.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "github.com"

See Network Configuration for more information.

Generated by Go API Consistency Review Agent for #999 · copilot · auto · 44.2 AIC · ⌖ 5.39 AIC · ⊞ 9.5K ·

@github-actions github-actions Bot added public-api-change Pull Request changes public APIs parity-approved Go API consistency review found no parity issues labels Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:agent Changes files in the agent area area:examples Changes files in the examples area area:github Changes files in the github area area:provider/a2a Changes files in the provider / a2a area area:provider Changes files in the provider area kind:code Changes production behavior or code kind:docs Changes documentation or comments kind:examples Changes examples or example-support metadata kind:tests Changes tests, fixtures, or test infrastructure parity-approved Go API consistency review found no parity issues public-api-change Pull Request changes public APIs risk:medium Contained production impact requiring normal review depth size:large At most 300 changed lines across at most 10 files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

3 participants