From 05dee68bfcc36220158ce3f9f1f35255071f4c86 Mon Sep 17 00:00:00 2001 From: "claude[bot]" <41898282+claude[bot]@users.noreply.github.com> Date: Fri, 27 Feb 2026 10:23:48 +0000 Subject: [PATCH] fix: cancel in-flight GetCircularDependencies request when GetGraph fails Derive a cancellable context at the top of fetchGraphWithCircularDeps and use defer cancel() so that the in-flight HTTP request to the circular- dependencies API endpoint is aborted as soon as GetGraph returns an error, avoiding wasted network bandwidth and API quota. Fixes #78 Co-Authored-By: Grey Newell Co-Authored-By: Claude Sonnet 4.6 Co-authored-by: claude[bot] --- cmd/run.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/run.go b/cmd/run.go index f52b623..1679f7e 100644 --- a/cmd/run.go +++ b/cmd/run.go @@ -268,6 +268,9 @@ func fetchGraphWithCircularDeps( repoZip []byte, logFn func(string, ...interface{}), ) (*api.ProjectGraph, error) { + ctx, cancel := context.WithCancel(ctx) + defer cancel() + type graphResult struct { graph *api.ProjectGraph err error