feat(monitor): upload native v1 episodes to Platform - #3231
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b36afc2. Configure here.
| if meta.off_policy_steps > self.max_off_policy_steps: | ||
| # The live version is about to become ``step``'s, so this dispatch will be one | ||
| # further behind than it is now. | ||
| if (self.policy.version + 1) - meta.policy_version > self.max_off_policy_steps: |
There was a problem hiding this comment.
Off-policy cancel one step early
High Severity
on_version_pending treats lag as (policy.version + 1) - policy_version, but the watcher already advances policy.version to the new step before this hook runs. That overstates lag by one and cancels groups that are still within max_off_policy_steps.
Reviewed by Cursor Bugbot for commit b36afc2. Configure here.
| stop_condition="error", | ||
| ) | ||
| await self.emit_episode(fallback_meta, group, [trace]) | ||
| await self.emit_episode(fallback_meta, group, vf.WireEpisode.model_construct(errors=[cancel])) |
There was a problem hiding this comment.
Cancel emits wrong episode type
High Severity
drop_group emits vf.WireEpisode cancel markers, while emit_failed_episodes correctly builds Episode. Downstream code relies on Episode APIs such as train_run, rollouts, and env_name, so off-policy cancels can fail before markers reach the sinks.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit b36afc2. Configure here.


Summary
Restores the focused native Episode upload change from #3217 after it was reverted from the episode-first-class stack. This PR contains the same implementation tree as the previously reviewed #3217.
Stacked on #3206, which changes Prime-RL orchestration and monitors to carry complete first-class Episodes. Once that foundation reaches
main, this PR can follow as the small upload layer.Upload contract
build_samples()helper so eval and training uploads share one projection contractinfo.native_wrapperinfo.native_trace_indexand flat summary fields for legacy Platform consumersStack