Commit Graph
108 Commits
Author SHA1 Message Date
root f4a3ada5ee fix(download): 修复空代理导致TLS异常并增加直连降级 2026-02-17 17:32:48 +08:00
root 51eeac2c8f fix(chat): 修复self.chat调用参数顺序导致的SyntaxError 2026-02-17 14:59:02 +08:00
root e471769b38 feat(log): 同时打印请求模型与上游模型及模式 2026-02-17 14:58:05 +08:00
Chenyme acf605d5c6 refactor: change model tier from SUPER to BASIC for GROK-4.1-EXPERT and GROK-4.1-THINKING 2026-02-16 00:08:54 +08:00
Chenyme 928faabbac refactor: update configuration settings, enhance public API integration, and streamline service imports while removing deprecated files 2026-02-15 17:43:57 +08:00
Chenyme 7f0db522ae refactor: enhance configuration management by adding public API key support, reorganizing chat and image settings, and removing deprecated components 2026-02-15 00:39:30 +08:00
Chenyme d04bc4ee4c refactor: streamline chat and video processing services, enhance validation, and remove unused components 2026-02-13 20:22:52 +08:00
Chenyme 6257b68527 refactor: remove unused files and streamline batch processing configuration in services 2026-02-13 14:21:11 +08:00
Chenyme e5df9ca323 refactor: reorganize batch processing utilities and update import paths across services 2026-02-13 14:01:40 +08:00
Chenyme c62faf193b refactor: update import paths for ModelService and remove unused model files 2026-02-13 13:36:16 +08:00
Chenyme 6228788956 refactor: consolidate usage configuration and update related services for improved clarity and performance 2026-02-13 13:27:45 +08:00
Chenyme 314102dcba feat: add NSFW configuration and refactor related services for improved management 2026-02-13 13:00:12 +08:00
Chenyme 0d0e793181 feat: enhance asset management configuration and services 2026-02-13 11:25:50 +08:00
Chenyme 432acf41cf refactor: replace DownloadService with CacheService in admin API and update related methods 2026-02-13 00:31:05 +08:00
Chenyme 716e274b89 refactor: update GROK services and remove unused components 2026-02-11 17:35:25 +08:00
Chenyme eb00bbd57d chore: remove unused gRPC-Web protocol files 2026-02-11 16:10:08 +08:00
Chenyme 9967bdd90e refactor: optimize base64 validation and enhance header logging 2026-02-11 15:14:38 +08:00
Chenyme 90fc016807 merge: remove unused header, retry, and Statsig utility files 2026-02-11 11:32:54 +08:00
Chenyme a864751543 Merge remote-tracking branch 'origin/main' into reactor_reverse 2026-02-11 11:01:04 +08:00
piexian b06bd8d83f refactor: 跨 Token 重试次数改为读取 retry.max_retry 配置
将 ChatService 中跨 Token 重试的硬编码 max_token_retries=3 改为
从 retry.max_retry 配置项读取,与内层重试机制保持一致。
2026-02-11 01:02:13 +08:00
piexian f53e412b4e feat: 添加跨 Token 重试机制,429 配额不足时自动换 Token
- 在 ChatService.completions() 中实现跨 Token 重试循环,最多尝试 3 个
  不同 Token,遇到 429 时标记当前 Token 为 COOLING 并切换下一个
- TokenPool.select() 和 TokenManager.get_token() 增加 exclude 参数,
  支持排除已失败的 Token
- 新增 TokenManager.mark_rate_limited() 方法,将 429 的 Token 配额
  归零并标记 COOLING,等待 Scheduler 刷新恢复
- 内层 retry_on_status 不再重试 429,避免对同一耗尽 Token 做无意义重试
- 循环耗尽后兜底抛出异常,避免隐式返回 None
2026-02-10 20:49:51 +08:00
piexian d11b059943 fix: 修复 Token 自动刷新失败导致持续 504/429 错误
- 修复 Scheduler 刷新使用错误的默认模型名 (grok-4-1-thinking-1129 → grok-3),
  避免 basic token 查询配额时返回 403
- 调整 Scheduler 启动后立即执行首轮刷新,而非等待整个 interval (2-8h)
- 移除刷新失败分支中的 mark_synced() 调用,使失败 token 在下一轮
  循环中被重新尝试而非被跳过
- Token 池耗尽时自动触发 refresh_cooling_tokens(),尝试恢复
  冷却中的 token,而非直接返回 429
