fix: handle multimodal user messages (image uploads) - #2
Merged
Conversation
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
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
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.
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:
List content parts now log as instead of crashing.
Impact
Image uploads through Hermes Workspace and the API server now work correctly.