Repository navigation
Conversation
- OAuth flow 按 realm 分域:intl=z.ai(data.zai 会话凭证需 z/login 换业务 token)、 cn=bigmodel.cn(data.bigmodel 即业务 token,免二次换取);init provider 随区域 - Account 增加 realm 字段并随导出/导入持久化;bigmodel 通道 JWT 凭证自动归位 zai/cn - 回退 API Key 业务域随区域(cn → open.bigmodel.cn),Plan 通道两端点同域不分 - 后台新增/授权登录支持区域选择;前端账号池展示区域与国内版授权引导 - Mock 上游支持 oauth_poll_realm 场景;新增 realm 单测与 cn 全流程集成测试
- 请求侧:历史轮 reasoning_content → Anthropic thinking 块(signature 空串可过); reasoning_effort low/high/max 透传上游,其余值不带(上游不支持关思考) - 响应侧:thinking 块聚合为 message.reasoning_content(DeepSeek/pi-ai 风格) - 流式:thinking_delta → reasoning_content 增量 chunk
- start.sh / start.bat:启动/停止/重启语义对齐——停旧实例(serve.pid, 优雅→强杀)、 端口占用检测、依赖自动安装、后台运行+日志、/meta 健康检查 - .gitattributes:*.bat/*.cmd 强制 CRLF(cmd 对 LF 的 goto/label 有解析怪癖) - Dockerfile + compose + .dockerignore:多阶段镜像(python3.11-slim + node22 + Debian chromium + tini + CJK 字体),数据卷 ./data,.env 不入镜像 - .gitignore:排除 serve.log/pid、.trae_*、.sg_* 等本地运行产物
…入的 socks://)时才剔除,正常环境原样启动
…cheme(如 Clash 注入的 socks://)时才剔除,正常环境原样启动 - 延迟展开(EnableDelayedExpansion):未定义变量的 %VAR:~0,7% 会在解析期坍缩破坏 if,!VAR! 执行期展开安全 - 扁平顺序判断:管道+|| 嵌套在 if 块内会解析崩坏;输出保持 ASCII(cmd 代码页下中文回显必乱码) - Windows 变量名不区分大小写,ALL_PROXY 即覆盖 all_proxy
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
自
bda8ea1(2.6.8)之后的累计变更,共 17 个提交。包含一个新协议网关、若干既有功能增强与部署/工程化改进。全量测试离线可跑(Mock 上游)。主要内容
1. OpenAI Responses API 网关(新端点
POST /v1/responses)app/responses_compat.py:responses_to_anthropic/anthropic_to_responses/ResponsesStreamConverterinstructions→system;input 条目(message/reasoning/function_call/function_call_output,兼容无type的 chat 简写发法)→ Anthropic 消息与块,相邻同角色合并reasoning.effort映射:minimal/low→low、high→high、xhigh→max(medium 即上游默认档,不带字段)stop_reason=max_tokens→incompleteevent:+data:帧、sequence_number 递增、无 [DONE] 哨兵、response.completed收尾)app/response_store.py:previous_response_id内存 LRU(256 条、线程锁、重启清零);首轮 input 同样入库,保证第二轮续接不丢首轮 user 内容_dispatch与_try_account零改动messages: []发上游换语焉不详的 12142. openai-compat thinking 透传(
b4bcab3)reasoning_content→ Anthropic thinking 块(signature 空串可过);reasoning_effortlow/high/max 透传上游message.reasoning_content;流式thinking_delta→reasoning_content增量 chunk3. OAuth 双区域登录入池(
025efd7)4. 部署与工程化
start.sh/start.bat代理兜底条件化(ALL_PROXY 为非 http(s) scheme 时才剔除);启动前剔除 ALL_PROXY 防 Clash socks:// 注入致 httpx 全量 500.gitignore凭证/杂物兜底(.sg_*、.zcode/等)5. 后台 UI 与文档跟进
docs/development/04-api-spec.md新增 §1.4 端点小节与错误表、测试文档登记 RS-001015 / INT-040045、路线图 M2 对应项打勾测试
ruff check app tests通过;mypy app/constants.py通过说明
/v1/messages(Anthropic 透传语义不变)与/v1/chat/completions(回归全绿)response_store为进程内存 LRU(与 reqlog 同哲学:定位续接便利而非持久会话,重启清零,客户端可重发全量 input 兜底)store=true未实现(上游无对应概念),文档已注明