Skip to content

WebFetch UserAgent identifies as user, not as agent / bot #14453

Description

@pdehne-steidle

Description

The WebFetch tool in OpenCode sends Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36 as its user agent.

I think this is wrong, in my view it impersonates as a human. Instead it should send an user agent that allows the request to be identified coming from OpenCode.

For example OpenAI sends Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko); compatible; ChatGPT-User/1.0; +[https://openai.com/bot"](https://openai.com/bot%22). This allows for websites to decide what to do with traffic from ai agents.

Plugins

No response

OpenCode version

1.2.9

Steps to reproduce

Fetch any url using the WebFetch tool and inspect the log files of the webserver.

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcoreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions