Repository navigation
Conversation
Pull the Users.Get account type lookup out of detectOwnerType so issue metadata can reuse it to tell a user owner from an organization. The project probe fallback is unchanged. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 48ff87e1-24bb-49f1-887f-9f2576ab0c2d
dewski
force-pushed
the
dewski/owner-agnostic-issue-types-fields
branch
from
November 12, 2026 19:39
9ec3a65 to
001cf21
Compare
Issue types and issue fields are available on user accounts as well as organizations. list_issue_types, list_issue_fields, and the ui_get issue_types method assumed the owner was an organization when repo was omitted, so they failed or came back empty for user-owned repositories. Introduce issueMetadataScope (repository, organization, or the authenticated user) and resolve it once per call. With repo, the repository path is unchanged. Without repo, the owner's account type picks the organization endpoints or, when the owner is the authenticated user, GET /user/issue-types and GraphQL user(login:).issueFields. GitHub lists a user's definitions only to that user, so any other user owner gets a tool error asking for repo instead of a raw FORBIDDEN. The issue-write app now passes repo to ui_get issue_types, which reads the repository endpoint. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 48ff87e1-24bb-49f1-887f-9f2576ab0c2d
Tool descriptions, toolset instructions, the README, and toolsnaps said issue types and fields belong to an organization. Describe the owner as a user or organization, and note that ui_get takes an optional repo for issue_types. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 48ff87e1-24bb-49f1-887f-9f2576ab0c2d
resolveIssueMetadataScope put the raw owner argument into the tool error
it returns for another user's account. owner comes from the model, and
go-github doesn't escape it in the users/{owner} path, so a value like
"octocat?x=..." still resolves to a real user and its extra text would
reach the model verbatim. Refer to "the owner" instead, since the model
already knows what it passed.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 48ff87e1-24bb-49f1-887f-9f2576ab0c2d
dewski
force-pushed
the
dewski/owner-agnostic-issue-types-fields
branch
from
November 12, 2026 23:21
f723276 to
00176cc
Compare
dewski
commented
Nov 12, 2026
| if repo, ok := arguments["repo"].(string); ok && repo != "" { | ||
| return scopes.ChallengeAll(activeScopes, scopes.Repo) | ||
| } | ||
| return scopes.ChallengeAll(activeScopes, scopes.ReadOrg) |
Author
There was a problem hiding this comment.
I kept the read:org challenge for owner-level calls here and in repositoryOrOrganizationScopeAccess, even though a user owner doesn't need it. The challenge runs before the tool and only sees the arguments and the token's scopes, so it can't tell a user from an organization without an extra GET /users/{owner}.
I wonder if you'd rather we stop challenging for read:org on owner-level calls? An organization caller without it would get the API error instead of a step-up prompt, and a user caller would never be asked for a scope they don't need. read:org is a default scope, so I'd expect either case to be rare. Happy to drop it in a follow-up if that's the preference.
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
This PR makes
list_issue_types,list_issue_fields, andui_getissue_typeswork for user-owned repositories, not just organizations.Why
Issue types and fields are available on user accounts now, but without
repothe server assumed the owner was an organization, so user owners failed againstorgs/{owner}. The issue-write app's type picker also came back empty on user-owned repositories.What changed
I'd review commit by commit. Each one builds and passes tests on its own.
ownerAccountTypefromdetectOwnerTypeinprojects.go. No behavior change.issueMetadataScope(issue_metadata_scope.go), which resolves each call to a repository, organization, or the authenticated user. Withoutrepo, an authenticated user owner usesGET /user/issue-typesanduser(login:)issueFields. Any other user owner gets a tool error asking forrepo, since GitHub only lists a user's definitions to that user.ui_getissue_typesnow takes an optionalrepo, and the issue-write app passes it.ownerargument in that tool error.MCP impact
ui_gettakes an optionalrepoforissue_types. User owners now work as described above.Prompts tested (tool changes only)
Covered by tool tests against mocked REST and GraphQL, not a live client:
hubot" as a different user (error asking forrepo)octocat/hello-world?"Security / limits
Owner-level calls still challenge for
read:org, even for a user owner, because the challenge can't tell the two apart from the arguments.ui_getissue_typeswithrepochallenges forrepoinstead.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
Regenerated the README and toolsnaps.