Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion verifiers/v1/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,8 @@ def _commit_turn(turn: PendingTurn, response: Response) -> None:
sampled=True,
token_ids=[*gen_prompt, *comp_ids],
mask=[False] * len(gen_prompt) + [True] * len(comp_ids),
logprobs=list(tokens.completion_logprobs) if tokens else [],
# TurnTokens is discarded after commit, so transfer its logprobs without copying.
logprobs=tokens.completion_logprobs if tokens else [],

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Detach logprobs before committing the trace

When a caller keeps or reuses the Response/TurnTokens object after commit(), this stores the same mutable completion_logprobs list on the long-lived trace. Any later normalization, clearing, or buffer reuse by a custom train client mutates trace.nodes[-1].logprobs, and Branch.logprobs/trace dumps will then report corrupted training logprobs; the previous list(...) copy isolated committed graph state from the transient response object.

Useful? React with 👍 / 👎.

finish_reason=response.finish_reason,
usage=response.usage,
)
Expand Down
Loading