Feat: Add base64 image support for results.#885
Feat: Add base64 image support for results.#885d42me wants to merge 1 commit intoPrimeIntellect-ai:mainfrom
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.
| results_path: Path | None = None, | ||
| state_columns: list[str] | None = None, | ||
| save_results: bool = False, | ||
| image_mode: str = ImageMode.BASE64.value, |
There was a problem hiding this comment.
Default image mode breaks existing non-data-URI callers
Medium Severity
The public API methods generate, evaluate, evaluate_sync, run_rollout, and run_group all default image_mode to ImageMode.BASE64, while the lower-level utilities state_to_output and states_to_outputs default to ImageMode.PLACEHOLDER. The BASE64 default means existing callers — like verifiers/gepa/adapter.py which calls generate() without image_mode — will now fail with a ValueError if any prompt contains an image_url with an HTTPS URL (not a data URI), since _extract_data_uri_base64 requires data: URIs. Before this change, all images were silently replaced with [image]. The eval CLI path correctly overrides this to PLACEHOLDER when save_results is false, but the public Python API does not.
Additional Locations (2)
There was a problem hiding this comment.
@willccbb What do you think here? Can we introduce this breaking change for better DX? Or should we stay with the default placeholder?


Description
Add base64 image store support for results
Type of Change
Testing
uv run pytestlocally.Checklist
Note
Medium Risk
Touches the core output-serialization and evaluation plumbing (including worker RPC types), so regressions could affect saved datasets or server-mode evaluations; changes are guarded by explicit modes and covered by new tests.
Overview
Adds an opt-in path to persist images in saved eval results by extracting
data:image/*;base64,...payloads into a per-messageimagesfield while still rendering[image]placeholders incontent.Plumbs
save_image_mode/image_modeandmax_image_base64_charsthroughevalCLI/config,Environment/EnvGroupgeneration, and worker client/server request types; metadata now recordssave_image_mode, and saving defaults toplaceholderwhensave_resultsis off.Hardens message serialization by validating data-URI base64 and size limits, and updates
sanitize_tool_callsto preserve already-serialized tool-call strings and other message fields; new tests cover base64 extraction, limit enforcement, CLI saving, and sanitization behavior.Written by Cursor Bugbot for commit a36c44d. This will update automatically on new commits. Configure here.