Use minimal response types for tool results - #3055
Merged
Merged
Conversation
Return compact response shapes for pull request statuses, review comment replies, and individual workflow runs. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: d6786153-698a-4563-97ad-a8221c40e306
Contributor
There was a problem hiding this comment.
Pull request overview
Reduces tool response payloads while retaining identifiers, diagnostics, and follow-up links.
Changes:
- Introduces compact pull request status responses.
- Minimizes review-comment reply results.
- Aligns singular workflow-run responses with existing minimal list types.
Show a summary per file
| File | Description |
|---|---|
pkg/github/pullrequests.go |
Returns minimal status and reply responses. |
pkg/github/pullrequests_test.go |
Verifies compact status and reply serialization. |
pkg/github/minimal_types.go |
Adds minimal commit-status types and converters. |
pkg/github/actions.go |
Uses the minimal workflow-run response. |
pkg/github/actions_test.go |
Verifies compact workflow-run serialization. |
Review details
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 5/5 changed files
- Comments generated: 0
- Review effort level: Balanced
kerobbi
approved these changes
Aug 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Return compact successful responses for pull request statuses, pull request review comment replies, and individual Actions workflow runs while preserving identifiers, diagnostics, and human-facing links needed for follow-up work.
Why
Several successful tool responses include SDK transport metadata and nested objects that are not needed for diagnosis or supported follow-up calls. Focused contracts reduce response payload size without changing input schemas.
What changed
pull_request_read.get_status.MinimalResponsecontract for newly created pull request review comment replies in body-only and body-plus-reaction modes.MinimalWorkflowRunforactions_get.get_workflow_runso singular and list responses stay aligned.Response contracts and estimated size
The estimates below compare minified JSON generated from representative SDK and test fixtures before and after this change. Exact savings vary with populated optional fields and content length.
pull_request_read.get_statuspull_request_read.get_statusadd_reply_to_pull_request_commentactions_get.get_workflow_runpull_request_read.get_statusRetained combined-status fields:
state,sha,total_count, andstatuses.Dropped combined-status fields:
name,commit_url, andrepository_url.Retained fields for each status:
state,context,description,target_url,created_at, andupdated_at.Dropped fields for each status:
id,node_id,url,avatar_url, andcreator. The human-facingtarget_urlremains available; only the REST transporturlis removed.add_reply_to_pull_request_commentRetained output fields for a newly created reply:
idas a string andurlpopulated from the comment's human-facinghtml_url. The reaction-only path was already minimal and is unchanged; body-plus-reaction responses now contain minimalcommentandreactionobjects.Dropped reply-comment fields:
node_id,in_reply_to_id,body,path,diff_hunk,pull_request_review_id,position,original_position,start_line,line,original_line,original_start_line,side,start_side,commit_id,original_commit_id,user,reactions,created_at,updated_at,author_association, the REST transporturl,pull_request_url, andsubject_type. The sourcehtml_urlkey is replaced by the minimal response'surlkey rather than losing its value.actions_get.get_workflow_runRetained fields:
id,name,display_title,workflow_id,run_number,run_attempt,event,status,conclusion,head_branch,head_sha,path,html_url,created_at,updated_at, andrun_started_at.Retained nested data:
head_commit.message; pull request numbers inpull_requests; compactactorandtriggering_actorvalues containinglogin,id,profile_url, andavatar_url; and referenced workflowpath,sha, andrefvalues.Dropped fields:
node_id,check_suite_id,check_suite_node_id,url,jobs_url,logs_url,check_suite_url,artifacts_url,cancel_url,rerun_url,previous_attempt_url,workflow_url, fullrepositoryandhead_repositoryobjects, all pull request fields exceptnumber, actor fields outside the compact identity above, and all head-commit fields exceptmessage.MCP impact
Successful response bodies for the three methods above are smaller. Their input schemas and error behavior are unchanged.
Prompts tested (tool changes only)
Security / limits
Responses intentionally omit unused metadata while retaining identifiers needed by supported follow-up operations.
Tool renaming
deprecated_tool_aliases.goNote: if you're renaming tools, you must add the tool aliases. For more information on how to do so, please refer to the official docs.
Lint & tests
./script/lint./script/testDocs