Description
The Repository Quality Report (discussion #43796) found checkAndWaitForRateLimit in pkg/cli/logs_rate_limit.go uses 4 bare time.Sleep calls and can block for up to ~60 minutes waiting for a GitHub API rate-limit reset — uncancellable by Ctrl-C. Its only caller DownloadWorkflowLogs(ctx) already holds a context. The existing timesleepnocontext linter misses it because the function omits the ctx parameter entirely.
What to do
Add ctx context.Context as the first parameter to checkAndWaitForRateLimit (and fetchRateLimit if needed). Replace each time.Sleep(d) with:
timer := time.NewTimer(d)
select { case <-timer.C: case <-ctx.Done(): timer.Stop(); return ctx.Err() }
Update the call site at pkg/cli/logs_orchestrator.go:370 to pass activeCtx. Verify with make agent-report-progress.
Expected Impact
Makes the longest uncancellable blocking path in the CLI respond to cancellation; improves interactive UX and clean shutdown.
Suggested Agent
Copilot SWE Agent (well-scoped Go change with acceptance criteria).
Estimated Effort
Medium (1-4 hours)
Data Source
DeepReport Intelligence Briefing 2026-07-06; source discussion #43796 (Repository Quality Report), Task 1.
Generated by 🔬 Deep Report · 204.6 AIC · ⌖ 17.5 AIC · ⊞ 10.2K · ◷
Description
The Repository Quality Report (discussion #43796) found
checkAndWaitForRateLimitinpkg/cli/logs_rate_limit.gouses 4 baretime.Sleepcalls and can block for up to ~60 minutes waiting for a GitHub API rate-limit reset — uncancellable by Ctrl-C. Its only callerDownloadWorkflowLogs(ctx)already holds a context. The existingtimesleepnocontextlinter misses it because the function omits thectxparameter entirely.What to do
Add
ctx context.Contextas the first parameter tocheckAndWaitForRateLimit(andfetchRateLimitif needed). Replace eachtime.Sleep(d)with:Update the call site at
pkg/cli/logs_orchestrator.go:370to passactiveCtx. Verify withmake agent-report-progress.Expected Impact
Makes the longest uncancellable blocking path in the CLI respond to cancellation; improves interactive UX and clean shutdown.
Suggested Agent
Copilot SWE Agent (well-scoped Go change with acceptance criteria).
Estimated Effort
Medium (1-4 hours)
Data Source
DeepReport Intelligence Briefing 2026-07-06; source discussion #43796 (Repository Quality Report), Task 1.