Skip to content

Fix toolautocall.New godoc: it returns middleware, not a chat client - #1148

Open
PratikDhanave (PratikDhanave) wants to merge 1 commit into
microsoft:mainfrom
PratikDhanaveFork:fix/godoc-toolautocall-new
Open

PratikDhanave (PratikDhanave) wants to merge 1 commit into
microsoft:mainfrom
PratikDhanaveFork:fix/godoc-toolautocall-new

Conversation

@PratikDhanave

Copy link
Copy Markdown
Contributor

The doc comment reads "New creates a new function-invoking chat client that wraps the provided client," but the signature is New(cfg Config) agent.Middleware — it takes only a Config and returns middleware; wrapping of the downstream RunFunc happens later in Run. The wording is leftover from .NET's FunctionInvokingChatClient. Comment-only fix.

New takes only a Config and returns an agent.Middleware; the doc comment was
leftover .NET FunctionInvokingChatClient wording naming a client parameter and
chat-client return that do not exist.
Copilot AI lite review requested due to automatic review settings September 22, 2026 03:12
@github-actions github-actions Bot added area:agent Changes files in the agent area size:small At most 30 changed lines across at most 2 files labels Sep 22, 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.

Copilot review overview

🟢 Approval recommended

The comment now accurately matches the function signature and behavior.

Review effort: Lite
Findings: None

What changed in this PR

Corrects the toolautocall.New documentation to accurately describe its middleware return value and configuration.

Changes:

  • Updated the New godoc comment.
File Description
agent/​harness/​toolautocall/​autocall.go Corrected documentation for New.

💡 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

Scope: internal-only (doc comment only)

Changed Go contract: None — toolautocall.New(cfg Config) agent.Middleware's exported signature, parameters, defaults, and behavior are unchanged. Only the leading // doc comment on New was corrected from "creates a new function-invoking chat client that wraps the provided client" to "creates automatic tool-invocation middleware configured by cfg."

Upstream evidence reviewed: No equivalent found — not applicable, since no exported API or observable behavior changed. No comparison to dotnet/src/Microsoft.Agents.AI.* FunctionInvokingChatClient or Python equivalents was needed.

Result: out of scope

This PR only fixes an inaccurate godoc comment to match the existing implementation; it introduces no new API, no behavior change, and no cross-repo parity concern. No inline findings or label changes needed.

Generated by Go API Consistency Review Agent · copilot · auto · 18.1 AIC · ⌖ 4.81 AIC · ⊞ 9.2K ·

@github-actions github-actions Bot added the kind:docs Changes documentation or comments label Sep 22, 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 kind:docs Changes documentation or comments size:small At most 30 changed lines across at most 2 files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants