-
Notifications
You must be signed in to change notification settings - Fork 562
Avoid redownloading cached runs during logs audit #61871
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 |
|---|---|---|
|
|
@@ -799,12 +799,13 @@ func normalizeCachedLogRun(run *RunData) error { | |
|
|
||
| // cachedJSONLCanSatisfy permits cached records only for the compact usage | ||
| // artifact, whose JSON includes the metadata required for cached reports. | ||
| // Parsing, auditing, training, and tool graphs require raw artifact files. | ||
| func cachedJSONLCanSatisfy(artifactFilter []string, parse, audit, train, toolGraph bool) bool { | ||
| return isUsageOnlyArtifactFilter(artifactFilter) && !parse && !audit && !train && !toolGraph | ||
| // Audit mode uses the available cached data on a best-effort basis. Parsing, | ||
| // explicit training, and tool graphs require raw artifact files. | ||
| func cachedJSONLCanSatisfy(artifactFilter []string, parse, train, toolGraph bool) bool { | ||
| return isUsageOnlyArtifactFilter(artifactFilter) && !parse && !train && !toolGraph | ||
| } | ||
|
|
||
| func processedRunFromCachedData(data RunData) ProcessedRun { | ||
| func processedRunFromCachedData(data RunData, audit *AuditData, outputDir string) ProcessedRun { | ||
| return ProcessedRun{ | ||
|
Contributor
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. [/codebase-design] 💡 SuggestionEither drop the parameter entirely (and update both call sites in @copilot please address this.
Contributor
Author
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. Fixed in |
||
| Run: WorkflowRun{ | ||
| DatabaseID: data.RunID, | ||
|
|
@@ -832,6 +833,7 @@ func processedRunFromCachedData(data RunData) ProcessedRun { | |
| MissingToolCount: data.MissingToolCount, | ||
| MissingDataCount: data.MissingDataCount, | ||
| SafeItemsCount: data.SafeItemsCount, | ||
| LogsPath: filepath.Join(outputDir, fmt.Sprintf("run-%d", data.RunID)), | ||
| }, | ||
| AwContext: data.AwContext, | ||
| TaskDomain: data.TaskDomain, | ||
|
|
@@ -840,5 +842,6 @@ func processedRunFromCachedData(data RunData) ProcessedRun { | |
| TokenUsage: data.TokenUsageSummary, | ||
| WorkingSet: data.WorkingSet, | ||
| cachedData: &data, | ||
| cachedAudit: audit, | ||
|
Contributor
Author
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. Fixed in |
||
| } | ||
| } | ||
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.
[/diagnosing-bugs]
processedRun.cachedData.AuditPathis set only on the pointer captured inside the per-run goroutine closure inwriteLogsAuditFiles— sincecachedDatais a*RunDatacopy taken atprocessedRunFromCachedDatatime and never propagated back into the JSONL rewrite path, this mutation has no observable effect (nothing reads it afterward on this path), which suggests dead code or a missing wiring step.💡 Suggestion
Trace where
cachedData.AuditPathis expected to be consumed (e.g. re-serialized into the cached JSONL viacachedLogsJSONLWriter). If nothing reads it, either remove the assignment or add the missing consumer plus a regression test asserting the cached JSONL record reflects the newly writtenAuditPathafter a best-effort audit run.@copilot please address this.
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.
Traced this and kept the assignment:
TestPrepareLogsDataAuditUsesCachedDataBestEffortfails without it becauseprepareLogsDataconsumes the updated cached record to expose the newly written audit path. No code removal was made.