-
Notifications
You must be signed in to change notification settings - Fork 2
fix: eliminate double API call in analyze when file mode is on #63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,13 +36,13 @@ Use --no-files to skip writing graph files.`, | |
| if len(args) > 0 { | ||
| dir = args[0] | ||
| } | ||
| if err := analyze.Run(cmd.Context(), cfg, dir, opts); err != nil { | ||
| return err | ||
| } | ||
| if cfg.FilesEnabled() && !noFiles { | ||
| return files.Generate(cmd.Context(), cfg, dir, files.GenerateOptions{}) | ||
| // File mode: Generate handles the full pipeline (API call + | ||
| // cache + sidecars) in a single upload. Running analyze.Run | ||
| // first would duplicate the API call. | ||
| return files.Generate(cmd.Context(), cfg, dir, files.GenerateOptions{Force: opts.Force}) | ||
| } | ||
| return nil | ||
| return analyze.Run(cmd.Context(), cfg, dir, opts) | ||
|
Comment on lines
39
to
+45
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Skipping
🤖 Prompt for AI Agents |
||
| }, | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes the default
analyzepath serve stale results after the first run.files.Generateonly checks whether.supermodel/graph.jsonexists when--forceis false (internal/files/handler.go:50-81). It never fingerprints or hashes the current repo the wayanalyze.Rundoes (internal/analyze/handler.go:33-69). Easy repro: runanalyzeonce, edit any source file, run it again, and this branch will still reuse the old sidecar cache instead of analyzing the new repo. To keep the single-upload win, this path needs the same content-based cache validation before trusting.supermodel/graph.json.🤖 Prompt for AI Agents