Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/adclaw/providers/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,7 @@ def fetch_provider_usage(
headers={
"Accept": "application/json",
"Authorization": f"Bearer {api_key}",
"User-Agent": "AdClaw/host-ai-usage",
},
method="GET",
)
Expand Down
2 changes: 2 additions & 0 deletions tests/test_adclaw_ai_usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def test_fetch_provider_usage_uses_secret_and_usage_endpoint():
def fake_urlopen(request, timeout=0):
captured["url"] = request.full_url
captured["authorization"] = request.get_header("Authorization")
captured["user_agent"] = request.get_header("User-agent")
captured["timeout"] = timeout
return _FakeResponse(
{
Expand All @@ -85,6 +86,7 @@ def fake_urlopen(request, timeout=0):
assert captured == {
"url": "https://real.adclaw.app/api/host-ai/v1/usage",
"authorization": "Bearer ach_real_secret",
"user_agent": "AdClaw/host-ai-usage",
"timeout": 5.0,
}
assert payload["messages_remaining"] == 1483
Expand Down
Loading