Skip to content

test: cover BaseMessage content builders and image base64 encoding - #23

Open
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1789677901-test-basemessage-content-builders
Open

devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1789677901-test-basemessage-content-builders

Conversation

@devin-ai-integration

Copy link
Copy Markdown

Summary

Closes a code-scan coverage gap: BaseMessage.add_content/add_text/add_image and Discussion.add_image had no tests, so the string→list content promotion and the base64 image URL construction that feed vision-agent prompts could regress silently (malformed or dropped screenshots surface as a quality drop, not an error). Only merge() was tested.

Tests added in tests/llm/test_llm_utils.py, in the style of the existing merge tests:

  • add_text on a string-bodied message promotes it to [{type: text, ...}, {type: text, ...}]; add_content appends to an already-list body.
  • add_image with a str passes the URL through (and attaches detail when given).
  • add_image with a PIL image and with an ndarray (parametrized) yields data:image/jpeg;base64,...; the payload is decoded and reopened to assert it is a real JPEG of the original size.
  • Discussion.add_image mutates only the last message.

Devin-Org: engineering

Link to Devin session: https://app.devin.ai/sessions/bf387a97923c43d5843ab8af74cfa268
Open in Devin Desktop: https://app.devin.ai/desktop/session/bf387a97923c43d5843ab8af74cfa268?variant=devin

@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

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.

0 participants