Spaces:
Paused
Paused
Commit History
-
fix: handle stream disconnection properly in curl transport and proxy handler (#108)
icebear +1: icebear0828Unverified signature1. curl-cli-transport: signal error (not close) when curl exits with non-zero code mid-stream, so downstream readers get a proper error instead of a silent truncation. 2. proxy-handler: catch s.write() failures during streaming to detect client disconnects, abort the upstream curl process, and stop the stream cleanly instead of leaking resources. 3. proxy-handler: don't re-throw after sending error SSE event — the stream is already closing, re-throwing causes unhandled rejection. Co-authored-by: icebear0828 <icebear0828@users.noreply.github.com>45525c6
-
fix: macOS Electron login error -86 (EBADARCH) due to wrong-arch curl binary (#96) (#98)
icebear +1: icebear0828Unverified signatureCI built both arm64/x64 DMGs on a single arm64 runner, bundling only the arm64 curl-impersonate into both. Intel Mac users got EBADARCH when spawning the binary during OAuth token exchange. - Split macOS CI into per-arch jobs with --arch flag for setup-curl.ts - Add --arch override to setup-curl.ts for cross-compilation - Improve spawn error message to diagnose architecture mismatch Co-authored-by: icebear0828 <icebear0828@users.noreply.github.com>6c928c9
-
fix: recursive additionalProperties injection + upstream error status propagation
icebear0828 +1: Claude Opus 4.61. Add injectAdditionalProperties() to recursively inject `additionalProperties: false` on every object-type node in JSON schemas. Codex API requires this explicitly but OpenAI's native API auto-injects it — our proxy was passing schemas verbatim causing 400s. 2. Fix CONNECT tunnel header parsing in curl-cli-transport: loop to skip intermediate header blocks (CONNECT 200, 100 Continue) before parsing the actual response headers. 3. Extract upstream HTTP status from error messages in non-streaming collect path instead of hardcoding 502. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>4779e44
-
feat: add Test Connection diagnostic button (#63)
icebear +2: icebear0828, Claude Opus 4.6Unverified signature* feat: add Test Connection diagnostic button (#61) Add a "Test Connection" button to the Dashboard that runs 4 sequential checks (Server, Accounts, Transport, Upstream) and displays pass/fail/skip results with latency — helps Electron users diagnose connectivity issues without access to console logs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: use socket address for localhost check, static import for buildHeaders - Replace spoofable x-forwarded-for/x-real-ip with getConnInfo() socket address for /debug/fingerprint and /debug/diagnostics endpoints - Add ::ffff:127.0.0.1 match for IPv4-mapped IPv6 addresses - Change dynamic import() of buildHeaders to static import Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: icebear0828 <icebear0828@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>85a4cbd
-
fix: let curl auto-negotiate Accept-Encoding for OAuth requests
icebear0828 +1: Claude Opus 4.6Remove the explicit Accept-Encoding header from curl-fetch.ts (used by OAuth and appcast requests only) and let --compressed auto-negotiate based on curl's actual decompression capabilities. This prevents error 61 on builds where curl lacks brotli/zstd support. Previously, the override only applied when !isImpersonate(), missing cases where curl-impersonate was available but lacked br/zstd libs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>b0a4fb7 -
feat: add force_http11 option for proxies without HTTP/2 support (#56)
Unverified signatureWhen using proxies like Clash/mihomo that don't support HTTP/2, users encounter errors like: "curl: (16) Remote peer returned unexpected data while we expected SETTINGS frame." This commit adds a `force_http11` config option to force HTTP/1.1 protocol in both curl CLI and libcurl FFI transports. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>34fceda
-
fix(auth): add direct-connection fallback for OAuth behind proxy
icebear0828 +1: Claude Opus 4.6When a global proxy is configured, OAuth requests to auth.openai.com can fail due to Cloudflare challenges (403) or TLS/schannel errors. Since auth endpoints are not fingerprint-sensitive, we safely retry with a direct connection on these failures. - Add generic withDirectFallback() wrapper (src/tls/direct-fallback.ts) - Add proxyUrl pass-through to curlFetchGet/curlFetchPost - Fix Accept-Encoding for system curl (strip br/zstd like codex-api.ts) - Wrap all 4 OAuth functions with direct-connection fallback Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>abe58f1
-
feat: add proxy pool for per-account proxy routing
icebear0828 +1: Claude Opus 4.6Add proxy pool system allowing different accounts to route through different upstream proxies for IP diversity and risk isolation. Backend: - ProxyPool manager with CRUD, assignment, round-robin, health checks - TlsTransport interface accepts per-request proxyUrl parameter - Both curl-cli and libcurl-ffi transports support per-request proxy - CodexApi forwards proxy through the request chain - REST API at /api/proxies for proxy + assignment management - Periodic health checks (default 5min) via api.ipify.org Frontend: - ProxyPool management section in dashboard - Per-account proxy selector dropdown in AccountCard - Four assignment modes: Global/Direct/Auto(Round-Robin)/Specific Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>4ebb914
-
refactor: extract startServer() + path abstraction for Electron reuse
icebear0828 +1: Claude Opus 4.6- Export startServer(options?) from src/index.ts so Electron can import it - Add src/paths.ts: centralized path getters (getConfigDir, getDataDir, etc.) with setPaths() hook for Electron to redirect to userData - Replace all process.cwd() calls with path getters across src/ - Extract shared/ from web/ (i18n, theme, hooks, utils) for desktop reuse - Add /desktop route in web.ts (serves desktop UI if built, no-op otherwise) CLI behavior is unchanged — all path getters default to process.cwd(). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>4a940a5
-
fix: Docker container auto-detect host proxy via host.docker.internal
icebear0828 +1: Claude Opus 4.6Docker containers can't reach host proxies on 127.0.0.1 (container loopback). Now probes both 127.0.0.1 and host.docker.internal so Docker users get automatic proxy detection without any configuration. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>d7d7389
-
fix: use known-profile list instead of runtime detection for TLS impersonation
icebear0828 +1: Claude Opus 4.6The previous testProfile() approach using `curl -V` never validated the --impersonate target. Worse, v1.5.x silently accepts unknown profiles but applies NO impersonation (JA3 fingerprint = bare curl). Replace runtime detection with a deterministic known-profile list. Any configured chromeN is mapped to the nearest supported version (e.g. chrome137 → chrome136). This works reliably across all curl-impersonate versions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>38895cf -
fix: auto-fallback for unsupported TLS impersonate profiles
icebear0828 +1: Claude Opus 4.6curl-impersonate skips Chrome versions when the TLS fingerprint is unchanged (e.g. chrome137 doesn't exist, chrome136 covers it). Previously, configuring an unsupported profile like chrome137 caused `curl: (43) Unknown impersonation target` at runtime. Now `detectImpersonateSupport()` validates the configured profile by test-running it, and automatically descends to the nearest supported Chrome version. Also unified the FFI transport to use the resolved profile instead of a hardcoded "chrome136". Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>27e0738
-
feat: add pnpm/bun package manager support for local development
icebear0828 +1: Claude Opus 4.6Replace hardcoded npm calls in scripts with npx to be PM-agnostic, update error messages to mention all three package managers. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>d3a5a81 -
feat: add libcurl-impersonate FFI transport for Chrome TLS fingerprint
icebear0828 +1: Claude Opus 4.6Windows lacks curl-impersonate CLI, so use koffi FFI to call libcurl-impersonate DLL directly. Introduces TlsTransport abstraction with auto-selection: FFI on Windows, CLI subprocess on macOS/Linux. All three API protocols (OpenAI/Anthropic/Gemini) verified working. - New: src/tls/transport.ts (interface + singleton factory) - New: src/tls/curl-cli-transport.ts (extracted from codex-api.ts) - New: src/tls/libcurl-ffi-transport.ts (koffi FFI, curl_multi streaming) - New: scripts/poc-libcurl-ffi.ts (POC verification script) - Updated: setup-curl.ts auto-downloads DLL + cacert.pem on Windows - Updated: codex-api.ts uses transport abstraction (~200 lines removed) - Updated: curl-fetch.ts delegates to transport singleton Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>3d01305
-
refactor: fingerprint alignment, auto-maintenance, Docker deployment
icebear0828 +1: Claude Opus 4.6Phase 1 - Eliminate fingerprint detection gaps: - Dynamic sec-ch-ua from config chromium_version (aligned with TLS profile) - Inject full fingerprint headers into curl-fetch (OAuth/appcast) - Unify Accept-Encoding based on curl-impersonate detection - Optimize header ordering (single sort pass) Phase 2 - Auto-maintenance: - Structured YAML mutation utility (replace regex hacks) - Auto full-update pipeline on new version detection - Config hot-reload after updates - Exponential backoff token refresh (5 attempts + 10m recovery) - Immediate persistence for critical data (tokens, cf_clearance) - Cookie v2 format with expiry timestamps - Graceful shutdown with 10s timeout protection - Usage counters auto-reset on rate limit window rollover Phase 3 - Docker deployment: - Dockerfile, docker-compose.yml, .dockerignore - Deployment docs in README Fixes: - Extract planType from JWT /auth claim (was looking in /profile) - Backfill missing planType on startup for existing accounts - Show full d…347f81b -
feat: auto-detect local proxy (mihomo/clash/v2ray)
icebear0828 +1: Claude Opus 4.6On startup, probe common local proxy ports (7890, 7897, 10809, 1080, 10808) and automatically use the first one found. No config needed — just have a proxy running and it works. Priority: config proxy_url > HTTPS_PROXY env > auto-detect. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>e7285df -
feat: auto proxy detection for curl + tighten dashboard layout
icebear0828 +1: Claude Opus 4.6- Add tls.proxy_url config + HTTPS_PROXY env var support - Inject proxy args into both curlPost() and getUsage() curl calls - Explicitly set Accept-Encoding to gzip,deflate for system curl compat - Include setup-curl.ts postinstall script (was gitignored) - Tighten dashboard font sizes and spacing for compact layout - Rename dashboard1.html → dashboard.html, fix web.ts reference Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>d85b21d -
feat: desktop context injection, multi-turn sessions, TLS impersonation & auto-update
icebear0828 +1: Claude Opus 4.6- Inject Codex Desktop system prompt into every request for full feature parity - Add previous_response_id for multi-turn conversation continuity - Add curl-impersonate auto-detection with Chrome TLS fingerprint fallback - Fix appcast XML parsing for element-style Sparkle tags - Remove private maintenance scripts from public repo - Add README with setup and usage instructions Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>22a7de1