Description
pkg/parser/remote_fetch.go exposes 8 public functions with no context.Context parameter; their auth-fallback paths hard-code context.Background() (verified: exactly 7 occurrences on main). Nine pkg/cli/ callers already hold a cobra cmd.Context() but cannot pass it, so Ctrl-C does not cancel in-flight HTTP requests.
Public APIs missing ctx (verified present): DownloadFileFromGitHub (876), DownloadFileFromGitHubForHost (885), ResolveRefToSHAForHost (893), ListWorkflowFiles (1030), ListWorkflowFilesForHost (1036), ListDirAllFilesForHost (1095), ListDirAllFilesRecursivelyForHost (1208), ListDirSubdirsForHost (1354).
Fix: add ctx context.Context to the 8 public APIs, propagate through the private chain, replace the 7 context.Background() fallback sites, update the 9 CLI callers to pass cmd.Context(), and add a linter rule to prevent regression.
Expected Impact
Restores request cancellation on Ctrl-C and proper deadline propagation for all remote workflow fetches; removes a latent hang/leak class.
Suggested Agent
Copilot SWE Agent (well-scoped Go refactor).
Estimated Effort
Medium (1-4 hours).
Data Source
DeepReport Intelligence Briefing 2026-07-02; Repository Quality Report #42975. Claim grep-verified on main.
Generated by 🔬 Deep Report · 266.6 AIC · ⌖ 17.9 AIC · ⊞ 10.2K · ◷
Description
pkg/parser/remote_fetch.goexposes 8 public functions with nocontext.Contextparameter; their auth-fallback paths hard-codecontext.Background()(verified: exactly 7 occurrences onmain). Ninepkg/cli/callers already hold a cobracmd.Context()but cannot pass it, so Ctrl-C does not cancel in-flight HTTP requests.Public APIs missing
ctx(verified present):DownloadFileFromGitHub(876),DownloadFileFromGitHubForHost(885),ResolveRefToSHAForHost(893),ListWorkflowFiles(1030),ListWorkflowFilesForHost(1036),ListDirAllFilesForHost(1095),ListDirAllFilesRecursivelyForHost(1208),ListDirSubdirsForHost(1354).Fix: add
ctx context.Contextto the 8 public APIs, propagate through the private chain, replace the 7context.Background()fallback sites, update the 9 CLI callers to passcmd.Context(), and add a linter rule to prevent regression.Expected Impact
Restores request cancellation on Ctrl-C and proper deadline propagation for all remote workflow fetches; removes a latent hang/leak class.
Suggested Agent
Copilot SWE Agent (well-scoped Go refactor).
Estimated Effort
Medium (1-4 hours).
Data Source
DeepReport Intelligence Briefing 2026-07-02; Repository Quality Report #42975. Claim grep-verified on
main.