Content-Length: 278924 | pFad | https://github.com/All-Hands-AI/OpenHands/pull/10454

9C fix(openrouter): Force string serialization for openrouter/anthropic/claude-sonnet-4 model by suixinio · Pull Request #10454 · All-Hands-AI/OpenHands · GitHub
Skip to content

Conversation

suixinio
Copy link
Contributor

  • This change is worth documenting at https://docs.all-hands.dev/
  • Include this change in the Release Notes. If checked, you must provide an end-user friendly description for your change below

  • The Issue:
    API requests were failing with the validation error: messages.1.content.0.text.text: Input should be a valid string.

Copy link
Collaborator

@enyst enyst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @suixinio !

Could you please tell, did it happen multiple times or how were you running OpenHands?

I’m slightly surprised if OpenRouter doesn’t support lists, I… wonder why we didn’t encounter the error before 🤔

@suixinio
Copy link
Contributor Author

Hi, @enyst !

Thanks for the quick reply!

Yes, it's a consistent issue that I can reproduce reliably. I've attached my environment details and some screenshots below to help.

To be honest, I was just as surprised as you are! I also searched through the docs for litellm, OpenHands, and OpenRouter but came up empty. Since I'm not sure if something else is causing this, I went with the most minimal fix I could think of. 😅


env:

docker pull docker.all-hands.dev/all-hands-ai/runtime:0.53-nikolaik

docker run -it --rm --pull=always \
    -e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.53-nikolaik \
    -e LOG_ALL_EVENTS=true \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -v ~/.openhands:/.openhands \
    -p 3000:3000 \
    --add-host host.docker.internal:host-gateway \
    --name openhands-app \
    docker.all-hands.dev/all-hands-ai/openhands:0.53

20250818-223657

@enyst
Copy link
Collaborator

enyst commented Aug 18, 2025

Ahh OpenRouter got the model from Bedrock, oof, idk, Bedrock can be weird. 😥

OK, let's get your fix in, it will be useful to others! Thank you for the contribution!

@enyst enyst merged commit c64b1ae into All-Hands-AI:main Aug 18, 2025
18 checks passed
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.

2 participants









ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/All-Hands-AI/OpenHands/pull/10454

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy