Skip to content

fix: add browser User-Agent to fix CF 403s on openai_compat backends#13

Closed
briepala wants to merge 1 commit into
OnlyTerp:mainfrom
briepala:solve-headers
Closed

fix: add browser User-Agent to fix CF 403s on openai_compat backends#13
briepala wants to merge 1 commit into
OnlyTerp:mainfrom
briepala:solve-headers

Conversation

@briepala

@briepala briepala commented Jun 4, 2026

Copy link
Copy Markdown
  • Add UC_BROWSER_UA env var (default: modern Chrome UA)
  • Inject User-Agent + Accept-Language in openai_compat paths, the Auto Router classifier, model discovery, and passthroughs
  • Route-level "headers" overrides still take precedence
  • Shortened the related comments

Cloudflare-protected providers (e.g. crof.ai) were rejecting requests with
"Error 1010: browser_signature_banned" because the proxy used Python's
default urllib User-Agent.

The same API keys + endpoints worked fine from droid/Factory because those
clients send a real browser UA.
crof.ai models (kimi-, deepseek--crof, mimo-*, etc.) now work the same as
they do in droid/Factory.

Tested: scripts/doctor.py passes, direct proxy requests to crof models
succeed and return real responses.

- Add UC_BROWSER_UA env var (default: modern Chrome UA)
- Inject User-Agent + Accept-Language in openai_compat paths, the Auto
  Router classifier, model discovery, and passthroughs
- Route-level "headers" overrides still take precedence
- Shortened the related comments
@OnlyTerp

Copy link
Copy Markdown
Owner

Superseded by #16 — the browser User-Agent fix (UC_BROWSER_UA) is included in the integration PR on integrate/open-prs-and-issues, rebased onto main after #11/#12 merged. Closing this branch to avoid duplicate/conflicting merges.

OnlyTerp pushed a commit that referenced this pull request Jun 11, 2026
- PR #13: browser User-Agent (UC_BROWSER_UA) for openai_compat upstreams
- Issue #15: orchestrator_worker in /healthz, ultracode status, docs
- Issue #14: tool-only assistant content=null, context-length error hints, tests

PRs #11 and #12 were already merged to main; this branch carries only the delta.

Co-authored-by: Cursor <cursoragent@cursor.com>
@OnlyTerp

Copy link
Copy Markdown
Owner

Closing in favor of #16 (rebased integration branch now contains this fix cleanly on top of main).

@OnlyTerp OnlyTerp closed this Jun 11, 2026
OnlyTerp added a commit that referenced this pull request Jun 11, 2026
fix: PR #13 browser UA + issues #14/#15 (remaining delta after #11/#12)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants