Run bounded periodic proxy health checks in the Space. Quarantine only affected accounts, replace failed exits without sharing assigned egress, persist bindings, invalidate old sessions, and relogin before reuse. Include curl in runtime. 34 local behavior tests and baseline/modified/rollback verification passed.
Recover each Qwen account on a healthy unique proxy from the HF runtime
Run bounded periodic proxy health checks in the Space. Quarantine only affected accounts, replace failed exits without sharing assigned egress, persist bindings, invalidate old sessions, and relogin before reuse. Include curl in runtime. 32 local behavior tests and baseline/modified/rollback verification passed.
Bound Qwen auth callers independently of a stalled proxy transport
Verified normal password sign-in, issued-cookie refresh and qwen3.7-plus OK on isolated candidate. Preserve REST/proxy/accounts/settings. Refresh cookies stay memory-only; existing storage saves access tokens. Bound requests and non-overlapping 60sec checks renew five minutes early.
Bound sign-in proxy wait and omit credential-bearing login errors
Add10000ms AbortSignal to existing normal login; preserve endpoint, account storage and proxy identity. Remove raw Axios error objects from AUTH logs. Inference unresolved.
Trace session authorization safely and align configurable web version
Normalize existing colon-four-part proxy URLs in memory while retaining latest proxy transport, per-account pools and TLS verification. Do not rewrite stored proxies or existing database records. REST migration and backups remain intact.
Restore Upstash REST on current upstream source runtime
Run current Qwen2API source on Bun, preserving latest chat code. Port only REST transport into current Redis module and back up existing accounts/settings without overwriting or deleting their keys. Original five patch files remain in repository.
Use latest Qwen2API base image; retain existing COPY overrides
An https:// proxy means TLS to the proxy itself. Many such proxies serve
self-signed / incomplete-chain certs or are addressed by IP, so Node's default
rejectUnauthorized=true rejects them with UNABLE_TO_VERIFY_LEAF_SIGNATURE —
which token-manager logs as the misleading "网络请求超时或无响应". Build
https:// proxy agents with rejectUnauthorized:false so only the hop TO the
proxy skips cert checks; the end-to-end TLS to the target (chat.qwen.ai) is
still validated by the request side. http:// proxies are unaffected.
Verified against a real TLS proxy (cert CN=*.netsolvps.com, broken chain):
with the flag it connects and returns the proxy exit IP, while expired/
self-signed TARGET sites are still rejected (CERT_HAS_EXPIRED /
DEPTH_ZERO_SELF_SIGNED_CERT) — target validation preserved.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Proxy-list exports often use `scheme://ip:port:user:pass`, which new URL()
(and thus HttpsProxyAgent) rejects as "Invalid URL", so an account/global
proxy in that shape never builds an agent. Add normalizeProxyUrl() that
rewrites the four-field form to the standard `scheme://user:pass@host:port`,
preserving the original scheme (http stays http / https stays https — a TLS
proxy is still dialed over TLS). Strict superset: inputs new URL() already
parses (plain ip:port, user:pass@host:port, IPv6, socks5) pass through
unchanged. Wired into isValidProxyUrl (falls back to the old regex so nothing
previously accepted is now rejected) and getOrCreateAgent/invalidateProxyAgent
(cache keyed by the normalized URL). New patch file proxy-helper.js.
Verified locally: 16 checks incl. HttpsProxyAgent parsing user/pass/host/port
for both http and https quads, no-op on standard/IPv6/socks5 forms, cache
reuse across equivalent spellings.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.c…
HF Spaces only allow outbound 80/443/8080 (docs: spaces-overview#networking),
so Upstash's Redis TCP port 6379 can never be reached directly. When
UPSTASH_REDIS_REST_URL + UPSTASH_REDIS_REST_TOKEN are set, redis.js talks to
the Upstash REST API via built-in fetch instead of ioredis: a minimal client
for the commands this module uses (PING/SCAN/HGETALL/HGET/HSET/EXISTS/DEL and
/pipeline) with ioredis-compatible return shapes, so the account/settings
logic is unchanged. Network errors, timeouts and 5xx retry twice; 4xx fail
fast (401 points at the token). Without the REST vars the previous TCP path
(optional HTTP CONNECT tunnel) is untouched, plus a startup warning when an
*.upstash.io REDIS_URL has no tunnel.
Verified locally against a real Upstash REST database: data-layer round trips
(partial-merge HSET, 150-account SCAN paging + one pipeline, WRONGTYPE items,
settings), 12 error/fallback scenarios, and a full app startup.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthro…
fix(redis): sanitize TLS errors before rejecting (upstream logger JSON.stringify crashes on circular cert refs); skip SNI for IP proxy hosts
HF Space egress to Upstash :6379 hits connect ETIMEDOUT while the same
endpoint is reachable on :443 and from outside HF. Add a custom ioredis
Connector that opens an HTTP CONNECT tunnel via PROXY_URL (same proxy as
chat/CLI traffic) and runs end-to-end TLS to Upstash inside it.
Falls back to direct connection when PROXY_URL is absent or socks5.
Verified locally: ioredis@5.6.1 + real Upstash + HTTP proxy round-trip.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
diag: temporary CLI egress probe (IP + token endpoint, direct vs proxy)