2026-02-10 18:36:19 +08:00
Chenyme 06357ad6c5 refactor: remove gRPC-Web protocol implementation and integrate WebSocket reverse handlers for image service 2026-02-10 11:46:22 +08:00
Chenyme 4573a1928e fix: response handling in LivekitTokenReverse 2026-02-10 10:46:51 +08:00
Chenyme 413493d5b5 refactor: integrate reverse request handlers for image and voice services 2026-02-10 10:39:55 +08:00
Chenyme 06df48b87a refactor: integrate reverse request handlers for NSFW 2026-02-10 10:15:24 +08:00
Chenyme 370edb5f92 refactor: integrate reverse request handlers for NSFW 2026-02-10 10:15:04 +08:00
Chenyme d947ef69ba refactor: simplify usage service by removing model_name parameter and integrating reverse request handler for rate limits 2026-02-09 22:03:27 +08:00
Chenyme d3a1b09d3a refactor: integrate reverse request handlers for image and video services 2026-02-09 16:41:43 +08:00
Chenyme fddb79dd56 refactor: streamline asset service methods by integrating reverse request handlers 2026-02-09 14:40:32 +08:00
MasterDevYY 8c791179c1 fix: update assets.py Sec-Fetch-Site header to same-site 2026-02-08 23:36:22 +08:00
MasterDevYY 00f0d2ba6a fix: resolve SSL and media retrieval issues
- Fix CERTIFICATE_VERIFY_FAILED error on some Linux distributions.
- Fix 403 Forbidden error when fetching images and videos from origin servers.
2026-02-08 21:57:27 +08:00
Chenyme d93824f781 refactor: remove deprecated smart token routing configuration and related test 2026-02-08 16:06:09 +08:00
double2tea 69dbcac74a fix: add missing deviceEnvInfo for video generation payload
The Grok API requires deviceEnvInfo field to correctly parse resolutionName.
Without this field, the backend ignores resolution settings and generates
low-resolution videos regardless of the requested quality.

Added deviceEnvInfo with standard 1920x1080 viewport settings to ensure
720p and other resolution settings are properly respected by the API.

Tested: 720p videos now correctly generate at 720x1280 resolution.
2026-02-08 03:46:45 +08:00
double2tea 01dcea9b7c feat: implement smart token routing for video generation
- Add get_token_for_video() method to select token pool based on video requirements
- 720p or >6s videos automatically use ssoSuper token
- 480p and ≤6s videos use ssoBasic token
- Fallback to ssoBasic when ssoSuper is unavailable
- Add configuration options for smart routing
- Add test file for token routing logic

This solves the issue where non-SSO Super tokens were silently downgraded
to 480p by Grok API when requesting 720p videos.
2026-02-08 03:16:37 +08:00
Chenyme 0bd1aaf335 feat: introduce DATA_DIR environment variable for configurable data storage paths 2026-02-07 23:00:29 +08:00
Chenyme 51944d122f feat: enhance image processing error handling and logging 2026-02-07 13:58:35 +08:00
Chenyme 8361e65c31 refactor: clean up code formatting and improve readability across multiple files 2026-02-07 13:34:55 +08:00
Chenyme bcd94069a7 feat: migrate configuration structure to improve organization and flexibility 2026-02-07 13:30:50 +08:00
Chenyme 5d369596c5 feat: improve token management and logging across services 2026-02-07 13:11:23 +08:00
Chenyme 2e201b5ebf feat: enhance configuration management and service initialization 2026-02-07 12:40:42 +08:00
Chenyme b132590045 feat: enhance configuration options across services for improved flexibility 2026-02-07 11:32:25 +08:00
Chenyme b65b4e0032 Merge branch 'main' into imagine 2026-02-07 10:52:37 +08:00
GeJiaXiang 7f794f9185 feat: 添加浏览器指纹配置支持,优化配置页面分组
- 新增 grok.browser 和 grok.user_agent 配置项,支持自定义 curl_cffi 指纹和 User-Agent
- 将 CF Clearance、curl_cffi、User-Agent 三个字段在前端独立为"反爬虫验证"分组
- 添加分组说明:首次请求 IP 需与获取 CF Clearance 时一致
- 调整"禁用记忆"字段位置至"临时对话"下方
- 移除 docker-compose.yml 中无效的 GROK_DISABLE_MEMORY 环境变量
2026-02-07 09:52:39 +08:00
Chenyme 23a712eeb7 feat: add WebSocket support for image generation and editing, enhance configuration options for image processing 2026-02-07 02:16:11 +08:00
GeJiaXiang 3731cf545e fix: 将 disableMemory 改为可配置项,默认禁用服务端记忆
共享 token 池场景下,disableMemory: False 会导致:
1. 不同用户的对话记忆相互污染
2. 历史记忆覆盖当前用户指令

现改为通过 grok.disable_memory 配置,默认 True
2026-02-06 23:00:04 +08:00
Chenyme f937d57d1e feat: enhance token management with normalization and improved error handling for token updates 2026-02-06 17:12:50 +08:00
Chenyme 7d2cba0310 feat: increase stream idle timeout to 120 seconds and add normalization for stream response lines 2026-02-06 16:47:13 +08:00
Chenyme 17928b49f0 feat: enhance token and voice functionalities with improved error handling and support for microphone permissions 2026-02-06 15:46:24 +08:00
Chenyme 9d6af73f35 feat: update image processing API to support response format customization and enhance request validation 2026-02-06 15:36:12 +08:00