Skip to content

feat(issues): add field selection to issue_read - #3966

Open
arolson wants to merge 1 commit into
github:mainfrom
arolson:feat/issue-read-fields
Open

arolson wants to merge 1 commit into
github:mainfrom
arolson:feat/issue-read-fields

Conversation

@arolson

@arolson arolson commented Nov 26, 2026

Copy link
Copy Markdown

Summary

Add optional fields selection to issue_read with method: get. An agent can retrieve issue metadata without bringing a long issue body into context.

Why

Agents that build triage tables and release summaries often need only a few issue fields. list_issues and search_issues already let callers select fields. This PR addresses the get portion of #3959.

What changed

  • Validate top-level field names against the advertised issue schema and apply the selection to legacy text and structured results.
  • Keep the full response when fields is omitted or empty.
  • Add MCP session tests for selected fields, default responses, author details, and invalid requests.

MCP impact

  • Tool schema or behavior changed. issue_read accepts an optional fields array for get, and the issue object can contain a subset of its properties.

Prompts tested

  • “Get issue 1 in owner/repo and return only its number, title, state, and URL.” Covered through mocked MCP calls on both supported response formats.

Security / limits

  • Auth / permissions considered. Filtering runs after the existing access checks and enrichment.
  • Data exposure, filtering, or token/size limits considered. Metadata-only calls omit the issue body from the response.

Tool renaming

  • I am not renaming tools as part of this PR.

Lint & tests

  • golangci-lint v2.14.0 run
  • script/test (go test -race ./...) with built UI assets
  • UI typecheck, tests, and build with Node 26

Docs

  • Regenerated the tool snapshot and README catalog.

Skills

  • Updated the bundled issue backlog triage skill with a metadata-only example.

AI assistance was used to implement, review, and test the change.

@arolson
arolson requested a review from a team as a code owner November 26, 2026 16:21
Copilot AI adaptive review requested due to automatic review settings November 26, 2026 16:21

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.

🔵 Needs a closer look

Dropping required issue properties while changing serialization across legacy and structured MCP responses creates interacting compatibility risks for downstream consumers that warrant maintainer review.

No open issues 🎉

What changed in this PR

Adds optional field selection to issue_read with method: get, addressing the get portion of #3959. Agents can request issue metadata without including long bodies, while omitted or empty selections preserve full responses.

Changes:

  • Validates top-level field selections and filters both legacy text and structured responses.
  • Updates the output schema to allow partial issue objects.
  • Adds response-format tests and documents metadata-only usage.
File Description
README.md Documents the optional fields parameter.
pkg/​skills/​catalog/​skills/​issue-backlog-triage/​SKILL.md Adds a metadata-only issue-read example.
pkg/​github/​typed_consolidated_issue_outputs_test.go Tests selections, defaults, invalid requests, and partial output schemas.
pkg/​github/​issues.go Advertises selectable fields and applies filtering for get.
pkg/​github/​issue_tool_types.go Adds Fields to the issue-read input type.
pkg/​github/​consolidated_issue_types.go Filters structured issue output and permits partial objects.
pkg/​github/​__toolsnaps__/​issue_read.snap Updates the input and output schema snapshot.

Review effort: Balanced (adaptive)

Comment thread pkg/github/issues.go
Type: "number",
Description: "The number of the issue",
},
"fields": fieldsSchemaProperty(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pushed an implementation of this approach to my fork: feat/issue-read-fields, commit f9009b0. It adds a separate get_fields method, reuses the existing getIssue implementation, and preserves get's full response contract and output schema. It also includes focused tests and the related toolsnap/docs updates. Could this approach address the contract concern?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for putting together a working patch. I compared the schemas and confirmed that get still requires the same four fields. Splitting field selection into get_fields addresses the compatibility concern for existing get calls. If maintainers are comfortable adding the method, I’d be happy to bring your commit into this PR and rerun the full suite.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants