Description
Four production retry/backoff code paths call time.Sleep directly with no context.Context to make the wait interruptible — a caller pressing Ctrl-C (or a cancelled parent context) cannot stop them mid-wait:
pkg/cli/run_workflow_tracking.go:73 — exponential-backoff poll loop in getLatestWorkflowRunWithRetry.
pkg/cli/trial_repository.go:199 — fixed trialRepoInitDelay sleep in ensureTrialRepository.
pkg/cli/update_extension_check.go:412 — retry-delay sleep in cleanupStaleWindowsBackups.
pkg/workflow/docker_validation.go:220 — the worst case: exponential backoff (waitTime *= 2) for Docker image pull retries inside validateDockerImage, which has no ctx parameter at all.
The -timesleepnocontext linter is enabled in CI (cgo.yml:1487,1490) specifically to catch this pattern, but it only flags functions that already take a context.Context parameter — none of these four functions do, so the linter has a structural blind spot and all four sites pass CI clean.
Expected Impact
Makes long-running CLI operations (workflow-run polling, trial-repo setup, extension cleanup, Docker image validation) actually respond to Ctrl-C / command cancellation instead of blocking for the full backoff duration — most visible on the Docker pull path, which can back off for tens of seconds per retry.
Suggested Agent
GitHub Copilot coding agent (thread a context.Context through each of the four call chains and replace time.Sleep with a select on ctx.Done() / a timer, or use an existing cancellable-sleep helper if one exists in pkg/cli/pkg/workflow).
Estimated Effort
Medium (1-4 hours) — four separate call sites, some requiring a ctx parameter to be plumbed through an existing call chain.
Data Source
DeepReport Intelligence Briefing — 2026-10-01, sourced from Repository Quality Improvement Report #64772 ("Uncancellable Sleep & Sleep-Based Test Synchronization"), all four sites live-verified by direct file read.
Generated by 🔬 Deep Report · claude · agent · 302 AIC · ⌖ 15.3 AIC · ⊞ 7.3K · ◷
Description
Four production retry/backoff code paths call
time.Sleepdirectly with nocontext.Contextto make the wait interruptible — a caller pressing Ctrl-C (or a cancelled parent context) cannot stop them mid-wait:pkg/cli/run_workflow_tracking.go:73— exponential-backoff poll loop ingetLatestWorkflowRunWithRetry.pkg/cli/trial_repository.go:199— fixedtrialRepoInitDelaysleep inensureTrialRepository.pkg/cli/update_extension_check.go:412— retry-delay sleep incleanupStaleWindowsBackups.pkg/workflow/docker_validation.go:220— the worst case: exponential backoff (waitTime *= 2) for Docker image pull retries insidevalidateDockerImage, which has noctxparameter at all.The
-timesleepnocontextlinter is enabled in CI (cgo.yml:1487,1490) specifically to catch this pattern, but it only flags functions that already take acontext.Contextparameter — none of these four functions do, so the linter has a structural blind spot and all four sites pass CI clean.Expected Impact
Makes long-running CLI operations (workflow-run polling, trial-repo setup, extension cleanup, Docker image validation) actually respond to Ctrl-C / command cancellation instead of blocking for the full backoff duration — most visible on the Docker pull path, which can back off for tens of seconds per retry.
Suggested Agent
GitHub Copilot coding agent (thread a
context.Contextthrough each of the four call chains and replacetime.Sleepwith aselectonctx.Done()/ a timer, or use an existing cancellable-sleep helper if one exists inpkg/cli/pkg/workflow).Estimated Effort
Medium (1-4 hours) — four separate call sites, some requiring a
ctxparameter to be plumbed through an existing call chain.Data Source
DeepReport Intelligence Briefing — 2026-10-01, sourced from Repository Quality Improvement Report #64772 ("Uncancellable Sleep & Sleep-Based Test Synchronization"), all four sites live-verified by direct file read.