Skip to content

fix: hide write UI resources in read-only mode - #2581

Closed
he-yufeng wants to merge 1 commit into
github:mainfrom
he-yufeng:fix/read-only-ui-resources-v3
Closed

fix: hide write UI resources in read-only mode#2581
he-yufeng wants to merge 1 commit into
github:mainfrom
he-yufeng:fix/read-only-ui-resources-v3

Conversation

@he-yufeng

Copy link
Copy Markdown
Contributor

Summary

  • pass the server read-only setting into MCP App UI resource registration
  • keep the read-only get_me_ui resource available
  • skip issue_write_ui and pr_write_ui when write tools are filtered by --read-only

Fixes#2519.

To verify

  • go test ./pkg/github -run "TestRegisterUIResources_ReadOnlySkipsWriteResources|TestRegisterUIResources_ReadableViaClient|TestNewMCPServer_RegistersUIResources" -count=1
  • go test ./pkg/github -count=1
  • git diff --check

@he-yufeng
he-yufeng requested a review from a team as a code ownerMay 30, 2026 18:30
@he-yufeng

Copy link
Copy Markdown
ContributorAuthor

Validated the current branch locally after closing the superseded #2574:

go test ./pkg/github -run UIResources
git diff --check origin/main...HEAD

@he-yufeng
he-yufengforce-pushed the fix/read-only-ui-resources-v3 branch from 09ccbeb to b8743edCompareMay 31, 2026 19:37
@he-yufeng

Copy link
Copy Markdown
ContributorAuthor

Rebased on current main in b8743ed.

Validation:

  • go test ./pkg/github -run UIResources
  • git diff --check origin/main...HEAD

@he-yufeng
he-yufengforce-pushed the fix/read-only-ui-resources-v3 branch from b8743ed to f8934bdCompareJune 2, 2026 19:39
@he-yufeng

Copy link
Copy Markdown
ContributorAuthor

Rebased on current main and reran the targeted validation locally.

Validated:

gofmt -w $(git diff --name-only origin/main...HEAD |Where-Object { $_-like'*.go' })
go test ./pkg/github -run UIResources
go test ./pkg/github
git diff --check origin/main...HEAD

All passed after the rebase.

@he-yufeng

Copy link
Copy Markdown
ContributorAuthor

Closing this older duplicate branch in favor of #2612, which carries the same read-only UI resources fix on the newer replacement branch. Keeping only #2612 avoids splitting review across two identical PRs.

Sign up for freeto 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.

MCP App UI resources for write tools are registered in --read-only mode

1 participant

@he-yufeng