All-Hands-AI / OpenHands

🙌 OpenHands: Code Less, Make More
https://all-hands.dev
MIT License
34.11k stars 3.89k forks source link

[Bug]: Images (base64encoded) are fully logged in Event output #4388

Open tobitege opened 3 weeks ago

tobitege commented 3 weeks ago

Is there an existing issue for the same bug?

Describe the bug and reproduction steps

/openhands/events/action/message.py -> __str__ outputs full images, thus massively spamming logs

OpenHands Installation

Development workflow

OpenHands Version

No response

Operating System

WSL on Windows

Logs, Errors, Screenshots, and Additional Context

example

19:56:27 - openhands:INFO: agent_controller.py:253
USER_ACTION
**MessageAction** (source=EventSource.USER)
CONTENT: which kind of animals are in the image?
IMAGE_URL: iVBORw0KGgoAAAANSUhEUgAAAhQAAALQCAYAAADIA+lHAAEAAElEQVR42uydd5iU1fn3P2fqzvbCFsqCFCnSBEQFRAQFI1aw914SW6LR10SNPcbEGNvPiBo7KgoWVKQoKL33
... hundreds of KB's/MB's! ...

Despite there being unit tests in test_message_serialization.py, which uses URI's (http://...), I don't think these are used anywhere.

mamoodi commented 4 days ago

Would this have been resolved with all the logging changes that went in recently?

tobitege commented 4 days ago

Would this have been resolved with all the logging changes that went in recently?

I'd like to verify, but can't even upload a small image without errors in main.