fix(providers): use canonical OpenRouter app URL

This commit is contained in:
Xubin Ren
2026-07-26 15:56:51 +08:00
parent 55405f6cd6
commit 7f3de6ea3e
5 changed files with 15 additions and 13 deletions
+3
View File
@@ -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"]
+1 -1
View File
@@ -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