Repository navigation
fix: address log limits, OAuth callbacks, job pagination, and CRLF icons - #3731
MauricioPerera wants to merge 1 commit into
Conversation
Bound and cancel Actions log downloads, cap retained log text, paginate failed jobs, reject unrelated OAuth callbacks without aborting login, and handle CRLF icon data. Add regression tests and document log limits.
|
Could a maintainer please approve the workflow runs for this fork PR using Approve workflows to run? All seven Actions workflows are currently awaiting maintainer approval ( Local validation passed: 8,584 tests and subtests across 30 packages, the full race-enabled suite, Thank you! |
There was a problem hiding this comment.
🟡 Changes recommended
The jobs pagination loop leaves PerPage unset, resulting in unnecessary API requests and rate-limit consumption for large matrix runs.
1 open issue
What changed in this PR
Improves the GitHub MCP Server’s log retrieval and OAuth reliability, while keeping embedded icon data consistent across platforms.
Changes:
- Add cancellable, time-limited Actions log downloads, bounded output, and failed-job pagination.
- Reject unrelated OAuth callbacks without terminating pending authorization.
- Normalize LF/CRLF icon inputs, add regression coverage, and document log limits.
| File | Description |
|---|---|
pkg/octicons/octicons.go |
Normalize line endings when parsing embedded icon data. |
pkg/octicons/octicons_test.go |
Cover LF and CRLF inputs with optional trailing newlines. |
pkg/github/actions.go |
Add download deadlines, shared log budgets, and job pagination. |
pkg/github/actions_regression_test.go |
Cover cancellation, deadlines, pagination, and combined output limits. |
pkg/buffer/buffer.go |
Bound retained log bytes and preserve UTF-8 during truncation. |
pkg/buffer/buffer_test.go |
Cover byte limits, ring rollover, and UTF-8 truncation. |
internal/oauth/callback.go |
Validate state before accepting callback results or provider errors. |
internal/oauth/callback_test.go |
Verify unrelated callbacks leave legitimate authorization available. |
docs/server-configuration.md |
Document download deadlines, truncation, and shared log limits. |
Review effort: Max (auto)
|
|
||
| // Filter for failed jobs | ||
| // Gather failures from every page before reporting that a run has none. | ||
| opts := &github.ListWorkflowJobsOptions{Filter: "latest"} |

Summary
Make Actions log downloads cancellable and bounded, keep unrelated OAuth callbacks from aborting login, retrieve failed jobs across every page, and normalize embedded icon data across Windows and Unix line endings.
Why
Log reads could continue after their MCP call was cancelled and retain excessive text. A run whose failed job appeared after the first page could incorrectly report no failures, and unrelated requests to the local OAuth callback could terminate a pending login. Windows CRLF checkouts also changed advertised icon data and broke tool-schema snapshot comparisons.
What changed
statebefore handling provider errors. Reject unrelated callbacks with HTTP 400 while keeping the legitimate authorization flow available.Add regression coverage for cancellation before and during downloads, deadlines, byte limits and ring-buffer rollover, UTF-8 truncation, shared multi-job budgets, pagination and later-page errors, unrelated OAuth callbacks followed by valid callbacks, and LF/CRLF icon inputs. Document the log limits in
docs/server-configuration.md.MCP impact
get_job_logsrespects cancellation and bounded output, and failed-only reads cover all pages. Tool names and input schemas remain the same.Prompts tested (tool changes only)
Validation used automated tool-handler and HTTP tests. The covered scenarios include retrieving a single job's log content, collecting all failed-job logs across pages, cancelling a pending download, and collecting enough log text to exhaust the response budget. Interactive natural-language prompts were not run.
Security / limits
Tool renaming
Lint & tests
Validated locally on Windows with Go 1.27.3, directly against the repository files without overlays or snapshot updates:
go test ./...: 8,584 tests and subtests passed across 30 packages with tests.go test -race ./...: all 30 tested packages passed; no races reported.-raceafter the final test response-cleanup adjustments.go vet ./...: passed.go run github.com/golangci/golangci-lint/v2/cmd/[email protected] run: 0 issues.go build ./cmd/github-mcp-serverwith an external output path: passed.gofmtandgit diff --check: passed.The embedded icon input still contained 64 CRLF line endings during validation, exercising the Windows checkout behavior.
Docs