disinguish is_truncated and log stop_conditions#2009
Merged
Conversation
samsja
approved these changes
Mar 10, 2026
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Generation truncated metric may never exclude prompt_too_long
- Removed the broken generation_truncated metric that filtered on non-existent 'prompt_too_long' stop_condition value; the PR still logs actual stop_condition values via the dict comprehension.
Or push these changes by commenting:
@cursor push e3393b3f68
Preview (e3393b3f68)
diff --git a/src/prime_rl/orchestrator/orchestrator.py b/src/prime_rl/orchestrator/orchestrator.py
--- a/src/prime_rl/orchestrator/orchestrator.py
+++ b/src/prime_rl/orchestrator/orchestrator.py
@@ -667,10 +667,7 @@
"is_truncated/mean": results_df.groupby("example_id").is_truncated.mean().mean(),
"is_truncated/max": results_df.groupby("example_id").is_truncated.mean().max(),
"is_truncated/min": results_df.groupby("example_id").is_truncated.mean().min(),
- "stop_condition/generation_truncated": (
- results_df.is_truncated & (results_df.stop_condition != "prompt_too_long")
- ).mean(),
- # Log rate of each stop condition (e.g. max_turns, prompt_too_long, has_error)
+ # Log rate of each stop condition (e.g. gibberish, repetition)
**{
f"stop_condition/{sc}": rate
for sc, rate in results_df.stop_condition.dropna().value_counts(normalize=True).items()This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.
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.

is_truncatedintooverlong_promptandgeneration_truncationwhere it was lumped together previouslystop_conditions to wandb loggingNote
Low Risk
Logging-only changes that add new metrics/columns without altering rollout generation or training behavior.
Overview
Adds
stop_conditionto the per-rolloutresults_dfand emits new W&B metrics that break down truncation into generation truncation vsprompt_too_long.Also logs the normalized rate of each observed
stop_conditionvalue (e.g.max_turns,has_error) to make rollout termination causes visible in monitoring.Written by Cursor Bugbot for commit 48ff293. This will update automatically on new commits. Configure here.