Skip to content

Commit b628491

Browse files
SamMorrowDrumsCopilotgithub-actions[bot]
authored
feat(issues): add protocol-gated typed consolidated issue tools (#3393)
* feat(repos): complete typed repository tool outputs Migrate the remaining 17 repository tools to concrete inputs and outputs. Preserve existing content, mutations, scopes, filtering, and protocol gating; add wire and schema conformance coverage. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * chore(repos): exclude unrelated snapshot formatting drift Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * refactor(repos): compact typed repository outputs Replace raw REST output schemas with compact repository DTOs, retain one canonical snapshot per tool, and align modern JSON text with structured output while pinning legacy content. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * feat(issues): add typed consolidated issue tool contracts Preserve raw helper APIs and exact legacy text while exposing concrete output unions for modern protocols. Retain explicit awaiting statuses and real null responses without exposing SDK-generated error fallbacks. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * chore: regenerate license files Auto-generated by license-check workflow * refactor(issues): minimize consolidated typed outputs Project compact method-discriminated DTOs from API responses while preserving the separate legacy text formatter and explicit app-awaiting status. Cache strict schemas and keep only canonical snapshots. Strengthen null-member presence, schema size, and lockdown projection regressions. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * fix(issues): keep union property schemas portable Preserve forbidden variant properties as annotated schema objects rather than boolean schemas emitted by jsonschema-go. Cover Inspector's input paths and IFC labels on every issue-read method across protocols. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * test(issues): cover strict sub-issue output variants Reject unknown methods, states, field types, opaque values and API URL properties while covering nullable and empty method data. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * test(issues): pin compact comment user redaction Pin unchanged legacy profile/avatar fields separately from compact modern user projections and assert identical lockdown filtering and sanitization across protocols. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * fix(issues): restore main-identical advertised input schema Remove added custom-field union constraints and sentinel enums from the advertised issue-write input. Preserve runtime exactly-one validation and private strict-schema tests. All three scoped input schemas compare exactly equal to main. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * fix(issues): restore protocol output parity Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * chore: regenerate license files Auto-generated by license-check workflow --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 7894659 commit b628491

15 files changed

Lines changed: 2490 additions & 1371 deletions

‎docs/error-handling.md‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,29 @@ This function:
5757
return ghErrors.NewGitHubGraphQLErrorResponse(ctx, message, err), nil
5858
```
5959

60+
### Typed Tool Results
61+
62+
Tools registered with concrete `NewTool[In, Out]` types expose output schemas and
63+
`structuredContent` only when the negotiated protocol is `2026-07-28` or newer.
64+
Older or unknown protocols retain the original text responses without these
65+
typed-output additions. Ordinary API and validation errors never expose the
66+
SDK-generated zero-value structured output.
67+
68+
Handler-provided structured statuses are distinct from generated error output.
69+
For example, `issue_write` can return `IsError: true` with
70+
`status: "awaiting_user_submission"` while an MCP App form is pending. Modern
71+
clients retain that explicit status and its reason; legacy clients retain the
72+
stop message and error flag without structured content. This status does not
73+
mean the issue was created or updated. The output schema includes a strict
74+
status variant alongside the mutation's `id`/`url` variant. Multi-round-trip
75+
`InputRequests` continue to pass through unchanged.
76+
77+
The consolidated issue tools use method-discriminated object outputs for modern
78+
successes. Issue and comment data are projected from the API responses into
79+
compact DTOs, excluding API, node, and hypermedia URLs while retaining human
80+
links. Legacy text is marshalled separately and keeps its original format and
81+
fields.
82+
6083
### Context Management
6184

6285
The error handling system uses context to store errors for later inspection:

0 commit comments

Comments
 (0)