Skip to content

fix(agent): preserve multimodal content blocks in persist override (#44242) - #44371

Closed
kyssta-exe wants to merge 1 commit into
NousResearch:mainfrom
kyssta-exe:auto-fix/issue-44242
Closed

fix(agent): preserve multimodal content blocks in persist override (#44242)#44371
kyssta-exe wants to merge 1 commit into
NousResearch:mainfrom
kyssta-exe:auto-fix/issue-44242

Conversation

@kyssta-exe

Copy link
Copy Markdown
Contributor

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.

@liuhao1024

Copy link
Copy Markdown
Contributor

Reviewed this PR — the multimodal content merge logic in _apply_persist_user_message_override is correct and well-tested. The three content shapes (string→string, list→string with text block, list→string without text block) are all covered by the two test cases. No issues found.

@tonydwb tonydwb 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.

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)

@alt-glitch alt-glitch added type/bug Something isn't working comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint P3 Low — cosmetic, nice to have duplicate This issue or pull request already exists labels Jun 11, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of #44247 — same fix for #44242 (preserve multimodal content blocks in _apply_persist_user_message_override). #44247 is the canonical earliest-open PR (with #44248/#44249 already linked as dups).

@kyssta-exe

Copy link
Copy Markdown
Contributor Author

Duplicate of #44247 — same multimodal content block preservation fix (#44242). Closing as superseded.

@kyssta-exe kyssta-exe closed this Jun 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint duplicate This issue or pull request already exists P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ACP image content blocks dropped before API call (persist_user_message override clobbers multimodal content)

4 participants