Skip to content

Add atomic parent issue creation - #3134

Open
zwick wants to merge 6 commits into
mainfrom
zwick-atomic-sub-issue-creation
Open

Add atomic parent issue creation#3134
zwick wants to merge 6 commits into
mainfrom
zwick-atomic-sub-issue-creation

Conversation

@zwick

@zwick zwick commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds optional same- or cross-repository parent attachment to issue creation through GitHub's existing atomic GraphQL createIssue capability.

Why

The MCP tools previously required separate create and parent-attachment calls, leaving a partial-failure window even though CreateIssueInput.parentIssueId already supports atomic creation.

What changed

  • Add parent_issue_number with optional paired parent_owner and parent_repo inputs; omit both parent repository coordinates to use the new issue's repository.
  • Resolve user-facing identifiers before sending the parent, labels, and other supported fields in one createIssue mutation, with no attachment fallback.
  • Keep the existing REST path for unparented creation; parented creation rejects issue_fields rather than broadening this focused change.

Token impact

Measured with tiktoken 0.14.0 using o200k_base. Exact billed tokens remain host- and model-dependent.

Uncached startup surface Main This PR Delta
Default {name, description, inputSchema} tool payload 10,589 10,737 +148 (+1.40%)
Default tool-level descriptions 1,347 1,347 0
Granular Issues {name, description, inputSchema} payload 12,863 12,983 +120 (+0.93%)
Representative successful operation Previous two-step Atomic Savings
Same-repository parent 176 66 110 (62.5%)
Cross-repository parent 179 79 100 (55.9%)

The fixed increase is entirely in the input schema. Operational savings come from removing the second tool call and its full-parent response.

Token measurement commands
# Capture actual tools/list output from binaries built at main and this branch.
go build -o /tmp/github-mcp-server ./cmd/github-mcp-server
go build -o /tmp/mcpcurl ./cmd/mcpcurl
/tmp/mcpcurl --pretty=false \
  --stdio-server-cmd '/tmp/github-mcp-server stdio' schema > /tmp/tools.json

# Verify the relevant behavior and request counts.
go test ./pkg/github \
  -run 'TestIssueWriteCreateWithParent|Test_AddSubIssue|TestGranularCreateIssue' \
  -count=1

# Tokenize compact tools/list and representative call/result JSON.
python3 -m venv /tmp/token-count
/tmp/token-count/bin/pip install 'tiktoken==0.14.0'
/tmp/token-count/bin/python - <<'PY'
import json
import tiktoken

payload = json.dumps(
    json.load(open('/tmp/tools.json'))['result']['tools'],
    separators=(',', ':'),
)
for name in ('o200k_base', 'cl100k_base'):
    print(name, len(tiktoken.get_encoding(name).encode(payload)))
PY

The comparison repeated the schema capture against main and the feature branch, and separately tokenized the representative atomic and two-step call/result payloads.

MCP impact

  • No tool or API changes
  • Tool schema or behavior changed — parented creation now uses one GraphQL mutation; unparented creation retains its existing REST behavior.
  • New tool added

Prompts tested (tool changes only)

Security / limits

  • No security or limits impact
  • Auth / permissions considered — GitHub validates access to both explicitly named repositories, and GraphQL permission or compatibility errors surface without a non-atomic fallback.
  • Data exposure, filtering, or token/size limits considered

Tool renaming

  • I am renaming tools as part of this PR (e.g. a part of a consolidation effort)
    • I have added the new tool aliases in deprecated_tool_aliases.go
  • I am not renaming tools as part of this PR

Lint & tests

  • Linted locally with ./script/lint
  • Tested locally with ./script/test

Docs

  • Not needed
  • Updated (README / docs / examples)

@zwick zwick self-assigned this Aug 21, 2026
@zwick
zwick marked this pull request as ready for review August 24, 2026 13:13
@zwick
zwick requested a review from a team as a code owner August 24, 2026 13:13
Copilot AI balanced review requested due to automatic review settings August 24, 2026 13: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 atomic parent attachment during issue creation through GitHub’s GraphQL API while retaining REST for unparented issues.

Changes:

  • Adds same- and cross-repository parent parameters.
  • Resolves metadata before a single atomic creation mutation.
  • Adds unit coverage, snapshots, and generated documentation.
Show a summary per file
File Description
README.md Documents parent inputs.
pkg/github/issues.go Implements atomic parented creation.
pkg/github/issues_test.go Tests validation and GraphQL behavior.
pkg/github/issues_granular.go Extends granular issue creation.
pkg/github/__toolsnaps__/issue_write.snap Updates consolidated schema snapshot.
pkg/github/__toolsnaps__/create_issue.snap Updates granular schema snapshot.
docs/insiders-features.md Documents consolidated inputs.
docs/feature-flags.md Documents feature-flagged schemas.

Review details

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 8/8 changed files
  • Comments generated: 2
  • Review effort level: Balanced

Comment thread pkg/github/issues.go
Comment thread pkg/github/issues.go Outdated
@zwick
zwick marked this pull request as draft August 24, 2026 13:33
@zwick
zwick marked this pull request as ready for review August 24, 2026 13:41
zwick and others added 6 commits August 24, 2026 10:26
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: f71d9868-eef8-4fb0-84c6-df7c9a6a0ade
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: f71d9868-eef8-4fb0-84c6-df7c9a6a0ade
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: f71d9868-eef8-4fb0-84c6-df7c9a6a0ade
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: f71d9868-eef8-4fb0-84c6-df7c9a6a0ade
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: f71d9868-eef8-4fb0-84c6-df7c9a6a0ade
@zwick
zwick force-pushed the zwick-atomic-sub-issue-creation branch from 77c6971 to 4bf240f Compare August 24, 2026 14:26
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.

2 participants