mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-08-14 08:09:16 +03:00
fix(providers): use canonical OpenRouter app URL
This commit is contained in:
@@ -142,6 +142,9 @@ async def test_openrouter_image_generation_payload_and_response(tmp_path: Path)
|
||||
call = fake.calls[0]
|
||||
assert call["url"] == "https://openrouter.ai/api/v1/chat/completions"
|
||||
assert call["headers"]["Authorization"] == "Bearer sk-or-test"
|
||||
assert call["headers"]["HTTP-Referer"] == "https://nanobot.wiki"
|
||||
assert call["headers"]["X-OpenRouter-Title"] == "nanobot"
|
||||
assert call["headers"]["X-OpenRouter-Categories"] == "cli-agent,personal-agent"
|
||||
assert call["headers"]["X-Test"] == "1"
|
||||
body = call["json"]
|
||||
assert body["modalities"] == ["image", "text"]
|
||||
|
||||
@@ -485,7 +485,7 @@ async def test_openrouter_sets_default_attribution_headers() -> None:
|
||||
await provider._ensure_client()
|
||||
|
||||
headers = mock_client_cls.call_args.kwargs["default_headers"]
|
||||
assert headers["HTTP-Referer"] == "https://github.com/HKUDS/nanobot"
|
||||
assert headers["HTTP-Referer"] == "https://nanobot.wiki"
|
||||
assert headers["X-OpenRouter-Title"] == "nanobot"
|
||||
assert headers["X-OpenRouter-Categories"] == "cli-agent,personal-agent"
|
||||
assert "x-session-affinity" in headers
|
||||
|
||||
Reference in New Issue
Block a user