Skip to content

feat(monitor): upload native v1 episodes to Platform - #3231

Closed
mrmoxon wants to merge 3 commits into
feat/episode-first-classfrom
feat/native-v1-prime-monitor
Closed

feat(monitor): upload native v1 episodes to Platform#3231
mrmoxon wants to merge 3 commits into
feat/episode-first-classfrom
feat/native-v1-prime-monitor

Conversation

@mrmoxon

@mrmoxon mrmoxon commented Aug 10, 2026

Copy link
Copy Markdown

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

  • call verifiers' public build_samples() helper so eval and training uploads share one projection contract
  • emit one Platform row per normal Episode
  • preserve the complete Episode in info.native_wrapper
  • retain info.native_trace_index and flat summary fields for legacy Platform consumers
  • preserve every trace, including fixed-agent and traceless/error cases
  • keep Prime-RL training fields such as run, step, environment, problem id, and advantage
  • retain the 25 MiB per-trace fallback for oversized Episodes
  • keep serialization best-effort so telemetry failures warn instead of aborting training

Stack

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ 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:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Fix in Cursor Fix in Web

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]))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit b36afc2. Configure here.

@mrmoxon
mrmoxon changed the base branch from main to feat/episode-first-class August 10, 2026 20:52
@mrmoxon mrmoxon closed this Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant