Skip to content

[dotnet-code] Consolidate agent host request dispatch internals - #831

Open
Michelle Clayton (michelle-clayton-work) wants to merge 1 commit into
mainfrom
dotnet-code/agent-host-request-dispatch-f2801c8f8cc41e6e
Open

[dotnet-code] Consolidate agent host request dispatch internals#831
Michelle Clayton (michelle-clayton-work) wants to merge 1 commit into
mainfrom
dotnet-code/agent-host-request-dispatch-f2801c8f8cc41e6e

Conversation

@michelle-clayton-work

Copy link
Copy Markdown
Contributor

Summary

Consolidates the duplicated hosted-agent request tracking and dispatch loops used for tool approval requests and unterminated function calls into one unexported helper. This keeps the Go hosting internals structurally closer to the .NET host option model where request interception is handled through common host behavior, while preserving the existing public Go config shape and dispatch semantics.

.NET Reference

  • dotnet/src/Microsoft.Agents.AI.Workflows/AIAgentHostOptions.cs - host options describing intercepted user-input requests, intercepted unterminated function calls, forwarded messages, and agent response/update emission.

Public API and Behavior

No public Go API changed. No intentional behavior change was made.

Tests

  • go test ./workflow/agentworkflow

Notes

Rejected sampled candidates:

Generated by .NET-to-Go Code Portability Refactoring Agent · gpt55 · 112.1 AIC · ⌖ 32.4 AIC · ⊞ 23.2K ·

Closes #811

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

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.

Pull request overview

This PR refactors the hosted-agent request dispatch logic in workflow/agentworkflow by consolidating the duplicated “track pending requests, then dispatch newly-tracked ones” loops for tool approval requests and unterminated function calls into a single unexported generic helper, aligning the internal structure more closely with the referenced .NET host options model without changing the public Go API.

Changes:

  • Replaced duplicated tracking/dispatch loops with a shared dispatchTrackedRequests helper.
  • Introduced a small internal requestDispatcher[T] interface to abstract the shared TrackRequest/DispatchRequest behavior over both request types.

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

@github-actions

Copy link
Copy Markdown
Contributor

Parity Review: ✅ Approved

This PR consolidates duplicated unexported request-dispatch helpers in workflow/agentworkflow/hosting.go into a single internal helper. No exported Go types, functions, methods, fields, or constants were added, removed, or changed.

Scope: Internal refactor only — out of scope for cross-repo API parity review.

No parity issues found. The change keeps Go hosting internals structurally closer to the .NET AIAgentHostOptions model as noted in the PR, without altering any user-visible Go contract.

Generated by Go API Consistency Review Agent for #831 · sonnet46 · 13.1 AIC · ⌖ 5.53 AIC · ⊞ 5.7K ·

@github-actions github-actions Bot added the parity-approved Go API consistency review found no parity issues label Aug 12, 2026
@michelle-clayton-work

Copy link
Copy Markdown
Contributor Author

Copilot fix linter failures

Copilot AI commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Copilot fix linter failures

I investigated this lint failure and there are no code lint violations from this PR. The failed golangci-lint run was due to an external download error (Unexpected HTTP response: 503 while fetching golangci-lint), and local lint passes (v2.12.2, 0 issues) on the changed package. I re-ran the workflow run (31637732365) so CI can retry.

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

Labels

parity-approved Go API consistency review found no parity issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[dotnet-code] Consolidate agent host request dispatch internals

3 participants