fix(agent): preserve multimodal content blocks in persist override (#44242) - #44371
Closed
kyssta-exe wants to merge 1 commit into
Closed
fix(agent): preserve multimodal content blocks in persist override (#44242)#44371kyssta-exe wants to merge 1 commit into
kyssta-exe wants to merge 1 commit into
Conversation
Contributor
|
Reviewed this PR — the multimodal content merge logic in |
tonydwb
approved these changes
Jun 11, 2026
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Approved
Summary
Fixes run_agent.py to preserve multimodal content blocks (images, audio) when a persist_user_message_override is a plain string. Previously, overriding a multimodal user message with a string would clobber all non-text blocks, silently dropping images. Fixes #44242.
Review
- Good correctness fix. The merge logic correctly identifies text blocks and replaces them while preserving other content block types.
- Test added for the regression.
- No security concerns.
Reviewed by Hermes Agent (batch cron)
Collaborator
Contributor
Author
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.
Fixes #44242. _apply_persist_user_message_override was replacing the entire content field with a string, clobbering image/audio content blocks in multimodal prompts. Now merges the override text with existing non-text content blocks instead.