Skip to content

Missing user agent in request to custom openai compatible providers #3060

@LLuke

Description

@LLuke

Missing user agent in the example path

export OPENAI_BASE_URL="http://127.0.0.1:11434/v1"
export OPENAI_API_KEY="local-dev-token"
claw --model "qwen3:latest" prompt "Reply exactly HELLO_WORLD_123"

lead to spam / hacking suspicion with 403 error and blocked by certain custom api provider.

$ cargo run --bin claw -- --model "$CLAW_MODEL" prompt "Reply exactly HELLO_WORLD_123"
   Compiling rusty-claude-cli v0.1.0 (/home/developer/git-repos/github/claw-code/rust/crates/rusty-claude-cli)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 6.11s
     Running `target/debug/claw --model MiniMaxAI/MiniMax-M2.5 prompt 'Reply exactly HELLO_WORLD_123'`
✘ ❌ Request failed
[error-kind: api_http_error]
error: api returned 403 Forbidden: {"error": "Access Denied: Bots and scrapers are not permitted on this server."}

Run `claw --help` for usage.

Tests against the provider revealed the differences are due to missing user-agent. It passed when the proper user-agent was added.


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions