[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-114679":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":15,"forks30d":15,"starsTrendScore":19,"compositeScore":20,"rankGlobal":9,"rankLanguage":9,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":24,"hasPages":22,"topics":25,"createdAt":9,"pushedAt":26,"updatedAt":27,"readmeContent":28,"aiSummary":29,"trendingCount":15,"starSnapshotCount":15,"syncStatus":30,"lastSyncTime":31,"discoverSource":32},114679,"workbuddy2api-hub","niyouqianma\u002Fworkbuddy2api-hub","niyouqianma","WorkBuddy2API-Hub - OpenAI-compatible local gateway",null,"Python",379,145,1,5,0,27,219,278,126,96.39,"MIT License",false,"main",true,[],"2026-11-23 07:54:18","2026-11-23 13:59:51","# WorkBuddy2API-Hub — 国际版、国内版多账号网关中枢\n\n> [!IMPORTANT]\n> **官方群聊**：[https:\u002F\u002Ft.me\u002Fwb2apihub](https:\u002F\u002Ft.me\u002Fwb2apihub)\n>\n> **凭证安全**：本项目是本地部署网关，运行时需要在本地读取用户自行导入的账号凭证，才能调用官方接口；凭证保存在用户自己的 `accounts\u002F` 目录。项目不会把凭证上传到本项目的第三方服务器，也没有隐藏的凭证收集或上传逻辑。请立即关闭公网暴露，联系官方吊销全部 OAuth \u002F 设备授权，确认旧 token 返回 `401` 后再重新授权。\n\n> [!WARNING]\n> **WorkBuddy 上游正在收紧对非官方客户端的识别与拦截。**\n>\n> - **封禁**：2026-10-23 下午起，非官方客户端的识别与拦截明显收紧。\n> - **维护者**：近期工作压力增大，无法保证及时更新与响应。\n> - **可用性**：上游可能随时进一步收紧，导致本项目不可用。\n> - **账号风险**：使用非官方客户端造成的风控、限流或封禁，由使用者自行承担。\n>\n> **Upstream enforcement** tightened detection and blocking of unofficial clients from the afternoon of 2026-10-23. The maintainer is under increased workload and cannot guarantee timely updates or replies. The upstream may tighten further at any time; rate limits, account restrictions or bans caused by using an unofficial client are the user's responsibility.\n\n本项目仅用于协议学习、研究与个人自用。请优先使用官方客户端，不要使用主账号，不要共享账号，也不要用于商业转售。\n\nThis project is for protocol research and personal use only. Prefer the official client, do not use your primary account, and do not resell or share access.\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fardeyouxipianyi\u002Fworkbuddy2api-hub\u002Freleases\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FRelease-v2.1.3-2496ED?style=flat-square\" alt=\"Version 2.1.3\">\u003C\u002Fa>\n  \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPython-3.9+-blue.svg?style=flat-square\" alt=\"Python\">\n  \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FAPI-OpenAI_Compatible-412991?style=flat-square\" alt=\"OpenAI API\">\n  \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FDual_Realm-Intl_&_CN-0DBD8B?style=flat-square\" alt=\"Dual Realm\">\n  \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-MIT-green.svg?style=flat-square\" alt=\"License\">\n  \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FMaintenance-Resumed-0DBD8B?style=flat-square\" alt=\"Maintenance resumed\">\n\u003C\u002Fp>\n\n## 核心特性\n\n- **标准 API 兼容**：将 WorkBuddy（国际版\u002F国内版）与 CodeArts 封装为标准 OpenAI 格式（Chat Completions \u002F Responses），无缝支持 Codex、Claude Code、NextChat 等各类客户端。\n- **开箱即用与多端部署**：便携版免装环境（Windows 自带精简运行时），支持 Docker、NAS（群晖\u002F飞牛）一键部署及 OpenWrt 路由器固件。\n- **多账号池与出口隔离**：支持浏览器 OAuth 快速导入、每账号独立出口代理槽绑定、设备指纹隔离、自动故障转移与配额轮转。\n- **自动化福利与签到**：内置国内版成长任务、星巴克 \u002F 记者节运营活动、小程序任务、加油站签到与猫猫旅行，支持国际版每日活跃会话与 CodeArts 自动签到；手机 App 对话、公众号关注与公益捐赠等必须真实完成的任务只提示、不伪造。\n- **可视化管理看板**：提供 Web 仪表盘，支持实时请求日志、Token\u002F积分透视、多 API Key 权限分发（模型\u002F账号白名单）与额度护栏。\n- **一键工作台启动**：`start-workbuddy-all.bat` 先用 `--probe-only` 检查端口上的实例是否健康，未运行才拉起网关并打开 WorkBuddy 工作台，避免重复启动或误连陌生服务。\n\n### 社区 Rust 版本\n\n[YTjungle666\u002Fworkbuddy2api-hub](https:\u002F\u002Fgithub.com\u002FYTjungle666\u002Fworkbuddy2api-hub) 是社区独立维护的 Rust 重写分支。网关后端与启动器均使用 Rust 实现，提供单文件静态二进制，不依赖 Python 运行时；功能以上游 `v2.0.1` 为对齐基线。它不是本仓库的官方发布物，问题反馈与版本更新请前往对应仓库。\n\n> ⚡ **Vibe Coding 产物**：本项目为 100% Vibe Coding 协同产物——人类开发者提出架构与业务意图，AI 助手端到端完成逆向分析、链路调度、WAF 指纹脱敏与界面编写。\n\n> 📌 **提交代码贡献前**：请先查看并**严格遵循**贡献手册 [`CONTRIBUTING.md`](CONTRIBUTING.md)——提交格式、测试门禁与端到端冒烟要求都在那里（AI \u002F 智能体请特别注意其中的硬性规则节）。\n\n---\n\n## 💖 赞助商\n\n> 想出现在这里？联系 [ardeyouxipianyi@gmail.com](mailto:ardeyouxipianyi@gmail.com)\n\n\u003Ctable>\n\u003Ctr>\n\u003Ctd width=\"180\" align=\"center\" valign=\"middle\">\n  \u003Ca href=\"https:\u002F\u002Fagentrouter.org\u002Fregister?aff=unrV\">\u003Cimg src=\"https:\u002F\u002Fraw.githubusercontent.com\u002F88lin\u002Fpicx-images-hosting\u002Fmaster\u002F90C5FAD072EA247822CB88BB32512A41.webp\" alt=\"Agent Router\" width=\"150\">\u003C\u002Fa>\n\u003C\u002Ftd>\n\u003Ctd valign=\"middle\">\u003Cb>\u003Ca href=\"https:\u002F\u002Fagentrouter.org\u002Fregister?aff=unrV\">Agent Router\u003C\u002Fa>\u003C\u002Fb>&nbsp;是免费公益大模型 API 平台，支持 Claude-opus-5.5、GPT-6 Astra、GPT-6.1 Sol、deepseek-v4-flash 等主流模型，国内直连。注册送 ＄175（每日签到得 ＄25，被邀得 ＄50），支持 GitHub \u002F LinuxDo 登录。\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftable>\n\n\n---\n\n## 一、快速启动\n\n### 1. 本机运行\n\n- **Windows**：双击 `start-wb-proxy.bat`（静默后台运行 + 独立日志窗口）；如需前台控制台窗口，双击 `start-wb-proxy-visible.bat`。\n- **macOS \u002F Linux**：双击 `start-wb-proxy.command` 或在终端执行 `.\u002Fstart-wb-proxy.sh [端口]`（默认 8788，需要 Python 3.9+）。\n- **局域网共享模式**：运行 `start-wb-proxy-lan.bat`（Windows）或 `.\u002Fstart-wb-proxy-lan.sh`（macOS\u002FLinux），首次启动将自动生成高强度 API Key 并在控制台打印。\n- 启动后访问：\n  - **Web 看板**：`http:\u002F\u002F127.0.0.1:8788\u002F`（默认访问密码 `admin`，首次登录请在设置中修改）\n  - **API 地址**：`http:\u002F\u002F127.0.0.1:8788\u002Fv1`\n\n### 2. Docker 部署\n\n预编译多架构镜像发布在 GHCR，无需本地构建：\n\n**方式一：一键脚本（推荐）**\n\n```bash\n# 官方源（直连 GitHub 环境）：\ncurl -fsSL https:\u002F\u002Fraw.githubusercontent.com\u002Fardeyouxipianyi\u002Fworkbuddy2api-hub\u002Fmain\u002Fquick-deploy.sh | bash\n\n# 国内网络 \u002F NAS 加速：\ncurl -fsSL https:\u002F\u002Fgh-proxy.com\u002Fhttps:\u002F\u002Fraw.githubusercontent.com\u002Fardeyouxipianyi\u002Fworkbuddy2api-hub\u002Fmain\u002Fquick-deploy.sh | sudo bash\n```\n\n> 公网部署或配合反向代理：在管道前指定 `WB_DEPLOY_MODE=public bash`，并搭配 Nginx \u002F Caddy \u002F Cloudflare Tunnel 配置 TLS。\n\n**方式二：单文件 Docker Compose**\n\n```yaml\nservices:\n  wb-proxy:\n    image: ghcr.io\u002Fardeyouxipianyi\u002Fworkbuddy2api-hub:latest\n    container_name: wb-proxy\n    restart: unless-stopped\n    ports:\n      - \"8788:8788\"\n    environment:\n      - HOST=0.0.0.0\n      - PORT=8788\n      - TZ=Asia\u002FShanghai\n    volumes:\n      - .\u002Faccounts:\u002Fapp\u002Faccounts    # 账号凭据与配置（持久化）\n      - .\u002Fusage:\u002Fapp\u002Fusage          # 用量流水日志（持久化）\n```\n\n更新镜像：`docker compose pull && docker compose up -d`。\n\nDocker 镜像在构建阶段已经编译好当前架构的 Go\u002FuTLS 桥，容器内不需要 Go。\n未设置 `WB_TLS_FINGERPRINT` 时默认 `auto`；如需彻底关闭桥，可加\n`- WB_TLS_FINGERPRINT=python`，卷中的账号、设置和用量不会因此改变。\n\n### 3. 启动入口：优先用 `-m`\n\n同一份代码、同一个账号池，`python3 wb_proxy.py` 与 `python3 -m wb_proxy` 的常驻内存差 **47-54 MB**\n（Windows 11 \u002F aarch64、Python 3.12-3.14 四套环境实测一致，见 #702）。成因仍在排查，\n但只要换成 `-m` 就能拿到这段收益——512 MB 的设备上约 10%。\n\n```bash\ncd \u002Fpath\u002Fto\u002Fworkbuddy2api-hub        # 必须先进入 wb_proxy.py 所在目录\npython3 -m wb_proxy --port 8788\n```\n\n`-m` 把**当前目录**放进 `sys.path`，而脚本方式放的是脚本所在目录，所以务必先 `cd`。\n仓库内的资源路径都基于 `__file__` 解析，不受影响。Docker 镜像和 OpenWrt 包已改用 `-m`；\nWindows \u002F macOS 的 `start-wb-proxy.*` 启动脚本暂未改动。\n\n### 4. TLS 出站桥（默认 `auto`）\n\n从本版本起，未显式配置 TLS 模式的安装默认使用 `WB_TLS_FINGERPRINT=auto`：\n网关会先尝试随包 Go\u002FuTLS 桥；桥二进制缺失、架构不支持、启动失败、桥进程运行中\n退出，或当前请求使用自定义 CA \u002F 不兼容代理时，自动回退 Python\u002FOpenSSL。\n回退只发生在当前进程内，不会反复拉起失败的桥，也不会改变原来的代理出口和证书\n校验。便捷版、Docker 和 OpenWrt 的受支持架构包都自带对应桥，用户不需要安装 Go。\n\n需要强制指定时：\n\n```sh\nWB_TLS_FINGERPRINT=python   # 强制 Python\u002FOpenSSL\nWB_TLS_FINGERPRINT=node     # 强制桥；桥不可用时报明确错误\n```\n\n`node` 模式下不要设置 `WB_TLS_BRIDGE=off`，否则会按显式关闭桥处理而走 Python。\nOpenWrt 使用 `uci set workbuddy2api.main.tls_mode='auto'`、`'node'` 或 `'python'`。\n实际模式、最近路线和回退原因可在 `\u002Fhealth`、`\u002Fsettings` 及面板网络设置中查看。\n降级到不识别 `auto` 的旧版本前，请临时设置 `WB_TLS_FINGERPRINT=python`。\n逐路径头顺序、代理\u002F桥头隔离和未修改项见\n[`docs\u002FOUTBOUND-HEADER-AUDIT.md`](docs\u002FOUTBOUND-HEADER-AUDIT.md)。\n\n### 5. CodeArts 原生第三出口\n\n网关内置进程内直连华为云 CodeArts，支持聊天 SSE 协议转换与自动签到，无需单独运行第三方桥接服务：\n1. 打开看板 →「设置 → CodeArts 接入」，勾选「启用 CodeArts 出口」并保存；\n2. 切换至看板顶部「CodeArts」视图，点击「+ 添加账号 (OAuth)」完成华为云授权；\n3. 在「设置 → API Key」中新建 Key 并绑定出口为 `CodeArts`（或全局通用）即可调用。\n\nCodeArts 的模型 ID 按上游目录**精确匹配**：`deepseek-v4.1-flash` 与\n`deepseek-v4.1-flash-1017` 是两个独立模型，不会互相别名或静默回退。\n`\u002Fv1\u002Fmodels?realm=codearts` 返回的是账号当前可用的真实目录 ID；调用时请直接使用\n返回的完整 ID。\n\n---\n\n## 二、账号接入与 API Key 权限\n\n### 1. 账号添加与代理出口绑定\n- 打开看板 `http:\u002F\u002F127.0.0.1:8788\u002F`，点击「+ 添加账号 (OAuth)」，在浏览器中完成官方登录授权即可自动入库。\n- **独立代理出口槽（Proxy Slot）**：在看板中可按需配置并命名 HTTP\u002FSOCKS5 出口代理（支持账号密码认证），支持将账号与特定代理槽位绑定，账号身份请求与出站调用均自动走该代理。\n\n### 2. 多 API Key 权限管理\n- 「设置」页支持创建多个独立 API Key：\n  - **出口绑定**：可固定走国际版、国内版或 CodeArts；\n  - **模型限制**：支持通配符白名单（如 `deepseek*`, `gpt-6-astra`），违规请求本机直接返回 400；\n  - **账号白名单**：可精确限定该 Key 仅允许调度的账号范围；\n  - **用量透视**：数据看板按 Key 独立统计调用次数、Token 消耗、缓存命中与积分。\n\n---\n\n## 三、客户端接入配置\n\n- **Base URL**：`http:\u002F\u002F127.0.0.1:8788\u002Fv1`（局域网为 `http:\u002F\u002F\u003C局域网IP>:8788\u002Fv1`）\n- **API Key**：看板「设置」中添加并绑定的 Key\n- **模型名称**：调用 `\u002Fv1\u002Fmodels` 中列出的任意官方对齐模型 ID（如 `deepseek-v4.1-flash`, `gpt-6-astra`, `hy3`）\n\n**Codex CLI \u002F Responses API**\n\n```bash\nexport OPENAI_BASE_URL=\"http:\u002F\u002F127.0.0.1:8788\u002Fv1\"\nexport OPENAI_API_KEY=\"你在看板设置中添加并绑定的API_Key\"\n```\n\n**Claude Code \u002F Anthropic Messages（实验性）**\n\n网关支持实验性 Messages 协议适配，因长会话缓存命中率差异，默认关闭：\n```bash\n# 网关端设置 WB_ENABLE_ANTHROPIC_MESSAGES=1 开启后生效：\nexport ANTHROPIC_BASE_URL=\"http:\u002F\u002F127.0.0.1:8788\"\nexport ANTHROPIC_API_KEY=\"你在看板设置中添加并绑定的API_Key\"\n```\n\n---\n\n## 四、常用环境变量\n\n| 环境变量 | 默认值 | 说明 |\n|---|---|---|\n| `PORT` | `8788` | 网关监听端口 |\n| `API_KEY` | 自动生成 | 初始 API Key（看板配置多 Key 后优先由看板管理） |\n| `WB_DEPLOY_MODE` | `lan` | 部署模式：`lan`（0.0.0.0）、`local`（127.0.0.1）、`public` |\n| `WB_MAX_PAYLOAD_BYTES` | `16777216` | 单请求体上限（字节，默认 16MB，支持 1–256 MB） |\n| `WB_CHAT_SLOT_WAIT` | `30` | 并发槽位的等待秒数：全局对话槽位与 Key 级 `concurrency_limit` 共用这个预算，等到才有名额，超时仍按 429 拒绝 |\n| `WB_ENABLE_ANTHROPIC_MESSAGES` | `0` | 是否开启实验性 Anthropic Messages 协议转换 |\n| `WB_BACKGROUND_MODEL_TARGET` | 留空 | 后台模型别名改写目标（如 DSH 客户端自动映射） |\n| `WB_CA_BUNDLE` | 留空 | 自签根证书路径（供抓包调试或中间代理使用） |\n| `WB_CN_CHAT_UPSTREAM` | 官方默认 | 国内版出站代理地址 |\n| `WB_IDENTITY_OS` | 宿主系统 | 仅 CLI 身份：覆盖 `x-stainless-os`（如 `Linux` \u002F `Windows`） |\n| `WB_IDENTITY_ARCH` | 宿主架构 | 仅 CLI 身份：覆盖 `x-stainless-arch`（如 `x64` \u002F `arm64`） |\n| `WB_IDENTITY_NODE_VERSION` | 官方默认 | 仅 CLI 身份：覆盖 `x-stainless-runtime-version` |\n| `WB_SANITIZE_LOOSE_BILLING` | `0` | 计费头的宽松兜底：严格解析认不出时，按「像计费头」（含 ≥2 个 `cc_*=` \u002F `cch=` 键值、且不超过 400 字符）整段删除。默认关闭，保持 #853 之后的严格语义；客户端改字段名导致每轮前缀命中率归零时才需要打开 |\n| `WB_MSGSTAT_SHARDS` | `0` | 单发 `\u002Fv1\u002Fmessages` 请求收敛到几个账号上（0 = 关闭）。打开后同一 *(key, 模型, system, tools)* 组合的一次性调用固定复用 ≤N 个账号，避免被首条 user 文本打散到整池；上游 prompt 缓存按账号存放，换号即整段重付 |\n| `WB_MSGSTAT_DAILY_SALT` | `1` | 上一条的亲和键带当天日期盐，每天各桶重新开一次；`0` 关闭（键跨天不变） |\n\n遇到上游 `400 \u002F 11-128` 时，先按 [`docs\u002FTROUBLESHOOTING-11-128.md`](docs\u002FTROUBLESHOOTING-11-128.md) 收集同一请求的\n身份、最小请求和提示词对照结果；不要先轮换账号。\n\n---\n\n## 五、主要 API 端点\n\n| 接口 | 方法 | 端点 | 说明 |\n|---|---|---|---|\n| 聊天补全 | `POST` | `\u002Fv1\u002Fchat\u002Fcompletions` | 标准 OpenAI 聊天接口（支持流式 SSE 与思维链回填） |\n| 交互式响应 | `POST` | `\u002Fv1\u002Fresponses` | OpenAI Responses 协议接口（Codex 专用） |\n| 模型目录 | `GET` | `\u002Fv1\u002Fmodels` | 获取当前出口对齐的官方可用模型列表 |\n| 生图 | `POST` | `\u002Fv1\u002Fimages\u002Fgenerations` | 文生图 \u002F 图生图（始终可用，按媒体号池自动选出口） |\n| 生视频 | `POST` | `\u002Fv1\u002Fvideos` | 异步生视频任务提交（本地并发排队与空闲调度） |\n| 视频状态 | `GET` | `\u002Fv1\u002Fvideos\u002F\u003Cid>` | 轮询视频生成进度与结果 |\n| 产物下载 | `GET` | `\u002Fv1\u002Fvideos\u002F\u003Cid>\u002Fcontent` | 下载视频 MP4 产物直链 |\n| 健康检查 | `GET` | `\u002Fhealth` | 网关运行状态、可用账号数与就绪模型分布 |\n\n---\n\n## 六、测试验证\n\n```bash\npython tests\u002Frun_all.py            # 全部套件\npython tests\u002Frun_all.py realm      # 只跑名字里含 realm 的\n```\n\n- 306 个套件：229 个 Python + 77 个 JS；JS 需要 PATH 上有 `node`，缺失时会跳过并提示。\n- `tests\u002F_mobile_check.py` 是独立的 Playwright 手机\u002F桌面布局检查器（需自行安装 Playwright），按需手动运行，不在上面的套件集里。\n- `tests\u002F_visual_recent.py` 是同一类手动检查器：用合成 fixture 起一份 1480 宽的「请求列表」，验证失败徽章点开的详情弹窗、四个过滤下拉真的把参数发到 `\u002Fusage\u002Frecent`，并把列表 \u002F 弹窗 \u002F 筛选条截图写到系统临时目录的 `wb-visual-recent\u002F`。\n- CI（`.github\u002Fworkflows\u002Ftests.yml`）跑同一条命令：Ubuntu 上 python 3.9 与 3.12（3.9 是本项目声称的最低版本），Windows 上 python 3.12；推送 `v*` tag 时额外断言 **tag == 源码版本**（`-ci` 演练 tag 豁免）。\n\n---\n\n## 七、版本更新记录 (Changelog)\n\n本版更新与完整历史版本请查阅 **[docs\u002FCHANGELOG.md](docs\u002FCHANGELOG.md)**。\n### v2.1.3\n\n- **运营活动与成长任务补全**：新增星巴克协作、记者节福利活动，接入任务读取、`viewed`、事件上报、`claim` 与 `claimed_at` 回读；技能分享改为创建真实分享渠道并确认进度后领奖；模板任务按服务端场景逐组上报四事件。手机 App 对话任务只提示、不伪造。\n- **CodeArts 并发占满改为有界排队**（#886 \u002F #887）：单账号并发槽被占满时最多等待 `busy_wait_seconds`（默认 10 秒），名额释放立即唤醒；超时返回可重试的 429，不再误报 502「没有可用的账号」。真正空池 \u002F 全停用 \u002F 全冷却仍提示添加账号。\n- **工具 Schema 关键字类型纠偏**（#885）：数字、布尔、字符串约束字段统一纠偏，并拒绝 `NaN \u002F Infinity`，修复上游 code 11129。\n- **清理合并遗留的重复顶层定义**（#888），避免后续维护误改到不生效的旧定义。\n- **统计时区开关（北京时间）**：设置 →「日志与系统」新增「统计时区」卡片（`settings.json` 键 `stats_tz_beijing`，`\u002Fsettings\u002Fsave` 只收 JSON 布尔，默认关闭）。关闭时全部时间按服务器所在时区显示与分桶，与上游一致；勾选后统一按北京时间（固定 UTC+8）计算日志时间戳、请求记录、撞线 \u002F 重置时刻、今日活动、用量日 \u002F 小时分桶、签到日期、额度重置日与导出文件名。落盘仍存 epoch，切换只影响展示与日历日计算，保存后立即生效。实现用固定偏移而不是 `TZ=Asia\u002FShanghai` + `tzset()`：中国自 1991 年起无夏令时，固定偏移不需要 tzdata，Windows 没有 `tzset`、musl \u002F OpenWrt 镜像常缺 zoneinfo 也能正确工作。 \u002F A statistics-timezone switch (Settings → Logs & system) now offers Beijing time: `stats_tz_beijing` in `settings.json`, a strict JSON boolean on `\u002Fsettings\u002Fsave`, off by default. With it off every time is shown and bucketed in the host timezone exactly as before; switched on, log timestamps, request rows, limit-hit and reset moments, today's activity, usage day\u002Fhour buckets, check-in dates, quota reset days and export filenames all use a fixed UTC+8. Epochs are still what gets stored, so the switch only changes display and calendar-day maths, and it takes effect on save. The implementation uses a fixed offset rather than `TZ=Asia\u002FShanghai` + `tzset()`: China has had no DST since 1991, so no tz database is needed, which keeps it correct on Windows (no `tzset`) and on musl \u002F OpenWrt images that ship without zoneinfo.\n\n- **请求列表：失败看得进去、筛得出结果**：结果列里的「失败 \u002F 上游中断 \u002F 客户端取消」改成可点按钮，点开是一层详情弹窗——HTTP 状态码、上游原话（落盘时已截断 200 字）、账号、API Key、模型、耗时、模式、token 与请求类型，可一键复制；行上不再为它多占一列。筛选条移到标题下方（表格之上），新增「结果（全部 \u002F 成功 \u002F 失败）\u002F 账号 \u002F 模型 \u002F Key」四个下拉，全部走服务端 `GET \u002Fusage\u002Frecent?account=&model=&key=&outcome=`：日志上百万行时不是只筛当前页，而是向后最多扫描 `WB_RECENT_FILTER_SCAN`（默认 20000）行；扫到上限时返回 `total_exact=false` 与 `scanned=N`，界面写明「已扫描 N 行，命中 M 条（可能还有更早的）」，不假装知道全量。「失败」是个桶：`failed` \u002F `upstream_aborted` \u002F `client_aborted` 都算没成功。账号 \u002F 模型 \u002F Key 三个下拉恒带搜索框（`data-cs-search=\"on\"`），几十上百条也不用翻。 \u002F **Request list: failures readable, results filterable**: the outcome cell's \"failed \u002F upstream aborted \u002F client aborted\" badges are buttons now, opening a detail dialog with the HTTP status, the upstream message as recorded (already truncated to 200 chars), account, API key, model, elapsed time, mode, token counts and request type, copyable in one click - with no extra column spent on the row. The filter bar moves above the table and gains outcome (all \u002F succeeded \u002F failed), account, model and key dropdowns, all served by `GET \u002Fusage\u002Frecent?account=&model=&key=&outcome=`: with millions of log lines the filter is not limited to the current page - it scans back at most `WB_RECENT_FILTER_SCAN` (default 20000) rows and reports `total_exact=false` plus `scanned=N` when it hits that cap, so the UI says \"scanned N rows, M matched (older rows may exist)\" instead of pretending to know the total. \"Failed\" is a bucket: `failed` \u002F `upstream_aborted` \u002F `client_aborted` all count as not-succeeded. The account \u002F model \u002F key dropdowns always carry a search box (`data-cs-search=\"on\"`), so a few hundred entries do not have to be scrolled by hand.\n- **账号页批量操作统一按「勾选否则当前筛选结果」定作用范围**：刷新积分 \u002F 刷新凭证 \u002F 测试 \u002F 分配代理 \u002F 切换所有出站身份 \u002F 启用 \u002F 停用原来各写一套口径（有的刷整池、有的只认分组），现在统一走 `acctScopeUids()`——有勾选只作用于勾选的账号，没有勾选则作用于当前筛选结果的全部账号（视图 + 号池 + 搜索 \u002F 状态 \u002F 分组 \u002F 错误码，且不分页，避免「全部」只作用当前页）。批量挪号池仍要求先勾选：号池归属是一次明确的指派，没有勾选无从下手。`\u002Faccounts\u002Frefresh`、`\u002Faccounts\u002Ftest`、`\u002Faccounts\u002Fproduct` 新增 `uids` 点名，空列表即什么都不做，不退化成全池；`\u002Faccounts\u002Fset-all` 原本就要求显式 UID 列表。按钮同时去掉「一键」前缀（刷新积分 \u002F 刷新凭证 \u002F 测试 \u002F 分配代理 \u002F 切换所有出站身份 \u002F 启用 \u002F 停用），「当前分组启用 \u002F 停用」保留。 \u002F The account page's bulk actions now share one scope rule: \"Refresh credits\", \"Refresh tokens\", \"Test\", \"Assign proxy exits\", \"Switch all outbound identities\", \"Enable\" and \"Disable\" each used to compute their own target set (some hit the whole pool, some only the group filter). They now all go through `acctScopeUids()`: the ticked accounts when there are any, otherwise the whole current filter result (view + pool + search \u002F status \u002F group \u002F error code, and not just the current page, so \"all\" does not silently mean \"this page\"). Moving accounts between pools still requires a selection, because a pool assignment is an explicit choice. `\u002Faccounts\u002Frefresh`, `\u002Faccounts\u002Ftest` and `\u002Faccounts\u002Fproduct` accept a `uids` list now; an empty list does nothing instead of falling back to the whole pool, and `\u002Faccounts\u002Fset-all` already required an explicit UID list. The \"一键\" prefix is dropped from those buttons while \"Enable \u002F Disable current group\" keeps its name.\n- **号池筛选常显并改为下拉框**：账号表的号池筛选不再跟随「文本 \u002F 媒体号池隔离」开关隐藏——`poolScope` 是账号的归属标记，隔离关着时它只影响服务端派发，不影响这个字段可查可改。三个互斥按钮（全部 \u002F 文本 \u002F 媒体）换成一个下拉框，默认「全部号池」，选中即生效；账号行的号池徽章同样恒显示，「移入媒体池 \u002F 移入文本池」不再要求先开隔离。移动端号池组排成一行（下拉 + 计数 + 两个按钮），不再各占一行把账号列表推下去。 \u002F The pool filter no longer hides behind the pool-separation switch: `poolScope` is an account's ownership tag, and the switch only affects server-side dispatch, not whether the field can be seen or changed. The three mutually exclusive buttons become one dropdown (All \u002F Text \u002F Media, default All, applied immediately); the pool badge on each row is always shown, and \"Move to media pool\" \u002F \"Move to text pool\" no longer require the switch. On phones the pool group sits on a single row (dropdown + counter + two buttons) instead of pushing the account list down.\n- **模型别名开关**：`model_aliases` 之前只是一张无条件生效的映射表——填进去的别名立刻对所有客户端可见、所有请求都会被改写，运维想「先填好但暂不生效」没有手段。新增 `model_aliases_enabled`（缺省关闭，旧配置升级后行为不变），关闭时别名既不进 `\u002Fv1\u002Fmodels` 也不改写请求，原模型名照常可用；开启后别名与原名都可用，别名在模型清单里紧跟其目标模型列出。面板「设置 → 模型与定价」新增开关，「网关 → 模型清单」新增行内「对外名称」列（开关关闭时整列隐藏），支持直接编辑单个模型的对外名称。配套：别名请求的应答回显客户端发来的名字（`client_facing_model`），配了模型限制的 Key 用别名调用不再被网关自己的改写拦下，`\u002Fsettings` 与 `\u002Fsettings\u002Fsave` 读写 `model_aliases` \u002F `model_aliases_enabled`。 \u002F **Model alias switch**: `model_aliases` used to be an unconditionally applied mapping table - any alias typed in was immediately visible to every client and rewritten on every request, with no way to stage a table without activating it. A new `model_aliases_enabled` key (off by default, so upgrades keep the old behaviour) gates it: while off, aliases are neither listed in `\u002Fv1\u002Fmodels` nor rewritten, and the original model names keep working; while on, aliases and original names both work and each alias is listed right next to its target. The panel gains a switch under Settings -> Models & pricing and an inline \"External name\" column in the gateway model catalog (the whole column hides while the switch is off), editable per model. Supporting changes: replies echo the name the client sent (`client_facing_model`), a key restricted to an alias is no longer rejected by the gateway's own rewrite, and `\u002Fsettings` plus `\u002Fsettings\u002Fsave` read and write `model_aliases` \u002F `model_aliases_enabled`.\n- **账号页桌面布局重排**：账号表改为跟随容器宽度（`width:100%` + `min-width:1096px` 只作横向滚动兜底），上一版写死 `min-width` 让容器窄时右侧列被固定操作列盖住，「Token \u002F 缓存」看着像被裁掉；各列按实测内容定宽，多余宽度全给账号列。勾选列、版本列、账号列三列常驻左侧吸附（偏移 0 \u002F 32 \u002F 100px），横向滚动时不会只剩一排认不出归属的数据。桌面昵称允许折行、完整显示（此前 `nowrap + ellipsis` 把长昵称裁成「changzhan…」）。任务开关 \u002F 备注 \u002F 分组收到账号行内同一排（`.acct-chip-row`）。 \u002F **Desktop account table re-layout**: the table now follows its container (`width:100%` with `min-width:1096px` only as a horizontal-scroll fallback); the previous fixed `min-width` let the sticky actions column cover the right-hand columns on narrower containers, so \"Token \u002F Cache\" looked cut off. Columns are sized to their measured content and the leftover width goes to the account column. The checkbox, version and account columns stay pinned to the left (offsets 0 \u002F 32 \u002F 100px) so a horizontally scrolled row never becomes an unidentifiable strip. Desktop nicknames wrap and show in full (they used to be clipped to \"changzhan...\" by `nowrap + ellipsis`). The task switch, note and group chips sit on one row inside the account cell (`.acct-chip-row`).\n- **账号页移动端卡片分层**：第一行「勾选 + 昵称 + 版本 \u002F 账户类型徽章」，第二行「号池 + 任务开关 + 备注 + 分组」chip 流；状态徽章与到期信息各归其行，长昵称按字符折行不超屏。启用 \u002F 停用 \u002F 删除三个按钮在手机上排成一行（各占 1\u002F3），删除紧跟停用。批量操作组改成两列网格（6 个按钮 3 行 2 列），按钮文字不再被压成竖排。号池组（下拉 + 计数 + 两个「移入」）排成一行。 \u002F **Mobile account card layering**: the first row is \"checkbox + nickname + version \u002F account-type badges\" and the second row is a chip flow of \"pool + task switch + note + group\"; the state badge and expiry each get their own line, and long nicknames wrap by character instead of overflowing. Enable \u002F Disable \u002F Delete sit on one row on phones (one third each) with Delete right after Disable. The bulk-action group becomes a two-column grid (six buttons over three rows), so button labels are no longer squeezed into vertical text. The pool group (dropdown + counter + two \"move\" buttons) sits on a single row.\n- **启用 \u002F 停用 \u002F 删除 \u002F 导出统一作用域**：四个「xx 已选」独立按钮移除，能力并进「启用 \u002F 停用 \u002F 删除 \u002F 导出」——有勾选时以勾选为准，没有勾选时以当前筛选结果为准；勾选时按钮上标出数量（如「启用 (2)」），确认框写明本次范围。表头全选框改为作用于当前筛选结果（跨页），三态也按筛选结果回填。 \u002F **One scope for enable \u002F disable \u002F delete \u002F export**: the four \"xx selected\" buttons are gone and their behaviour folded into Enable \u002F Disable \u002F Delete \u002F Export - checked accounts when anything is selected, otherwise the current filter result; the buttons show the count when a selection exists (e.g. \"Enable (2)\") and the confirmation dialog names the scope. The header select-all now applies to the whole filter result (across pages) and its tri-state is filled from that same set.\n- **表头文案缩短**：「今日活动」→「活动」、「总 token」→「Token」（全称保留在 `title` 里），省出的宽度给账号列。 \u002F **Shorter header labels**: \"Today's activity\" -> \"Activity\" and \"Total tokens\" -> \"Token\" (the full wording stays in `title`), freeing width for the account column.\n\n---\n\n## 八、致谢与引用声明 (Credits & References)\n\n在协议逆向、风控规避、任务链路与工程化设计过程中，本项目参考、吸纳并致谢以下优秀开源项目与技术成果（排名不分先后）：\n\n### 核心逆向与协议参考\n- **[Sliverkiss\u002Fworkbuddy2api](https:\u002F\u002Fgithub.com\u002FSliverkiss\u002Fworkbuddy2api)**：成长任务逆向、设备指纹派生（`derive_id`）、调度器（`Scheduler`）与 `reasoning_content` 回填设计；\n- **[L0NE-6\u002FWorkBuddy-Daily](https:\u002F\u002Fgithub.com\u002FL0NE-6\u002FWorkBuddy-Daily)**：国内版微信小程序专属事件指纹与动态专家深链任务模型；\n- **[88lin\u002Fworkbuddy-auto-signin](https:\u002F\u002Fgithub.com\u002F88lin\u002Fworkbuddy-auto-signin)**：猫猫日常旅行与成长能量开盲盒（Buddy 盲盒）安全生命周期；\n- **[linguo2625469\u002Fworkbuddy2api-panel](https:\u002F\u002Fgithub.com\u002Flinguo2625469\u002Fworkbuddy2api-panel)**：国内版连登管家闭环逻辑与轻量对话活跃上报事件；\n- **[misakano7545\u002Fworkbuddy2api-panel](https:\u002F\u002Fgithub.com\u002Fmisakano7545\u002Fworkbuddy2api-panel)**：Go\u002FuTLS Node\u002FOpenSSL ClientHello 指纹参数与桥接实现参考（18 Cipher、10 Extension、无 ALPN）；\n- **[Zhengyuuuui\u002Fworkbuddy2api](https:\u002F\u002Fgithub.com\u002FZhengyuuuui\u002Fworkbuddy2api)**：国际版 11140 账号封禁识别、冷却规避与故障排查清单；\n- **[yuanyuanyuan430\u002Fworkbuddy2api-hub](https:\u002F\u002Fgithub.com\u002Fyuanyuanyuan430\u002Fworkbuddy2api-hub)**：国际版 EdgeOne CDN 证书错配排查与活跃上报优雅降级方案；\n- **[CangShui\u002Fworkbuddy-cliproxy-fix](https:\u002F\u002Fgithub.com\u002FCangShui\u002Fworkbuddy-cliproxy-fix)** & **[lovingfish\u002Fworkbuddy-cliproxy](https:\u002F\u002Fgithub.com\u002Flovingfish\u002Fworkbuddy-cliproxy)**：早期客户端代理修复与网关通信原型；\n- **[mmqz\u002Fcpa-multi-plugins](https:\u002F\u002Fgithub.com\u002Fmmqz\u002Fcpa-multi-plugins)**：多插件管理与出站调度结构参考；\n- **[ardeyouxipianyi\u002Fworkbuddy2api](https:\u002F\u002Fgithub.com\u002Fardeyouxipianyi\u002Fworkbuddy2api)**：国内版早期分发包逆向分析与出站 User-Agent 规范；\n\n### 工程化与生态基础\n- **[aodianjun\u002Fworkbuddy2api-hub](https:\u002F\u002Fgithub.com\u002Faodianjun\u002Fworkbuddy2api-hub)**：OpenWrt 路由器打包配方（`.ipk` \u002F `.apk`）与系统服务支持；\n- **[YTjungle666\u002Fworkbuddy2api-hub](https:\u002F\u002Fgithub.com\u002FYTjungle666\u002Fworkbuddy2api-hub)**：社区维护的 Rust 后端与启动器重写分支，提供无 Python 运行时依赖的单文件静态二进制；\n- **[astral-sh\u002Fpython-build-standalone](https:\u002F\u002Fgithub.com\u002Fastral-sh\u002Fpython-build-standalone)**：Windows 便携版免安装精简独立 Python 运行时构建基石；\n- **[deepseek-ai\u002Fdeepseek-harness](https:\u002F\u002Fgithub.com\u002Fdeepseek-ai\u002Fdeepseek-harness)**：DSH 客户端协议与提示词指纹清洗规避参考。\n\n感谢所有向本项目提交 PR、反馈 Issue 与分享实测样本的社区贡献者！\n\n---\n\n## 九、免责声明 (Disclaimer)\n\n本项目仅用于协议学习与个人开发测试，不提供任何商业服务或可用性担保。因使用非官方客户端产生的账号风控、限制或封禁由使用者自行承担，请优先使用官方客户端。\n\n## ⭐ Star 趋势\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fstar-history.com\u002F#ardeyouxipianyi\u002Fworkbuddy2api-hub&Date\">\n    \u003Cimg src=\"https:\u002F\u002Fapi.star-history.com\u002Fsvg?repos=ardeyouxipianyi\u002Fworkbuddy2api-hub&type=Date\" alt=\"Star History Chart\" width=\"760\">\n  \u003C\u002Fa>\n\u003C\u002Fp>\n","WorkBuddy2API-Hub 是一个本地部署的 OpenAI 兼容网关，用于将 WorkBuddy（国际版与国内版）及 CodeArts 的私有 API 封装为标准 OpenAI Chat Completions 接口。核心功能包括多账号凭证管理、设备指纹隔离、出口代理绑定、自动签到与任务提示、可视化 Web 看板及一键工作台启动；技术上支持 Python 原生运行、Docker\u002FNAS\u002F路由器部署，并严格保障凭证本地存储、不上传、不联网上报。适用于个人研究、协议学习及小规模自用场景，不推荐主账号或商业用途。",2,"2026-11-24 04:49:21","CREATED_QUERY"]