fix: context propagation in checkActorPermission already correctly implemented#18342
Closed
fix: context propagation in checkActorPermission already correctly implemented#18342
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix context propagation in checkActorPermission
fix: context propagation in checkActorPermission already correctly implemented
Feb 25, 2026
Copilot stopped work on behalf of
pelikhan due to an error
February 25, 2026 12:47
pelikhan
approved these changes
Feb 25, 2026
Contributor
|
Commit pushed:
|
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.
The issue requested that
checkActorPermissionbe updated to accept a caller context instead of creating a freshcontext.Background(), so permission checks respect request lifecycle cancellation.Findings
Upon investigation, the code in
pkg/cli/mcp_server_helpers.goalready implements the correct behavior:Both call sites in
mcp_tools_privileged.goalso already pass the tool handler'sctx:checkActorPermission(ctx, actor, validateActor, "logs")checkActorPermission(ctx, actor, validateActor, "audit")All acceptance criteria from the issue are satisfied in the current codebase — no functional changes were required.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/graphql/usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw main -lang=go1.25 git conf�� user.name Test User /usr/bin/git go1.25.0 -c=4 -nolocalimports git(http block)https://api.github.com/repos/actions/ai-inference/git/ref/tags/v1/usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq .object.sha t0 -tests(http block)https://api.github.com/repos/actions/checkout/git/ref/tags/v3/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq .object.sha agent-performance-analyzer.md(http block)https://api.github.com/repos/actions/checkout/git/ref/tags/v4/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v4 --jq .object.sha -bool on rkflow/js/**/*.json /../../.prettiergit erignore -nilfunc tail -30 runs/20260225-124350-6701/test-3958442218/.github/workflows -tests 6144936/b422/testutil.test l(http block)/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v4 --jq .object.sha 950325944/001 -buildtags /home/REDACTED/go/bin/node /../../.prettiergit -ifaceassert -nilfunc node /opt�� runs/20260225-124350-6701/test-2627550329/.github/workflows format:cjs /usr/sbin/sh(http block)/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v4 --jq .object.sha user.name Test User /usr/bin/git(http block)https://api.github.com/repos/actions/checkout/git/ref/tags/v5/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha 060413830/.github/workflows 523449/b030/vet.cfg cfg(http block)/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha v1.0.0(http block)/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha --show-toplevel 64/pkg/tool/linu--jq /usr/bin/git st.md st.lock.yml 64/pkg/tool/linu--show-toplevel git conf�� --get remote.origin.url /usr/bin/git(http block)https://api.github.com/repos/actions/github-script/git/ref/tags/v8/usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha(http block)/usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha -c=4 -nolocalimports -importcfg /tmp/go-build3076144936/b402/importcfg -pack /home/REDACTED/work/gh-aw/gh-aw/pkg/logger/example_test.go x_amd64/vet(http block)/usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha ath ../../../.pr**/*.json(http block)https://api.github.com/repos/actions/setup-go/git/ref/tags/v4/usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq .object.sha ormatted successfully" build_command_test.go /opt/hostedtoolcache/go/1.25.0/x64/bin/gofmt /../../.prettiergit -ifaceassert -nilfunc /opt/hostedtoolcache/go/1.25.0/x64/bin/gofmt -l -w pkg/workflow/create_pull_request_cross_repo_integration_test.go ache/go/1.25.0/x64/pkg/tool/linux_amd64/compile pkg/workflow/cregit pkg/workflow/cusrev-parse run-script/lib/n--show-toplevel ache/go/1.25.0/x64/pkg/tool/linux_amd64/compile(http block)https://api.github.com/repos/actions/setup-node/git/ref/tags/v4/usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq .object.sha -unreachable=false on .cfg /../../.prettiergit erignore(http block)https://api.github.com/repos/github/gh-aw/actions/runs/1/artifacts/usr/bin/gh gh run download 1 --dir test-logs/run-1 .go x_amd64/compile(http block)/usr/bin/gh gh run download 1 --dir test-logs/run-1 /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linu-goversion /usr/bin/git ascoGIyFT /tmp/go-build253rev-parse k/gh-aw/gh-aw/no--show-toplevel git rev-�� --show-toplevel ortcfg /usr/bin/git g/repoutil/repougit g/repoutil/repouconfig x_amd64/compile git(http block)https://api.github.com/repos/github/gh-aw/actions/runs/12345/artifacts/usr/bin/gh gh run download 12345 --dir test-logs/run-12345 cfg x_amd64/compile(http block)/usr/bin/gh gh run download 12345 --dir test-logs/run-12345 /opt/hostedtoolcache/go/1.25.0/xTest User /usr/bin/git vaScript31655067git /tmp/go-build253-C .cfg git rev-�� --show-toplevel /opt/hostedtoolcache/go/1.25.0/x12345 /usr/bin/git te '../../../**/git /tmp/go-build253rev-parse ache/go/1.25.0/x--show-toplevel git(http block)https://api.github.com/repos/github/gh-aw/actions/runs/12346/artifacts/usr/bin/gh gh run download 12346 --dir test-logs/run-12346 cfg x_amd64/vet(http block)/usr/bin/gh gh run download 12346 --dir test-logs/run-12346 /opt/hostedtoolcache/go/1.25.0/xtest@example.com e/git pYLQS4wXJ -buildtags e_modules/.bin/s--git-dir e/git rev-�� --show-toplevel ortcfg /opt/hostedtoolcache/node/24.13.0/x64/bin/npm g/mathutil/mathugit g/mathutil/mathurev-parse ache/go/1.25.0/x--show-toplevel /opt/hostedtoolcache/node/24.13.0/x64/bin/npm(http block)https://api.github.com/repos/github/gh-aw/actions/runs/2/artifacts/usr/bin/gh gh run download 2 --dir test-logs/run-2 cfg x_amd64/link(http block)/usr/bin/gh gh run download 2 --dir test-logs/run-2 /opt/hostedtoolcache/go/1.25.0/xremote.origin.url /usr/bin/git Gz_Wa5yJE /tmp/go-build253-C k/gh-aw/node_mod/tmp/gh-aw-test-runs/20260225-124541-10732/test-3410186992 git rev-�� --show-toplevel /opt/hostedtoolcache/go/1.25.0/x2 /usr/bin/git te '../../../**/git stmain.go x_amd64/link git(http block)https://api.github.com/repos/github/gh-aw/actions/runs/3/artifacts/usr/bin/gh gh run download 3 --dir test-logs/run-3 cfg 64/pkg/tool/linux_amd64/link(http block)/usr/bin/gh gh run download 3 --dir test-logs/run-3 3BG4Hm-/QjVgNoQeiTwDF7dlXq91 /usr/bin/git te '**/*.cjs' '*git /tmp/go-build253-C g_.a git rev-�� --show-toplevel /opt/hostedtoolcache/go/1.25.0/x3 /usr/bin/git te '../../../**/git /tmp/go-build253rev-parse x_amd64/vet git(http block)https://api.github.com/repos/github/gh-aw/actions/runs/4/artifacts/usr/bin/gh gh run download 4 --dir test-logs/run-4 cfg x_amd64/vet(http block)/usr/bin/gh gh run download 4 --dir test-logs/run-4 /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linu^remote\..*\.gh-resolved$ /usr/bin/git 4350-6701/test-4git /tmp/go-build253reset e_modules/.bin/sHEAD git rev-�� --show-toplevel /opt/hostedtoolcache/go/1.25.0/x4 /usr/bin/git te '../../../**/git /tmp/go-build253rev-parse ache/go/1.25.0/x--show-toplevel git(http block)https://api.github.com/repos/github/gh-aw/actions/runs/5/artifacts/usr/bin/gh gh run download 5 --dir test-logs/run-5 cfg x_amd64/compile =fetch(http block)/usr/bin/gh gh run download 5 --dir test-logs/run-5 wE6G5vac4MzNj/m0rBUtpV4gL8Qs7FDacz/1Yeg6_QYy6k49/tmp/go-build3076144936/b113/vet.cfg /usr/bin/git 4350-6701/test-4git /tmp/go-build253checkout .cfg git rev-�� ]*:[[:space:]]*"(create_pull_request|push_to_pull_request_branch)" /opt/hostedtoolcache/go/1.25.0/x5 /opt/hostedtoolcache/node/24.13.0/x64/bin/npm te '../../../**/git /tmp/go-build253rev-parse ache/go/1.25.0/x--show-toplevel /opt/hostedtoolcache/node/24.13.0/x64/bin/npm(http block)https://api.github.com/repos/github/gh-aw/actions/workflows/usr/bin/gh gh workflow list --json name,state,path(http block)/usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --workflow nonexistent-workflow-12345 --limit 100(http block)/usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --workflow nonexistent-workflow-12345 --limit 6(http block)https://api.github.com/repos/github/gh-aw/git/ref/tags/v1.0.0/usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq .object.sha(http block)https://api.github.com/repos/nonexistent/action/git/ref/tags/v999.999.999/usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq .object.sha(http block)https://api.github.com/repos/nonexistent/repo/actions/runs/12345/usr/bin/gh gh run view 12345 --repo nonexistent/repo --json status,conclusion(http block)/usr/bin/gh gh run view 12345 --repo nonexistent/repo --json status,conclusion -bool -buildtags e_modules/.bin/n--show-toplevel git rev-�� --show-toplevel /opt/hostedtoolcache/go/1.25.0/x12345 /usr/bin/git -bool on .cfg git(http block)https://api.github.com/repos/owner/repo/actions/workflows/usr/bin/gh gh workflow list --json name,state,path --repo owner/repo x_amd64/vet(http block)/usr/bin/gh gh workflow list --json name,state,path --repo owner/repo /usr/bin/git -errorsas -ifaceassert -nilfunc git rev-�� --show-toplevel -tests /usr/bin/git 958442218/.githugit --local x_amd64/vet git(http block)/usr/bin/gh gh workflow list --json name,state,path --repo owner/repo /usr/bin/git -test.timeout=10git -test.run=^Test -test.short=true--show-toplevel git rev-�� --show-toplevel 64/bin/gofmt /usr/bin/git se o(http block)https://api.github.com/repos/owner/repo/contents/file.md/tmp/go-build3076144936/b381/cli.test /tmp/go-build3076144936/b381/cli.test -test.testlogfile=/tmp/go-build3076144936/b381/testlog.txt -test.paniconexit0 -test.v=true -test.parallel=4 -test.timeout=10m0s -test.run=^Test -test.short=true(http block)/tmp/go-build1233883517/b001/cli.test /tmp/go-build1233883517/b001/cli.test -test.paniconexit0 -test.timeout=10m0s -test.count=1 remo�� -v 64/pkg/tool/linux_amd64/vet /usr/bin/git ../pkg/workflow/git cfg ache/go/1.25.0/x--show-toplevel git rev-�� --show-toplevel ache/go/1.25.0/xtest@example.com /usr/bin/git se 523449/b007/vet.rev-parse tions/setup/node--show-toplevel git(http block)https://api.github.com/repos/test-owner/test-repo/actions/secrets/usr/bin/gh gh api /repos/test-owner/test-repo/actions/secrets --jq .secrets[].name(http block)/usr/bin/gh gh api /repos/test-owner/test-repo/actions/secrets --jq .secrets[].name test/race-image:v1.0.0 64/pkg/tool/linuconfig /usr/bin/infocmp(http block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.
✨ PR Review Safe Output Test - Run 22397346878