Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: "Missing required parameters for function 'web_read': {'url'}" #6927

Open
1 task done
avi12 opened this issue Feb 24, 2025 · 5 comments
Open
1 task done

[Bug]: "Missing required parameters for function 'web_read': {'url'}" #6927

avi12 opened this issue Feb 24, 2025 · 5 comments
Labels
bug Something isn't working

Comments

@avi12
Copy link

avi12 commented Feb 24, 2025

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Describe the bug and reproduction steps

The initial prompt instructed the agent to look up documentation URLs

OpenHands Installation

Docker command in README

OpenHands Version

main, f35ed5e

Operating System

Windows 11

Logs, Errors, Screenshots, and Additional Context

https://www.all-hands.dev/share?share_id=164858b7ee2f62637dae25c679768aaf0296c5a18ed73dd389270a5734707111
LLM: https://huggingface.co/lmstudio-community/Qwen2.5-7B-Instruct-1M-GGUF

@avi12 avi12 added the bug Something isn't working label Feb 24, 2025
@enyst
Copy link
Collaborator

enyst commented Feb 24, 2025

The url parameter really is a required parameter for the function reading web pages. When the LLM responds asking us to call that function, it needs to provide it. It seems it didn't.

This shouldn't be a big problem normally, openhands tells the LLM the error you posted in the title, I believe, so that it can correct itself in its next response.

@avi12
Copy link
Author

avi12 commented Feb 24, 2025

As the logs show, the agent tried multiple times to connect to that URL

@enyst
Copy link
Collaborator

enyst commented Feb 24, 2025

Unfortunately I cannot load the trajectory 😥 sorry, the website crashes trying to load it, it's probably a large file. Would it be possible for you to download it using the download trajectory button, I think it's near the thumb-up thumb-down ones?

@avi12
Copy link
Author

avi12 commented Feb 24, 2025

I reproduced the issue when building from source as well, here are the logs: openhands_2025-02-25.log

@enyst
Copy link
Collaborator

enyst commented Feb 24, 2025

Thank you! Aha, so I see here the list of tools about which the LLM got informed in the prompt, includes:

    "function": {
      "name": "web_read",
      "description": "Read (convert to markdown) content from a webpage. You should prefer using the `web_read` tool over the `browser` tool, but do use the `browser` tool if you need to interact with a webpage (e.g., click a button, fill out a form, etc.).

You may use the `web_read` tool to read content from a webpage, and even search the webpage content using a Google search query (e.g., url=`https://www.google.com/search?q=YOUR_QUERY`).
",
      "parameters": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "The URL of the webpage to read. You can also use a Google search query here (e.g., `https://www.google.com/search?q=YOUR_QUERY`)."
          }
        },
        "required": [
          "url"
        ]
      }

This information is part of the prompt. Not quite in this format, we convert and send it with some <parameter xml tags, but the contents is the same.

Then I see that the LLM got it wrong several times at the beginning

00:30:33 - openhands:DEBUG: stream.py:272 - Adding ErrorObservation id=6 from AGENT
00:30:34 - openhands:DEBUG: agent_controller.py:378 - [Agent Controller cec2e3124082425da22e1d692aa1e33d] **ErrorObservation**
Missing required parameters for function 'web_read': {'url'}

This is several times. In-between it was doing something else (read a file, then tried again without url).

And then it got it right?
The log contains several web pages, and they're from web_read tool, as far as I can tell. So it got it right, it did respond with the url it wanted, it seems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants