Fix Cloudflare 403 on Aver llms.txt fetch#58
Conversation
Python's default urllib User-Agent ("Python-urllib/3.14") is blocked
by Cloudflare on averlang.dev. Extract a shared _fetch_url() helper
that sends "vera-bench/0.0.9" as User-Agent. Fixes both SKILL.md
and llms.txt fetches.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
📝 WalkthroughWalkthroughAdded a module-level Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@vera_bench/prompts.py`:
- Around line 24-28: Add a regression test that verifies _fetch_url() sends the
custom User-Agent header: write a unit test that patches or mocks
urllib.request.urlopen (or urllib.request.Request) and captures the Request
passed into urlopen when calling _fetch_url(url). Assert that the captured
Request.headers (or Request.get_header("User-Agent")) equals the module constant
_USER_AGENT; reference the _fetch_url function and the _USER_AGENT symbol to
locate where to call and what to assert, and ensure the mock returns an object
with a read().decode("utf-8") result to simulate a normal response.
- Line 21: The constant _USER_AGENT lacks an explicit type hint; update its
declaration (the _USER_AGENT symbol) to include a Python type annotation (str)
per repository typing rules (Python 3.11+), e.g., annotate _USER_AGENT: str so
the constant is explicitly typed as a string.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 101f37f2-ca63-43a5-9817-bd3af7be5e57
📒 Files selected for processing (1)
vera_bench/prompts.py
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #58 +/- ##
==========================================
- Coverage 83.30% 83.27% -0.04%
==========================================
Files 10 10
Lines 1360 1363 +3
==========================================
+ Hits 1133 1135 +2
- Misses 227 228 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
Python-urllib/3.14) is blocked by Cloudflare on averlang.dev, causing--language averto crash with HTTP 403_fetch_url()helper that sendsvera-bench/0.0.9as User-AgentTest plan
load_aver_llms_txt()returns 11702 chars successfullyload_skill_md()returns 72260 chars successfullyGenerated with Claude Code
Summary by CodeRabbit