fix(rollout): clear stale LLM trajectory on rollout reuse - #1094
Open
zhiheng-yang wants to merge 1 commit into
Open
fix(rollout): clear stale LLM trajectory on rollout reuse#1094zhiheng-yang wants to merge 1 commit into
zhiheng-yang wants to merge 1 commit into
Conversation
zhiheng-yang
marked this pull request as ready for review
September 3, 2026 23:06
Contributor
There was a problem hiding this comment.
🔍 Devin Review: 1 flag
Not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)
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
_init_rollout()can be called with explicit job and rollout names, so the target directory may already exist.In that case, an old
trajectory/llm_trajectory.jsonlis left in place.Usually live capture replaces the file after the first completed model call.
If the new run fails before then, nothing overwrites it.
Training export and artifact inspection can then read the previous run's trajectory as if it came from the current attempt.
I reproduced this by initializing the same rollout path twice and placing a trajectory in between.
After the second initialization:
main:stale_exists=Truestale_exists=FalseChange
Remove this one attempt-owned file when the rollout directory is initialized.
The rest of the directory is left alone, and the separate continue-run flow is unchanged.
src/benchflow/rollout/_setup.pyremoves the stale trajectory.tests/test_sdk_internals.pycovers reuse of the same rollout path.Tests
uv run pytest -q tests/test_sdk_internals.pyResult:
51 passed.