Releases: CJackHwang/ds2api
v3.3.0
补丁
专家模式适配(更多模型)
客户端校验版本号升级
注意
该版本(v3.3.0)以前的旧版本已全部失效,请更新至最新以保障功能可用
快速模式下上下文窗口限制1M,专家模式下上下文窗口限制40k
(暂无计划更新多轮对话缓存机制,这会限制已经大于40k上下文的对话无法使用,加上近期DeepSeek客户端变动大,看看后续是否会放开限制)
What's Changed
- Add default, expert, and vision DeepSeek model families by @shuaihaoV in #249
- Merge pull request #249 from shuaihaoV/feat/deepseek-model-type-families
Add default, expert, and vision DeepSeek model families by @CJackHwang in #252
New Contributors
- @shuaihaoV made their first contribution in #249
Full Changelog: v3.2.0...v3.3.0
v3.2.0
版本更新摘要 (v3.2.0)
成就:此v3.2版本与DeepSeek现阶段一致
1. 新增功能与核心增强
- 代理管理与路由 (Feature): 引入了对 SOCKS5/SOCKS5H 代理的管理功能,支持账号级别的代理路由配置,大幅提升了网络环境的适配能力。
- 原生 PoW 解算器 (Refactor): 重构了 Proof of Work (PoW) 模块,将原有的 WASM 实现替换为原生 Go 实现。这一改动显著提升了解算效率并降低了跨平台运行的复杂性。
- 工具调用优化 (Tool Call):
- 改进了 XML 工具解析的鲁棒性。
- 修复了工具调用参数中 HTML 字符被转义的问题。
- 解决了标记语言(Markup)解析中 XML 实体的双重解码 Bug。
2. 接口与数据处理
- Token 统计优化: * 改进了 DeepSeek SSE 流式输出中的 Token 使用量传播逻辑。
- 临时切换至内部 Token 估算算法,以解决上游字段不一致的问题,确保计费与统计的准确性。
- 异常处理: * 当上游输出为空时,现在会正确返回 429 错误码。
- 增强了 SSE Token 重放解析的安全硬化。
- 优化了代理失败时的回退(Fallback)行为,并对响应中的代理密码进行了脱敏处理。
3. 代码质量与工程化
- Linter 升级: 全面迁移至 golangci-lint v2,重新组织了配置文件,并新增了 CI 门禁(Gate),确保代码提交符合规范。
- 错误处理规范化: 规范了全局错误消息格式,并妥善处理了 Close() 调用的延迟错误。
- 依赖更新: 升级了前端 WebUI 的 Vite 版本及其他后端核心依赖。
4. 文档与结构
- 架构文档: 新增了系统架构文档,并对文档索引进行了集中管理。
- README 优化: 移除了各子目录下重复的项目结构介绍,使文档更加简洁清晰。
What's Changed
- Dev by @CJackHwang in #219
- Migrate and reorganize .golangci.yml to v2 with updated linters and exclusions by @CJackHwang in #220
- Handle deferred Close errors, normalize error messages, and add nolint annotations by @CJackHwang in #226
- Treat missing golangci-lint as bootstrap-compatible by @CJackHwang in #225
- Fix lint bootstrap behavior and harden SSE token replay parsing by @CJackHwang in #224
- Add golangci-lint bootstrap and CI lint gate; update docs and .gitignore by @CJackHwang in #222
- Dev by @CJackHwang in #221
- fix(openai): return 429 for empty upstream output by @CJackHwang in #227
- refactor: replace WASM-based PoW solver with a native Go implementation in the pow package by @CJackHwang in #229
- chore(deps-dev): bump vite from 8.0.3 to 8.0.5 in /webui in the npm_and_yarn group across 1 directory by @dependabot[bot] in #231
- 依赖升级 by @CJackHwang in #233
- Propagate DeepSeek SSE token usage to /v1/responses and remove stale POW env docs by @CJackHwang in #234
- refactor: improve XML tool parsing robustness, update system prompt constraints, and simplify tool filtering logic by @CJackHwang in #232
- docs: add architecture docs and centralize documentation index; update READMEs and API links by @CJackHwang in #236
- docs: remove duplicated project structure sections from READMEs by @CJackHwang in #238
- Fix HTML-escaped tool-call args and preserve upstream token usage (stream & non-stream) by @CJackHwang in #239
- fix: avoid double-decoding XML entity text in markup tool-call parsing by @CJackHwang in #242
- Merge pull request #239 from CJackHwang/codex/fix-escaping-issues-and-token-counting
Fix HTML-escaped tool-call args and preserve upstream token usage (stream & non-stream) by @CJackHwang in #240
- feat: 增加 SOCKS5/SOCKS5H 代理管理与账号代理路由 by @tanaer in #241
- Temporarily ignore DeepSeek upstream usage fields and prefer internal token estimation by @CJackHwang in #244
- Fix proxy-bound fallback behavior and redact proxy password responses by @CJackHwang in #246
- Merge pull request #244 from CJackHwang/codex/temporarily-switch-to-internal-usage-count
Temporarily ignore DeepSeek upstream usage fields and prefer internal token estimation by @CJackHwang in #245
New Contributors
- @dependabot[bot] made their first contribution in #231
- @tanaer made their first contribution in #241
Full Changelog: v3.1.1...v3.2.0
v3.1.2_beta
What's Changed
- Dev by @CJackHwang in #219
- Migrate and reorganize .golangci.yml to v2 with updated linters and exclusions by @CJackHwang in #220
- Handle deferred Close errors, normalize error messages, and add nolint annotations by @CJackHwang in #226
- Treat missing golangci-lint as bootstrap-compatible by @CJackHwang in #225
- Fix lint bootstrap behavior and harden SSE token replay parsing by @CJackHwang in #224
- Add golangci-lint bootstrap and CI lint gate; update docs and .gitignore by @CJackHwang in #222
- Dev by @CJackHwang in #221
Full Changelog: v3.1.1...v3.1.2_beta
v3.1.1
修复接续流思考重复问题
更新文档
优化调试工具链
What's Changed
- Dev by @CJackHwang in #217
- fix: reverse snapshot order to preserve capture sequence during stabl… by @CJackHwang in #218
Full Changelog: v3.1.0...v3.1.1
v3.1.0
DS2API v3.1.0 更新要点:
- 增强 XML 工具调用解析:提升了 tool-name 识别率并修复了 tool sieve 中的透传问题。
- 优化 SSE 流稳定性:自动忽略 INCOMPLETE 状态消息,自动续接长时间思考,防止流式输出意外中断。
- 改进输出过滤:在移除 CONTENT_FILTER 标签时会保留末尾换行符,确保排版正常。
- 异常处理:修正上游空输出的分类逻辑,现在会统一返回 429 错误。
- 开发环境:本地 go run 现已支持自动加载 .env 和 config.json 配置文件。
- 修复md格式吞空格的问题。
- 更新项目配置和vite等依赖版本,更新各种配置导入校验,新增仿真测试脚本和工具链,完善修正文档。
- 优化模型上下文理解。
What's Changed
- Fix XML passthrough in tool sieve and return 429 on empty upstream output by @CJackHwang in #207
- Preserve trailing newlines when stripping leaked CONTENT_FILTER and strengthen XML tool-call parsing by @CJackHwang in #209
- fix: classify empty upstream output correctly and harden XML tool-name parsing by @CJackHwang in #212
- Merge pull request #209 from CJackHwang/codex/investigate-command-output-loss-issue
Preserve trailing newlines when stripping leaked CONTENT_FILTER and strengthen XML tool-call parsing by @CJackHwang in #211
- Load .env and config.json for local go runs by @Kazakiri220 in #213
- Dev by @CJackHwang in #214
- fix: ignore INCOMPLETE status messages in SSE stream parsing to prevent stream interruption by @CJackHwang in #215
New Contributors
- @Kazakiri220 made their first contribution in #213
Full Changelog: v3.0.0...v3.1.0
v3.1.0_beta
优化众多已知问题,提升代码输出可用性
What's Changed
- Fix XML passthrough in tool sieve and return 429 on empty upstream output by @CJackHwang in #207
- Preserve trailing newlines when stripping leaked CONTENT_FILTER and strengthen XML tool-call parsing by @CJackHwang in #209
- fix: classify empty upstream output correctly and harden XML tool-name parsing by @CJackHwang in #212
- Merge pull request #209 from CJackHwang/codex/investigate-command-output-loss-issue
Preserve trailing newlines when stripping leaked CONTENT_FILTER and strengthen XML tool-call parsing by @CJackHwang in #211
Full Changelog: v3.0.0...v3.1.0_beta
v3.0.0
DS2API v3.x
统一内核架构升级与核心体验重构
本次大版本更新标志着 DS2API 底层架构的重大飞跃。我们重构了多协议的调度链路,将所有 API 的执行逻辑统一收束至 OpenAI 核心引擎,并对工具调用(Tool Calling)、账号池防饥饿机制及流式输出的稳定性进行了深度加固。
- 编译环境要求提升:如果您选择本地拉取源码进行编译部署,Go 语言版本要求已从 1.24+ 升级至 1.26+。使用 Docker 或 Release 预编译包的用户不受影响。
- 配置写回与初始化:引入了环境变量写回机制。当启用 DS2API_ENV_WRITEBACK 时,系统支持将环境变量动态写回配置文件;同时新增了配置缺失时的自动引导与占位文件生成功能。
- API 探针更变:推荐运维监控体系切换至标准的 /healthz(存活探针)与 /readyz(就绪探针)进行状态检查。
核心更新内容 (Major Updates)
- 架构级重构:统一 OpenAI 核心调度流
彻底重构了底层协议路由。通过引入全新的 CLIProxy 转换桥,现在 Claude(/anthropic/)与 Gemini(/v1beta/models/)的请求会先被翻译为内部 OpenAI 结构,交由 OAEngine 集中处理工具调用解析、PoW 计算与流式防泄漏,最终再转换回原协议输出。
- 一致性提升:消除了过去各协议适配器各自为战导致的行为漂移,确保不同 SDK 接入时流式语义与拦截逻辑绝对一致。
- 路由收拢:所有协议入口统一汇聚于 chi Router 同一路由树中,代码层级与调用链路更加清晰。
- Tool Calling (工具调用) 深度加固
全面提升了工具调用的准确度与容错边界,对 Go 侧与 Node 侧(Vercel)的解析器进行了严格语义对齐。
- 多协议特征识别:全面兼容并强化了 Gemini functionCall 与 Claude tool_use 的拦截识别,支持动态回填缺失的 Tool Call ID。
- 防误判与清洗优化:修复了普通文本中的 "tool_calls" 字样被误捕获的问题,并增强了 XML 转义残留的清理逻辑,优先保证合规 Schema 参数的准确提取。
- 账号池调度与并发稳定性增强
- 账号池“防饥饿”机制:重构了并发轮询逻辑。当托管池中某一账号 Token 失效或鉴权失败时,系统不再卡死报错,而是自动轮询重试池内其他健康的可用账号。
- 风控拦截(Content Filter)静默处理:当上游触发审查拦截时,底层引擎会自动隐藏上游的审查提示文本、安全截断输出流(避免 FINISHED 状态异常泄漏),并完整保留请求已消耗的 Token 统计。
- 部署与运维体验优化
- 基础镜像升级:同步升级了 Dockerfile 与 Zeabur 部署模板的底层依赖,更新至最新的 Node 和 Go 运行基线。
- WebUI 细节修复:修复了前端管理台中 API Key 复制按钮偶发失效的问题。
- 排障闭环:结合 /admin/version 与 /admin/dev/captures,提供更清晰的本地抓包与流量模拟能力(支持生成原生 JSON 请求体用于复现排查)。
- 支持DeepSeek最新支持的多段思考能力,支持token计数返回
What's Changed
- Fix dangling agent XML cleanup and XML-escape tool-call prompt serialization by @CJackHwang in #167
- chore: relocate sha3 WASM asset to internal directory and update build configurations by @CJackHwang in #166
- fix(js): avoid false tool-call capture on plain tool_calls prose by @CJackHwang in #168
- Merge pull request #168 from CJackHwang/codex/fix-vercel-deployment-issue-with-api-calls
fix(js): avoid false tool-call capture on plain tool_calls prose by @CJackHwang in #169
- Enable env-backed config writeback and bootstrap missing config file by @CJackHwang in #171
- 修复写回模式回退逻辑并从 CONTENT_FILTER 起截断流输出 by @CJackHwang in #176
- Merge pull request #171 from CJackHwang/codex/fix-issue-#170-in-ds2api
Enable env-backed config writeback and bootstrap missing config file by @CJackHwang in #174
- Fixes #177 by @TesseractLHY in #179
- Detect Gemini
functionCalland Claudetool_use, backfill tool_call IDs, and broaden tool-sieve detection by @CJackHwang in #180 - Fix account pool starvation when only one managed account has token by @CJackHwang in #182
- auth: retry other managed accounts when token ensure fails by @CJackHwang in #184
- fix(webui): make API key copy action reliable by @CJackHwang in #186
- 完善Docker部署教程 by @MoeclubM in #188
- Fix tool sieve regression for loose
functionCallkeys by @CJackHwang in #190 - fix: harden functionCall key detection in tool sieve by @CJackHwang in #192
- fix: prioritize quoted functionCall keys in tool sieve by @CJackHwang in #191
- fix: use schema-correct exec parameter examples in tool prompt by @CJackHwang in #187
- Merge pull request #182 from CJackHwang/codex/investigate-potential-issues
Fix account pool starvation when only one managed account has token by @CJackHwang in #183
- Hide upstream content-filter text in SSE streams, preserve token usage, and tighten filter detection by @CJackHwang in #195
- Preserve SSE keep-alive, stop on CONTENT_FILTER status, and propagate upstream token usage by @CJackHwang in #194
- Proxy Claude/Gemini via OpenAI with translation bridge and streaming translator; update deps by @CJackHwang in #193
- Docs: Bump to v3.0.0 and document unified adapter/router, health endpoints, and Go 1.26 requirement by @CJackHwang in #197
- Release 3.0.0: version bump and docs updating unified routing & adapter-layer by @CJackHwang in #198
- docs: refresh architecture overview and project structure maps by @CJackHwang in #199
- Bump Node and Go base images and add runtime baseline to Zeabur template by @CJackHwang in #202
- Proxy Claude/Gemini adapters via OpenAI core, preserve model mapping, update README and tests by @CJackHwang in #201
- Merge pull request #193 from CJackHwang/codex/analyze-context-absence-issue
Proxy Claude/Gemini via OpenAI with translation bridge and streaming translator; update deps by @CJackHwang in #196
- Skip dynamic DeepSeek fragment status paths to avoid FINISHED leakage; add simulator, samples and tests by @CJackHwang in #204
- tests: generate JSON request body in capture-raw-stream-sample.sh and use --data-binary by @CJackHwang in #206
- Merge pull request #204 from CJackHwang/codex/capture-raw-stream-data-with-search-model
Skip dynamic DeepSeek fragment status paths to avoid FINISHED leakage; add simulator, samples and tests by @CJackHwang in #205
New Contributors
- @TesseractLHY made their first contribution in #179
- @MoeclubM made their first contribution in #188
Full Changelog: v2.5.0...v3.0.0
v3.0.0_beta
What's Changed
- Hide upstream content-filter text in SSE streams, preserve token usage, and tighten filter detection by @CJackHwang in #195
- Preserve SSE keep-alive, stop on CONTENT_FILTER status, and propagate upstream token usage by @CJackHwang in #194
- Proxy Claude/Gemini via OpenAI with translation bridge and streaming translator; update deps by @CJackHwang in #193
- Docs: Bump to v3.0.0 and document unified adapter/router, health endpoints, and Go 1.26 requirement by @CJackHwang in #197
- Release 3.0.0: version bump and docs updating unified routing & adapter-layer by @CJackHwang in #198
- docs: refresh architecture overview and project structure maps by @CJackHwang in #199
- Bump Node and Go base images and add runtime baseline to Zeabur template by @CJackHwang in #202
- Proxy Claude/Gemini adapters via OpenAI core, preserve model mapping, update README and tests by @CJackHwang in #201
Full Changelog: v2.5.1...v3.0.0_beta
v2.5.1
What's Changed
- Fix dangling agent XML cleanup and XML-escape tool-call prompt serialization by @CJackHwang in #167
- chore: relocate sha3 WASM asset to internal directory and update build configurations by @CJackHwang in #166
- fix(js): avoid false tool-call capture on plain tool_calls prose by @CJackHwang in #168
- Merge pull request #168 from CJackHwang/codex/fix-vercel-deployment-issue-with-api-calls
fix(js): avoid false tool-call capture on plain tool_calls prose by @CJackHwang in #169
- Enable env-backed config writeback and bootstrap missing config file by @CJackHwang in #171
- 修复写回模式回退逻辑并从 CONTENT_FILTER 起截断流输出 by @CJackHwang in #176
- Merge pull request #171 from CJackHwang/codex/fix-issue-#170-in-ds2api
Enable env-backed config writeback and bootstrap missing config file by @CJackHwang in #174
- Fixes #177 by @TesseractLHY in #179
- Detect Gemini
functionCalland Claudetool_use, backfill tool_call IDs, and broaden tool-sieve detection by @CJackHwang in #180 - Fix account pool starvation when only one managed account has token by @CJackHwang in #182
- auth: retry other managed accounts when token ensure fails by @CJackHwang in #184
- fix(webui): make API key copy action reliable by @CJackHwang in #186
- 完善Docker部署教程 by @MoeclubM in #188
- Fix tool sieve regression for loose
functionCallkeys by @CJackHwang in #190 - fix: harden functionCall key detection in tool sieve by @CJackHwang in #192
- fix: prioritize quoted functionCall keys in tool sieve by @CJackHwang in #191
- fix: use schema-correct exec parameter examples in tool prompt by @CJackHwang in #187
- Merge pull request #182 from CJackHwang/codex/investigate-potential-issues
Fix account pool starvation when only one managed account has token by @CJackHwang in #183
New Contributors
- @TesseractLHY made their first contribution in #179
- @MoeclubM made their first contribution in #188
Full Changelog: v2.5.0...v2.5.1
v2.5.1_beta3
What's Changed
- Enable env-backed config writeback and bootstrap missing config file by @CJackHwang in #171
- 修复写回模式回退逻辑并从 CONTENT_FILTER 起截断流输出 by @CJackHwang in #176
- Merge pull request #171 from CJackHwang/codex/fix-issue-#170-in-ds2api
Enable env-backed config writeback and bootstrap missing config file by @CJackHwang in #174
Full Changelog: v2.5.1_beta2...v2.5.1_beta3
