agentscope-ai / agentscope-ai/QwenPaw

[Bug] OpenAI-compatible provider gets Cloudflare 403 when connecting to WUSRouter

Abierto
#7,587 4 comentarios 0 reacciones 1 asignado Reclamado por @wangfei010313 Ver en GitHub
Lenguaje dominante
TypeScript
Estrellas
35k
Forks
3.1k
Merge medio
1 d 13 h
PR fusionados (30 d)
228

Descripción

# [Bug] OpenAI-compatible provider gets Cloudflare 403 when connecting to WUSRouter

## Describe the bug

When using WUSRouter as an OpenAI-compatible provider in QwenPaw, **fetching the model list fails with HTTP 403**. The response body is a Cloudflare "Just a moment..." managed challenge page instead of the expected JSON model list.

The blocked request is:

```
GET https://api.wusrouter.com/v1/models
```

The Cloudflare challenge page confirms the zone:

```
api.wusrouter.com
```

## Configuration

- OS: Linux (container)
- QwenPaw version: 2.2.0
- Provider: WUSRouter
- Protocol: OpenAI-compatible
- Base URL: https://api.wusrouter.com/v1
- Model: deepseek-v4-flash-vision-exp

## Steps to Reproduce

1. In QwenPaw, add WUSRouter as an OpenAI-compatible provider (Base URL: `https://api.wusrouter.com/v1`)
2. Trigger "fetch model list" (when configuring the provider / testing the model)
3. The request to `GET /v1/models` is blocked: HTTP 403 with a Cloudflare "Just a moment..." challenge page

## Actual behavior

When fetching the model list, QwenPaw receives HTTP 403 with a Cloudflare managed challenge page instead of the JSON model list.

Key log excerpt (Cloudflare challenge page):

```html
Just a moment...
...
cUPMDTk: "/v1/models?__cf_chl_tk=..."
cZone: "api.wusrouter.com"
...
```

(The full response is a standard Cloudflare managed challenge page with `cType: managed`.)

## Expected behavior

QwenPaw should be able to call `GET /v1/models` on a Cloudflare-protected OpenAI-compatible endpoint and receive the JSON model list.

## Additional investigation

The same endpoint works fine with curl from the same network:

```bash
curl https://api.wusrouter.com/v1/models -H "Authorization: Bearer "
```

returns the model list (`deepseek-v4-flash`, `deepseek-v4-flash-0731`, `deepseek-v4-flash-0731-premium`, `deepseek-v4-flash-vision-exp`), which confirms:

1. The Base URL is correct.
2. The API key is valid.
3. `/v1/models` is accessible from the same network.
4. The failure happens specifically when QwenPaw's HTTP client calls the endpoint.

## Possible cause

It appears QwenPaw's HTTP request (headers, TLS fingerprint, or User-Agent) triggers WUSRouter's Cloudflare bot protection, while curl does not.

Could you please investigate whether QwenPaw's OpenAI-compatible HTTP client is compatible with Cloudflare-protected OpenAI-compatible APIs? It would also help if QwenPaw could detect a Cloudflare Challenge HTML response and surface a clearer error message instead of a generic 403.

Thank you.

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Focus on the OpenAI-compatible provider path that performs `GET /v1/models` and the shared HTTP client layer. First reproduce in QwenPaw and inspect the outgoing request details, then compare them with the successful `curl https://api.wusrouter.com/v1/models` call shown in the issue. Check where model-list responses are parsed and add explicit handling for Cloudflare 403 HTML/challenge responses before JSON parsing. Done when model listing returns JSON correctly or emits a clear Cloudflare-challenge error instead of a generic 403.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
python
Área
api, backend
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Activo
Claridad
Bastante claro
Aptitud para principiantes
45/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.