Spaces:
Paused
Paused
Commit History
-
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: dynamic model list fetching from Codex backend (#9)
icebear +2: icebear0828, Claude Opus 4.6Unverified signature* feat: dynamic model list fetching from Codex backend Replace static-only model loading with a hybrid approach: - Static YAML models as fallback baseline - Background fetcher probes /codex/models and /models endpoints - Backend models merge into catalog (backend wins, YAML fills gaps) - Aliases always from YAML (user-customizable) - New /debug/models endpoint for diagnostics - All fetch errors non-fatal — gracefully falls back to static models Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: PR #9 review issues + complete Codex model catalog - Remove dead _backendModelCount variable from model-store - Fix hot-reload wiping backend models: add triggerImmediateRefresh() in model-fetcher, chain it in reloadAllConfigs() - Fix premature "hot-reloaded" log message ordering in config.ts - Gate raw model sample logging to first fetch only in codex-api - Remove dead re-exports from routes/models.ts - Expand getModels() to probe sentinel/chat-requirements + flatten nested …5f8456f
-
feat: OpenCode platform support, vitest tests, changelog & Docker hardening
icebear0828 +1: Claude Opus 4.6- Add opencode.json provider config for OpenCode IDE integration - Add CHANGELOG.md covering all versions (v0.1.0–v0.8.0) - Add vitest with unit tests for account-pool, codex-api, codex-event-extractor - Add request-id middleware to global middleware chain - Harden Dockerfile: non-root user, HEALTHCHECK probe - Simplify /health endpoint to return pool summary only Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>92c5df7 -
feat: native tool calling support across all protocols (#8)
icebear +2: icebear0828, Claude Opus 4.6Unverified signature* feat: native tool calling support across all protocols - Fix 500 errors: wrap c.req.json() in try-catch for all 3 routes, returning proper 400 responses for malformed JSON - Forward tool definitions to Codex API instead of sending tools: [] - Parse function call SSE events (output_item.added, function_call_arguments.delta/done) with item_id→call_id mapping - Translate tool calls back to each protocol's format: OpenAI: streaming tool_calls chunks + finish_reason "tool_calls" Anthropic: tool_use content blocks + stop_reason "tool_use" Gemini: functionCall parts in candidates - Convert tool results from each protocol to native function_call_output input items - New shared module: tool-format.ts for cross-protocol tool conversion Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: address review issues in native tool calling - Fix Gemini call_id collision: use counter-based IDs with name→callId correlation instead of fragile fc_${name} pattern - Remove dead c…ab2754a
-
fix(api): return 400 invalid_json for malformed chat payload
icebear08280be9bdf -
refactor: remove dead code, unused config, and fix type violations
icebear0828 +1: Claude Opus 4.6- Remove deprecated public/dashboard.html (replaced by Preact frontend) - Remove unused streaming and environment config sections (zero references) - Fix all `any` type violations (CLAUDE.md rule) in yaml-mutate, update-checker, and web components - Extract duplicate OAuth callback setup into shared startOAuthFlow() helper - Fix Vite emptyOutDir to prevent stale build artifact accumulation - Simplify .gitignore to ignore entire public/ build output Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>50ae780
-
feat: accept tool/function messages across all protocols
icebear0828 +1: Claude Opus 4.6Client frameworks (LangChain, AutoGen, Claude Code, etc.) often send conversation histories containing tool role messages and tool_calls. Previously, Zod validation rejected these requests outright. Since the Codex backend doesn't support tool calls, this implements a graceful degradation strategy: accept all tool-related fields in the schema, then flatten tool messages into human-readable text during translation. Covers both old (functions/function_call/role:function) and new (tools/tool_calls/role:tool) OpenAI formats, plus Anthropic (tool_use/tool_result) and Gemini (functionCall/functionResponse). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>759fe9e
-
feat: suppress Codex Desktop directives in model responses
icebear0828 +1: Claude Opus 4.6Keep desktop-context.md in instructions for client fingerprinting, but inject a suppress prompt to prevent the model from outputting desktop-specific directives (::automation-update, ::code-comment, ::archive) and mentioning Codex Desktop features. Controlled by config model.suppress_desktop_directives (default: true). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>d817d67 -
feat: support developer role and array content in OpenAI protocol
icebear0828 +1: Claude Opus 4.6- Add "developer" to role enum (treated as system/instructions) - Accept array content parts (extract text, ignore non-text) - Flatten array content before passing to session manager Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>ebe8094 -
fix: startup log shows config proxy_api_key instead of random hash
icebear0828 +1: Claude Opus 4.6Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>a931669 -
fix: proxy_api_key from config not used in frontend or auth validation
icebear0828 +1: Claude Opus 4.6/auth/status now returns config.server.proxy_api_key when set instead of per-account random hash. validateProxyApiKey also accepts the configured key. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1f63c38 -
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 -
fix: prevent .env inline comments from being parsed as JWT tokens
icebear0828 +1: Claude Opus 4.6Docker Compose env_file doesn't strip inline comments, so "CODEX_JWT_TOKEN= # comment" was treated as a real token, creating ghost accounts on every restart. - Move .env.example comments to separate lines - Validate JWT format in config.ts (must start with "eyJ") Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>a971da6 -
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: architecture audit fixes round 2 (P0-P2)
icebear0828 +1: Claude Opus 4.6- Fix curl subprocess leak on client disconnect (abort signal propagation) - Cap SSE parse buffer at 10MB to prevent memory exhaustion - Fatal error triggers graceful shutdown instead of hard exit - Session hash: 128-bit + JSON.stringify to prevent collisions - Gemini SSE line endings normalized to \n\n - Extract shared translation utils (desktop context, instructions, budgetToEffort) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>d6c3bb0
-
feat: migrate dashboard to Preact + Vite
icebear0828 +1: Claude Opus 4.6- New web/ directory with Preact components, Tailwind CSS v3, Vite build - i18n via Context + useT() hook (zero DOM scanning on language switch) - Theme via ThemeProvider + useTheme() hook - Ghost text technique for stable header layout across EN/ZH - Backend: serve Vite build output from public/ - Docker: added frontend build step - Build: npm run build now builds frontend first, then backend Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>b7d4394 -
refactor: architecture audit fixes (P0-P2 stability & reliability)
icebear0828 +1: Claude Opus 4.6P0: curl header parse timeout (30s), kill curl on stream disconnect via AbortController, cap error response body at 1MB. P1: acquireLock TTL (5min auto-release), atomic config hot-reload, encapsulate 429 counting in AccountPool, graceful shutdown with server.close() + 5s drain period. P2: send error SSE event on stream failure, structured JSON logger, O(1) session LRU eviction via Map insertion order. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>b1107bc -
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 -
fix: remove fake Claude/Gemini model aliases, use dynamic catalog
icebear0828 +1: Claude Opus 4.6Remove non-existent Claude and Gemini model aliases from models.yaml. Gemini /v1beta/models endpoint now reads from getModelCatalog() instead of a hardcoded list. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>87cb62c -
refactor: extract shared proxy handler, eliminate route duplication
icebear0828 +1: Claude Opus 4.6- Extract withRetry() to src/utils/retry.ts (was duplicated 3x) - Create shared proxy-handler.ts encapsulating acquire/stream/release lifecycle - Refactor chat.ts, messages.ts, gemini.ts to use shared handler (-264 lines net) - Convert models.ts from default export to named createModelRoutes() - Extract GEMINI_STATUS_MAP to types/gemini.ts (was duplicated in error-handler) - Add SessionManager.destroy() with interval cleanup + unref - Remove dead captureCookies() method from codex-api.ts - Add stack trace logging to error handler - Fix hardcoded localhost in startup message - Use atomic write-to-temp-then-rename for cookie-jar and account-pool - Add warning logs for previously silent catch blocks Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>8b777a2 -
fix: remove dead login.html reference causing UI fallback on fresh installs
icebear0828 +1: Claude Opus 4.6The login page was removed earlier but web.ts still tried to serve it when unauthenticated, causing a read error and showing the "UI files not found" fallback. Now always serves dashboard.html. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>fcc0669 -
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 -
ui: redesign dashboard with Tailwind CSS + wire backend APIs
icebear0828 +1: Claude Opus 4.6Replace plain CSS dashboard with new Tailwind-based design while connecting all backend endpoints (accounts, auth, models, config). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>bafbf4b -
fix: remove all `any` types from source code
icebear0828 +1: Claude Opus 4.6Replace `catch (err: any)` with `unknown` + type-safe access, and `(err as any).code` with intersection type cast. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>8fc11c2 -
feat: multi-protocol support — Anthropic Messages API + Google Gemini API
icebear0828 +1: Claude Opus 4.6Add two new protocol translation layers so the proxy can serve clients speaking Anthropic (/v1/messages) or Gemini (/v1beta/models/:model:generateContent) in addition to the existing OpenAI /v1/chat/completions endpoint. All three protocols translate to the same upstream Codex Responses API. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>d0eb8b9 -
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
-
feat: anti-detection hardening — curl TLS, auto-version, jitter & Chromium headers
icebear0828 +1: Claude Opus 4.6- Replace fetch() with curl subprocess for POST /codex/responses to match native TLS fingerprint (Cloudflare evasion) - Auto-apply version updates from Sparkle appcast to config file and runtime - Add timing jitter to all fixed intervals (refresh, retry, backoff, polling) to eliminate automation signatures - Add sec-ch-ua, sec-ch-ua-mobile, sec-ch-ua-platform, sec-fetch-* headers to match Chromium/Electron request fingerprint - Add CookieJar.captureRaw() for Set-Cookie handling from curl responses Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>0d2f54c -
feat: reactive API config, live code examples, quota display & curl fix
icebear0828 +1: Claude Opus 4.6- Dashboard API config fields are now editable (input/select) with live code example updates and localStorage persistence - Model dropdown populated from /v1/models endpoint - Account cards show official rate limit quota with progress bar - Fix curl getUsage() failing on Windows by removing Accept-Encoding header and using --compressed flag instead - Remove .claude/settings.local.json from tracking (contains local keys) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>0fedcca -
feat: native OAuth PKCE login with fixed localhost:1455 redirect
icebear0828 +1: Claude Opus 4.6Implement native OAuth PKCE flow replacing Codex CLI dependency. - Always use http://localhost:1455/auth/callback as redirect_uri to match OpenAI's whitelist for the Codex CLI client_id - Add callback server lifecycle management (close old before starting new) - Handle EADDRINUSE gracefully instead of crashing - Listen on dual-stack (::) so localhost works on both IPv4 and IPv6 - Add account pool, refresh scheduler, and multi-account dashboard UI Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>5dd5107
-
feat: dashboard multi-account management UI with OAuth login (#3)
icebear +2: icebear0828, Claude Opus 4.6Unverified signatureAdd Accounts card to dashboard with: - Account list showing email, status, plan, usage stats, added time - OAuth-based "Add Account" via Codex CLI (GET /auth/accounts/login) - Delete account button per entry - Pool summary in header (e.g. "2 active / 3 total") Backend: add GET /auth/accounts/login endpoint that triggers OAuth flow and auto-adds the account to the pool on completion. Co-authored-by: icebear0828 <icebear0828@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1e8f135 -
feat: architecture audit — disguise hardening, update automation, robustness
icebear0828 +1: Claude Opus 4.6Disguise hardening (P0): - Enforce HTTP header order from fingerprint.yaml config - Add browser-level headers (Accept-Encoding, Accept-Language) - Add Codex-specific request body fields (tools, previous_response_id) - Protect /debug/fingerprint endpoint (dev/localhost only) Update automation (P0-P1): - Integrate appcast version checker into server process (30-min polling) - Expose update state via /health endpoint - Externalize model catalog to config/models.yaml - Fail fast on critical extraction failures (originator, api_base_url) - Update apply-update.ts to compare models against YAML config Robustness (P0-P1): - Add 5xx retry with exponential backoff in chat route (max 2 retries) - Wrap HTML file reads in try-catch to prevent server crashes - Add config load try-catch with friendly error messages - Log persistence errors instead of silently swallowing - Add retry (1 attempt, 5s delay) for token refresh failures Code hygiene: - Delete leftover WHAM dist files - Mark 6 backward-co…85aec43 -
refactor: remove dead code, extract hardcoded values into config
icebear0828 +1: Claude Opus 4.6- Delete unused AuthManager (src/auth/manager.ts, replaced by AccountPool) - Delete unused ProxyClient + serializePath (src/proxy/client.ts) - Replace hardcoded "Codex Desktop" in chatgpt-oauth.ts with config.client.originator - Extract magic timestamp 1700000000 into MODEL_CREATED_TIMESTAMP constant - Move session TTL and cleanup interval from hardcoded values to config schema - Fix unused `target` variable in models.ts route loop Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>ab21b87 -
Initial commit: Codex Proxy with quota API and Cloudflare bypass
icebear0828 +1: Claude Opus 4.6OpenAI-compatible proxy that translates Chat Completions API to ChatGPT's Codex Responses API. Includes multi-account management, official quota querying via curl subprocess (bypasses Cloudflare TLS fingerprinting), per-account cookie jar, and full API documentation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>5d0a52f