Document the exported agent.Response.String/Usage/Update and ResponseUpdate.Usage accessors - #749
Conversation
There was a problem hiding this comment.
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 ofTextContentacross 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.
This comment has been minimized.
This comment has been minimized.
Add godoc to Response.String, Response.Usage, Response.Update, and ResponseUpdate.Usage, which lacked comments while their neighbors (Response.Contents, ResponseUpdate.String) are documented.
3051261 to
2b2c1b2
Compare
Parity ReviewScope: Documentation-only PR — adds godoc comments to existing exported methods ( 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 Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "awmgmcpg"See Network Configuration for more information.
|
What
Adds one-line godoc comments to four exported accessors in
agent/response.gothat 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 streamingResponseUpdateinto the response.ResponseUpdate.Usage()— token usage carried by this update's UsageContent items.Why
These accessors sit next to documented neighbors —
Response.ContentsandResponseUpdate.Stringboth carry godoc — so the missing comments read as an inconsistency and leave gaps ingo doc ./agent. Documenting the full public surface ofResponse/ResponseUpdatekeeps 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 viago doc ./agent Responseandgo doc ./agent ResponseUpdate.