Send a real User-Agent so Cloudflare doesn't block ingest (v0.5.1)#25
Merged
Conversation
Cloudflare (error 1010) hard-blocks the default "Python-urllib/x.y" UA, so POST /v1/usage through the public origin failed for the SDK's remote Meter and the Hermes sync bridge — both used urllib's default UA. They now send "plutus-agent/<version>" (SDK) / "plutus-agent-hermes-sync" (bridge). Caught while dogfooding Hermes: the cron works via the internal URL (http://plutus:8420, no CF), but external SDK users through the public URL would have been blocked. Client-side fix — publish 0.5.1 to PyPI; no server redeploy needed. +1 test asserting the SDK's outgoing User-Agent. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug (caught while dogfooding Hermes)
Cloudflare returns error 1010 ("banned browser signature") for the default
Python-urllib/x.yUser-Agent. Our SDK's remoteMeterand thehermes_sync.pybridge both used urllib's default UA, soPOST /v1/usagethrough the public origin (plutus.perseus.observer) failed for any urllib client — i.e. external customers usingMeter(remote=…)would be silently blocked. Verified directly on greg:Fix
client.py: remotetrack()sendsUser-Agent: plutus-agent/<version>.examples/hermes_sync.py: bridge sendsUser-Agent: plutus-agent-hermes-sync.plutus-agent…, not urllib). 79 total green.Scope
Client-side only — no server/greg redeploy needed. Publishing 0.5.1 to PyPI gets the fix to SDK users. (Our own Hermes cron already dodges this by posting to the internal URL
http://plutus:8420, bypassing Cloudflare.)🤖 Generated with Claude Code