46 Commits

Author SHA1 Message Date
genz27
01736a9687 fix(admin): 禁用验证码分数测试入口 2026-04-02 20:13:12 +08:00
genz27
5702e1e182 fix(personal): 修复 token 删除外键并增强浏览器自恢复 2026-04-02 14:49:33 +08:00
comet
d37f98bdce fix: avoid impersonation for captcha API JSON requests (#110)
* fix: avoid impersonation for captcha API JSON requests

* fix: avoid impersonation for captcha API JSON requests
2026-04-02 14:11:44 +08:00
Genz
5d18293f1e chore: normalize line endings for issue fixes 2026-04-02 14:10:00 +08:00
Genz
9b83d4595c fix: stabilize personal browser startup and cache cleanup sync 2026-04-02 14:07:14 +08:00
wx-11
d36218918d 适配generationConfig 2026-03-31 12:22:05 +08:00
shskjw
ef4e9b3fa0 修复外部资源地址返回0.0.0.0和默认8000端口问题 2026-03-31 00:27:37 +08:00
genz27
a12c02c8ec Optimize captcha browser slot pooling 2026-03-30 15:43:00 +08:00
genz27
03acb4484d feat: 添加 personal 模式标签页配置和热更新支持
主要改动:
- 添加 personal_max_resident_tabs 和 personal_idle_tab_ttl_seconds 配置项
- 支持在管理页面动态修改标签页数量和空闲超时
- 实现配置热更新,无需重启服务
- 优化浏览器启动参数,窗口不占用前台
- 增强日志输出,显示标签页使用情况
- 更新配置说明,明确标签页与 project_id 的关系

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-30 11:02:08 +08:00
genz27
b7859dda47 fix: fallback when httpx is unavailable 2026-03-30 01:56:53 +08:00
genz27
f3eb69308d Fix remote browser JSON control-plane delivery 2026-03-29 18:49:16 +08:00
genz27
dd09e5497a refactor: use curl_cffi for remote browser control plane 2026-03-24 02:01:22 +08:00
TheSmallHanCat
848115bfab feat: 支持token顺序轮询模式 2026-03-18 23:52:22 +08:00
nhucuc9999
bacd49468b feat: add public health check endpoint
Add GET /health endpoint (no auth required) returning backend_running
status and has_active_tokens boolean for uptime monitoring.
2026-03-17 13:47:51 +07:00
genz27
db559a82c5 fix: improve gemini compatibility and cache flow
1. add Gemini /models and /v1beta/models discovery endpoints for newapi compatibility

2. persist tmp cache in Docker and lock cache_timeout=0 behavior with regression tests

3. refine image generation status flow to show captcha verification after uploads
2026-03-16 21:45:34 +08:00
genz27
748505a7d3 fix: improve gemini image rendering and log previews 2026-03-14 19:33:07 +08:00
genz27
13cace4911 fix: simplify image fallback and log summaries 2026-03-14 17:38:00 +08:00
genz27
c5796307f9 Support Gemini official generateContent format 2026-03-14 16:42:26 +08:00
TheSmallHanCat
32284574ed feat: add model name resolver for Gemini generationConfig parameter-based conversion
Add a preprocessing layer before request handling that converts simplified
model names to internal MODEL_CONFIG keys based on generationConfig parameters
(aspectRatio, imageSize).

Changes:
- New src/core/model_resolver.py: model name resolution engine
  - IMAGE_BASE_MODELS: 4 base image model aliases (gemini-2.5-flash-image,
    gemini-3.0-pro-image, gemini-3.1-flash-image, imagen-4.0-generate-preview)
  - VIDEO_BASE_MODELS: 13 base video model aliases with landscape/portrait mapping
  - Supports Gemini ratio formats (16:9, 9:16, 1:1, 4:3, 3:4) and named formats
  - Supports imageSize (2k, 4k) for compatible models
  - Graceful fallback: unsupported ratio/size degrades to defaults
  - Passthrough: existing MODEL_CONFIG keys and unknown models unchanged

- Modified src/core/models.py: extended ChatCompletionRequest
  - Added ImageConfig, GenerationConfigParam Pydantic models
  - Added generationConfig, contents optional fields
  - Enabled extra='allow' for extra_body passthrough compatibility

- Modified src/api/routes.py: integrated resolver
  - Added resolve_model_name() call before request processing
  - Added /v1/models/aliases endpoint to list available aliases

Verified: 64/64 model key mappings match MODEL_CONFIG, 15 edge case tests pass.
2026-03-14 12:12:06 +08:00
genz27
d4235256dd fix: unstick generation logs and retry TLS failures 2026-03-13 21:45:30 +08:00
genz27
aa68501924 feat: improve generation log status handling 2026-03-10 10:59:57 +08:00
genz27
8dcb50ee69 feat: support disabling cache cleanup 2026-03-09 17:27:04 +08:00
genz27
e3a26155e8 feat: 优化远程打码并发调度与观测能力 2026-03-06 16:00:22 +08:00
genz27
6d4cb8bf9a feat: 支持token级打码代理并完善有头Docker双镜像发布 2026-03-03 20:03:25 +08:00
genz27
da72ff4a84 性能优化:日志按需加载与 Token/统计链路优化 2026-03-03 13:20:03 +08:00
genz27
7ecc44f14a 优化基于负载的令牌并发调度 2026-03-03 02:37:01 +08:00
genz27
cb50ea0a5c feat: 新增验证码分数测试并优化浏览器打码流程
- 后台新增 /api/captcha/score-test,支持按当前打码配置直接测分并返回详细结果
- 管理后台新增当前打码分数测试入口,展示 score、耗时、action、hostname 等信息
- 优化 browser 与 personal 模式的 reCAPTCHA 执行、页面测分、代理兼容与 UA 策略
2026-03-01 07:43:19 +08:00
genz27
e5ef238849 1.修复新模型参考图BUG
2.新增媒体上传下载独立代理
3.打码和请求的代理尽量使用一致的
4.新增代理检测
5.请求日志增加图片展示以及2K4K图片展示,完整响应
等。
2026-02-28 00:06:31 +08:00
genz27
99bedf863f 更新:1.本地打码方式修改为有头并增加并行(可设置启动浏览器数量)2.修复flow视频和图片请求体报错400 3.新增图片和视频画质提升包括4K,2K以及1080p等 4.调整管理员端配置UI布局
Co-Authored-By: Warp <agent@warp.dev>
2026-01-26 14:15:12 +08:00
TheSmallHanCat
aec69d2feb Merge branch 'main' of https://github.com/TheSmallHanCat/flow2api 2026-01-18 12:42:37 +08:00
TheSmallHanCat
49d8e1d68d feat: 支持更多打码平台 2026-01-18 12:41:38 +08:00
TheSmallHanCat
ad17d67097 Merge pull request #39 from NetLops/sz
WIP
2026-01-17 10:44:28 +08:00
Netlops
92006a0d37 feat(api): support remote image URL downloading in chat completion
- Extract image from URL or base64 instead of base64 only
- Add support for downloading remote image URLs starting with http/https
- Implement error handling for image download failures
- Add debug logging for image processing steps

fix(config): update model keys for veo_3_0 video generation

- Update veo_3_0_r2v_fast_portrait model key to
  veo_3_0_r2v_fast_portrait_ultra_relaxed
- Update veo_3_0_r2v_fast_landscape model key to
  veo_3_0_r2v_fast_ultra_relaxed
2026-01-16 17:35:56 +08:00
Netlops
063e810d8b feat(token): add automatic ST refresh functionality for personal mode
- Implement automatic ST (Session Token) refresh when AT refresh fails
- Add refresh_session_token method in BrowserCaptchaService to extract
  __Secure-next-auth.session-token from browser cookies
- Enhance token_manager to automatically retry AT refresh after ST update
- Add validation for AT tokens to ensure they are actually working
- Update README to document AT/ST automatic refresh feature
- Improve error handling and logging for token refresh operations
- Add conditional ST refresh support only available in personal mode
2026-01-08 12:32:48 +08:00
TheSmallHanCat
199b46576c feat: 完善图片生成连续对话功能 2026-01-04 17:22:32 +08:00
TheSmallHanCat
d96fe18fa5 feat: 浏览器拓展更新st自动启用token、新增ultra模型、完善日志记录显示 2026-01-04 17:22:19 +08:00
TheSmallHanCat
35d960d238 fix: 文件缓存
feat: 自动更新st接口
2025-12-25 18:21:17 +08:00
TheSmallHanCat
a1b73579fd feat: 为无头模式设置独立代理 2025-12-17 20:35:00 +08:00
TheSmallHanCat
de31fe0877 feat: 无头打码与YesCaptcha打码 2025-12-17 18:51:10 +08:00
TheSmallHanCat
ea88387d4c fix: token导入 2025-12-17 17:32:15 +08:00
TheSmallHanCat
77eaf1db3e feat: 图片模型连续对话自动上一次响应作为参考图
close #15
2025-12-14 17:00:43 +08:00
TheSmallHanCat
a1634c8562 fix: 用户名保存不生效 2025-12-14 16:58:45 +08:00
TheSmallHanCat
fcd61c692a fix: 图片模型多图支持、重置错误计数
feat: 账号类型分配模型配额
Fixes #5,#7
2025-12-01 19:12:46 +08:00
TheSmallHanCat
29f247e108 fix: 错误次数计数、调试配置持久化、用量统计计算、日志输出
Fixes #2, #3
2025-11-26 08:42:35 +08:00
TheSmallHanCat
586f720822 fix: 配置热重载、错误处理
Fixes #1
2025-11-25 20:33:28 +08:00
TheSmallHanCat
36cbcc0d8b feat:flow2api初版 2025-11-24 18:27:05 +08:00