Skip to content

fix: handle multimodal user messages (image uploads) - #2

Merged
outsourc-e merged 1 commit into
mainfrom
fix/multimodal-user-message
Apr 14, 2026
Merged

fix: handle multimodal user messages (image uploads)#2
outsourc-e merged 1 commit into
mainfrom
fix/multimodal-user-message

Conversation

@outsourc-e

Copy link
Copy Markdown
Owner

Bug

Sending images through the Workspace UI or API crashes with:

When contains multimodal content (text + image_url parts), it arrives as a list instead of a string. Two logging lines in assumed it was always a string.

Fix

Check before string operations at:

  • Line 6990: message preview for logger
  • Line 7049: conversation start print

List content parts now log as instead of crashing.

Impact

Image uploads through Hermes Workspace and the API server now work correctly.

When user_message is a list of content parts (e.g. text + image_url
for multimodal input), the logging code crashed with:
  AttributeError: 'list' object has no attribute 'replace'

Fixed two places that assumed user_message is always a string:
- Line 6990: message preview for logger
- Line 7049: conversation start print

Both now check isinstance(user_message, str) and handle list content
parts gracefully.
@outsourc-e
outsourc-e merged commit cf66f51 into main Apr 14, 2026
5 of 6 checks passed
outsourc-e pushed a commit that referenced this pull request May 24, 2026
… contract

Three test classes lock in the NousResearch#30963 fix:

1. TestPartialStreamStubFinishReason — drives _interruptible_streaming_api_call
   through the two recovery branches and asserts:
     - text-only partial → finish_reason="length" (the new behaviour),
     - mid-tool-call partial → finish_reason="stop" (unchanged on purpose).

2. TestLengthContinuationPromptBranching — pure-Python check on the branch
   that picks the continuation prompt by response.id. Locks the network
   error wording for partial-stream-stub vs. the output-length wording
   for everything else.

3. TestConversationLoopPartialStreamContinuation — feeds a stub +
   continuation pair into run_conversation, verifies the loop makes a
   second API call (instead of exiting with text_response(stop)),
   confirms the network-error continuation prompt actually reaches the
   model on call #2, and that final_response stitches both halves.

Refs: NousResearch#30963
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