Skip to content

Document the exported agent.Response.String/Usage/Update and ResponseUpdate.Usage accessors - #749

Merged
George Adams (gdams) merged 1 commit into
microsoft:mainfrom
PratikDhanaveFork:document-response-accessors
Jul 28, 2026
Merged

Document the exported agent.Response.String/Usage/Update and ResponseUpdate.Usage accessors#749
George Adams (gdams) merged 1 commit into
microsoft:mainfrom
PratikDhanaveFork:document-response-accessors

Conversation

@PratikDhanave

Copy link
Copy Markdown
Contributor

What

Adds one-line godoc comments to four exported accessors in agent/response.go that were missing them:

  • Response.String() — concatenated text of all TextContent items across the response messages.
  • Response.Usage() — token usage aggregated (summed) across all of the response's messages.
  • Response.Update() — folds a streaming ResponseUpdate into the response.
  • ResponseUpdate.Usage() — token usage carried by this update's UsageContent items.

Why

These accessors sit next to documented neighbors — Response.Contents and ResponseUpdate.String both carry godoc — so the missing comments read as an inconsistency and leave gaps in go doc ./agent. Documenting the full public surface of Response/ResponseUpdate keeps the Go API discoverable and aligned with the well-documented equivalents in the .NET and Python SDKs, where the corresponding response/update text and usage members are described. This is a pure documentation change: the comments are factual restatements of existing behavior, no code changes.

Testing

Docs-only. Verified with go build ./..., go vet ./agent/..., go test ./agent/... (all pass), and confirmed the comments render via go doc ./agent Response and go doc ./agent ResponseUpdate.

Copilot AI review requested due to automatic review settings July 24, 2026 04:13
@PratikDhanave
PratikDhanave (PratikDhanave) requested a review from a team as a code owner July 24, 2026 04:13

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

Adds missing GoDoc comments for exported Response/ResponseUpdate accessor methods in agent/response.go, improving go doc discoverability and making the public API documentation consistent with neighboring accessors.

Changes:

  • Documented (*Response).String() to describe its concatenation of TextContent across all response messages.
  • Documented (*Response).Usage() to describe aggregation of token usage across messages.
  • Documented (*Response).Update() and (*ResponseUpdate).Usage() to describe how streaming updates are folded into a response and how usage is surfaced from updates.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions

This comment has been minimized.

@github-actions github-actions Bot added the parity-approved Go API consistency review found no parity issues label Jul 24, 2026
Add godoc to Response.String, Response.Usage, Response.Update, and
ResponseUpdate.Usage, which lacked comments while their neighbors
(Response.Contents, ResponseUpdate.String) are documented.
@github-actions

Copy link
Copy Markdown
Contributor

Parity Review

Scope: Documentation-only PR — adds godoc comments to existing exported methods (Response.String, Response.Usage, Response.Update, ResponseUpdate.Usage).

Verdict: ✅ No parity issues.

This PR introduces no new exported API surface and no behavioral changes. The documented accessors already existed and their semantics remain consistent with upstream .NET and Python AgentResponse text/usage accessors. The public-api-change label is not warranted. The parity-approved label correctly reflects this review.

Warning

Firewall blocked 1 domain

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

  • awmgmcpg

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

network:
  allowed:
    - defaults
    - "awmgmcpg"

See Network Configuration for more information.

Generated by Go API Consistency Review Agent · 33.5 AIC · ⌖ 4.84 AIC · ⊞ 5.9K ·

@gdams
George Adams (gdams) added this pull request to the merge queue Jul 28, 2026
Merged via the queue into microsoft:main with commit 8d85a3a Jul 28, 2026
20 checks passed
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.

3 participants