batch: scan trace dirs recursively so --continue actually resumes - #14
Merged
icexiaoche merged 1 commit intoJul 31, 2026
Merged
Conversation
_scan_completed_trials and _load_trial_results glob <trace_dir>/*.jsonl, but --cli-only writes traces two levels down at <trace_dir>/<phase>/<task>/<trace>.jsonl. The scan finds nothing, so --continue concludes no trial ever completed and silently re-runs the entire suite, and batch_results.json / batch_summary.json come out empty. Both call sites use rglob.
Collaborator
|
Thank you so much for your interest in our project and for taking the time to debug these! We sincerely apologize that our codebase wasn't as polished as it should have been, and we're especially sorry for the 12M tokens you had to burn through because of this bug! We are actively working on optimizing the code to improve efficiency and reliability moving forward. Thanks again for your valuable contribution! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Two functions scan a trace directory with a non-recursive glob:
cli.py#L1082—_scan_completed_trials, which backs--continuecli.py#L1112—_load_trial_results, whose docstring says "This allows merging with new results when using--continue"But a benchmark-suite run (
--cli-only, or any--tasks-dirrun through_run_benchmark_suite) writes traces two levels down:so
trace_dir.glob("*.jsonl")matches nothing.Consequences
--continuesilently re-runs the entire suite. It finds zero completed trials and concludes nothing was ever done. There is no error — from the outside it is indistinguishable from normal progress.batch_results.json/batch_summary.jsoncome out empty for the same runs, since_load_trial_resultsuses the same glob.The first one is expensive with a metered model. Resuming a 150-task run that was 110 done re-ran 67 already-finished tasks against a paid API before we noticed — roughly 12M input tokens for nothing. We only caught it because unique
task_ids stayed at 110 whilegrading_resultevents climbed past 170.Reproduce
Before:
Running 100 tasks ...— the full suite again.After:
Running 2 tasks ... / Running 38 tasks ...— only what is actually left.Direct check:
Fix
rglobat both call sites. For a flat trace dir (singlerunoutput)rglobis equivalent, so the single-task path is unaffected.Environment
--trial-in-container)batch --cli-only --benchmark-root ./benchmarkf9a0f63and currentmain(e19dce2)