Repository navigation
fix: propagate cancellation to Actions log downloads - #3706
Open
flysheep-ai wants to merge 1 commit into
Open
flysheep-ai wants to merge 1 commit into
flysheep-ai wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The review records no active issues for the narrowly scoped change to cancel pending or streaming Actions log downloads.
No open issues 🎉
What changed in this PR
Updates Actions job-log downloads to honor request cancellation, stopping pending or streaming downloads while preserving the default HTTP client and existing log-tail behavior.
Changes:
- Binds log-download requests to the caller’s context.
- Adds cancellation tests for pre-request, header-waiting, and streaming scenarios.
- Preserves successful tail output and line-count behavior.
| File | Description |
|---|---|
pkg/github/actions.go |
Applies the caller’s context to Actions log-download requests. |
pkg/github/actions_log_cancellation_test.go |
Verifies cancellation behavior and preserves successful log-tail processing. |
Review effort: Lite (auto)
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
Use the request context when downloading Actions job logs, so canceled tool calls stop waiting for the download. Keep the existing default HTTP client and log-tail processing.
Why
Fixes #3705
downloadLogContentreceives the tool context but useshttp.Get, which creates an independent request. Cancelingget_job_logstherefore does not stop a download that is waiting for response headers or receiving a streaming response.What changed
http.NewRequestWithContextand execute it through the samehttp.DefaultClient.MCP impact
get_job_logsdownloads now honor cancellation; names, input/output schemas and successful log content are unchanged.Prompts tested (tool changes only)
Use case: “Get the last two log lines for an Actions job,” then cancel while the download is pending. Automated tests exercise the real download path against local HTTP servers and existing mocked Actions tool tests. No model-selected prompt or live GitHub API call was tested.
Security / limits
Tool renaming
deprecated_tool_aliases.goLint & tests
./script/lint— pinned golangci-lint2.14.0, 0 issues../script/test— all 30 test-bearing packages pass with the race detector.The three cancellation cases fail on the original code. All four new cancellation/success cases and adjacent Actions tests pass 20 repetitions with the race detector.
go test -v ./...,UPDATE_TOOLSNAPS=true go test ./...and documentation generation pass with no snapshot/generated-document changes.UI typecheck/build evidence is reused from the identical base and unchanged UI sources; actual generated assets are used. Its
npm auditreported four dependency findings (two low, two high) in unchanged dependencies. No dependencies were upgraded.Docs
script/generate-docsproduces no diff.OpenAI Codex assisted with implementation, tests and independent review.