Inline local rollout images in PrimeMonitor samples#2679
Open
mrmoxon wants to merge 6 commits into
Open
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 3ccf1a6. Configure here.
samsja
reviewed
Jun 3, 2026
samsja
reviewed
Jun 3, 2026
samsja
reviewed
Jun 3, 2026
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.

Summary
file://image references in PrimeMonitor rollout samples back intodata:image/...;base64,...URLs before writing the sample Parquet.offload_images_to_disk()emit absolute file URIs viaPath.as_uri(), so relativeoutput_dirconfigs do not produce malformedfile://outputs/...URLs.data:image/pngwith mismatched bytes.Why
offload_images_to_disk()rewrites inline multimodal images to local paths under the orchestrator output directory, e.g.file:///data/outputs/.../assets/images/.... That is fine inside the training pod, but those paths are later stored in PrimeMonitor sample Parquet. The hosted dashboard only sees thatfile://pointer and cannot load the image from a browser.Inlining small local images during PrimeMonitor serialization keeps future uploaded samples browser-renderable without adding a new backend artifact upload/signed URL path.
Validation
uvx ruff check src/prime_rl/orchestrator/trajectories.py src/prime_rl/utils/monitor/prime.pyuvx ruff format --check src/prime_rl/orchestrator/trajectories.py src/prime_rl/utils/monitor/prime.pyuv run --no-sync python -m py_compile src/prime_rl/orchestrator/trajectories.py src/prime_rl/utils/monitor/prime.pygit diff --name-status origin/main...HEADonly lists production files undersrc/.root@95.133.252.95at current head: ruff check/format and py_compile passed for touched production files.root@95.133.252.95: custom offload → PrimeMonitor Parquet smoke passed for relative output dirs, monitor non-mutation, completion image inlining, and >2 MiB image skip behavior.root@95.133.252.95: real-image MIME smoke verified PNG staysdata:image/pngand JPEG staysdata:image/jpegafter offload → PrimeMonitor Parquet serialization.root@95.133.252.95: live platform E2E with image sample upload passed via real PrimeMonitor registration, sample presign, R2 PUT, confirm, and final summary; uploaded Parquet bytes were asserted to containdata:image/png;base64,...and nofile://reference. Run id:yg12nqyecvzfdcyaokiscgb2.root@95.133.252.95: realistic live platform E2E passed withrun_config.max_steps=20for 20 steps × 5 image rollouts/step. API verification showedmaxSteps=20,stepsWithSamples=[0..19],total=100samples, and sampled prompts containdata:image/png;base64,...with nofile://. Run id:j66iit3cb0vlyb93v12kxhx6.root@95.133.252.95at current head: real renderable PNG/JPEG live platform E2E passed withrun_config.max_steps=10for 10 steps × 4 image rollouts/step. API verification showedmaxSteps=10,stepsWithSamples=[0..9], step 9 has 4 decoded valid 96×64 PNG/JPEG samples with matchingdata:image/png/data:image/jpegmedia types and nofile://. Run id:e9l2830u8xfydm0rh5oyp0gg.Note
Low Risk
Changes are limited to image offload paths and PrimeMonitor sample serialization, with a 2 MiB inline cap and no training or auth logic touched.
Overview
Rollout image offloading now writes files with the correct extension from the source
data:image/...media type (not always.png), dedupes by full on-disk path, and stores absolutefile://URIs viaPath.resolve().as_uri()so relative output dirs do not produce broken references.PrimeMonitor sample Parquet serialization recursively re-embeds eligible local
file://image URLs in prompt, completion, and trajectory JSON asdata:image/...;base64,...(without mutating in-memory rollouts), with per-URL caching and a 2 MiB per-image inline cap so the hosted dashboard can render images while large artifacts stay as file pointers.Reviewed by Cursor Bugbot for commit 27ec93d. Bugbot is set up for automated code reviews on this repo. Configure here.