Skip to content
This repository was archived by the owner on May 13, 2026. It is now read-only.

Releases: CJackHwang/ds2api

v4.1.3_beta2

29 Apr 06:58
a0984ef

Choose a tag to compare

v4.1.3_beta2 Pre-release
Pre-release

What's Changed

  • build: improve Docker robustness and fix potential security issues by @RinZ27 in #349
  • feat: parse split context files in list view by @ouqiting in #350
  • docs: add Table of Contents to README.MD and README.en.md by @Gingiris in #353
  • Fix/tool type schema protection by @shern-point in #352
  • Verify GHCR latest tag matches release and show version source/latest in dashboard by @CJackHwang in #356
  • Return config persistence warning when config path is read-only; default container config to /data/config.json and update docs by @CJackHwang in #357
  • Revert "Verify GHCR latest tag matches release and show version source/latest in dashboard" by @CJackHwang in #358

New Contributors

Full Changelog: v4.1.2...v4.1.3_beta2

v4.1.3_beta

29 Apr 03:58
d7125ea

Choose a tag to compare

v4.1.3_beta Pre-release
Pre-release

What's Changed

  • build: improve Docker robustness and fix potential security issues by @RinZ27 in #349
  • feat: parse split context files in list view by @ouqiting in #350
  • docs: add Table of Contents to README.MD and README.en.md by @Gingiris in #353
  • Fix/tool type schema protection by @shern-point in #352

New Contributors

Full Changelog: v4.1.2...v4.1.3_beta

v4.1.2

28 Apr 14:17
27eb73d

Choose a tag to compare

What's Changed

  • revert current_input_file prompt refactor by @CJackHwang in #337
  • refactor: update tool call parsing and stream tool sieve logic by @CJackHwang in #338
  • Fix/tool string schema protection by @shern-point in #342
  • 支持 reference 引用标签转链接,并兼容 0 基序号映射 by @livesRan in #343
  • Normalize string tool inputs and enhance schema protection by @CJackHwang in #346

New Contributors

Full Changelog: v4.1.1...v4.1.2

v4.1.2_beta

28 Apr 08:45
f18e6b9

Choose a tag to compare

v4.1.2_beta Pre-release
Pre-release

What's Changed

New Contributors

Full Changelog: v4.1.1-2...v4.1.2_beta

v4.1.1-2

27 Apr 17:52
b26dc8b

Choose a tag to compare

修复前面版本的不稳定情况

What's Changed

  • [codex] revert current_input_file prompt refactor by @CJackHwang in #337
  • refactor: update tool call parsing and stream tool sieve logic by @CJackHwang in #338

Full Changelog: v4.1.1...v4.1.1-2

v4.1.1

27 Apr 16:16
d3c0e74

Choose a tag to compare

更新内容

优化上下文管理 工具调用重构优化 对齐原生API体验
其他优化省略

请看技术文档说明了解本项目思路
https://github.com/CJackHwang/ds2api/blob/dev/docs/README.md

What's Changed

  • fix: fallback claude non-stream tool calls from thinking by @adnxx1wsx in #320
  • feat: merge parsed HISTORY into chat history list by @ouqiting in #323
  • 4.1.0 by @CJackHwang in #331
  • dev → main: 空输出重试、Vercel 自动续写、current_input_file 重构与 DSML 兼容增强 by @CJackHwang in #336

New Contributors

Full Changelog: v4.0.0...v4.1.1

v4.0.0

26 Apr 02:01
87e1b05

Choose a tag to compare

DS2API 4.0 Update Technical Report — Changes from v3.6.1

Date: 2026-04-26
Scope: v3.6.1 → v4.0.0

本报告完全由本项目v4.0.0版本官网Deepseek专家模式在ClaudeCode中自行探索完成总结,实测工具调用效果在中短上下文已经接近原生API甚至持平。


1. Executive Summary

DS2API 4.0 represents a major architectural refactoring and consolidation release. The core theme of this update is the normalization of multi-protocol API requests into a unified pure-text web-chat compatibility pipeline, with significant changes across backend structure, tool calling, model handling, configuration, and documentation.

This report summarizes the key documentation changes between v3.6.1 and the current codex/docs-4x-architecture branch, covering 16 modified files with approximately 854 additions and 414 deletions.


2. New Files Introduced

2.1 docs/prompt-compatibility.md (402 lines, NEW)

This is the most significant new documentation artifact. It serves as the source-of-truth document for the "API → pure-text web-chat context" compatibility flow. This document explains how OpenAI / Claude / Gemini style API requests are normalized into DeepSeek web-chat pure-text context.

Key sections covered:

  • The three-pronged translation: prompt (single string with role markers, system instructions, history), ref_file_ids (file references), and control bits (thinking_enabled, search_enabled)
  • Role marker format (<|User|>, ``, </s>, etc.)
  • Tool text injection: tools are translated into prompt text, not native schema transport
  • History split: mandatory global enable with HISTORY.txt file packaging
  • File handling: system prompt text vs. file-type attachments
  • Per-protocol entry point differences (OpenAI, Claude, Gemini)
  • Modification synchronization requirements

Why this matters: Any change to message normalization, tool prompt injection, history split, or completion payload assembly must now update this document.

2.2 docs/README.md (NEW entries)

Added a "Topical docs" reference to prompt-compatibility.md and expanded documentation maintenance conventions to require grounding in actual code locations (internal/server/router.go, internal/httpapi/*/**/routes.go, etc.).


3. Major Documentation Changes

3.1 ARCHITECTURE.md — Backend Restructuring

File: docs/ARCHITECTURE.md
Changes: +118 / -14 lines

The architecture documentation underwent a fundamental reorganization to reflect the 4.x backend refactoring:

Area Before (3.6.1) After (4.x)
internal/adapter/* Three adapters: claude/, gemini/, openai/ Replaced by internal/httpapi/* with sub-packages: admin/, claude/, gemini/, openai/{chat,responses,files,embeddings,history,shared}
internal/deepseek/ Flat structure Split into client/, protocol/, transport/
New modules internal/promptcompat/, internal/toolstream/, internal/chathistory/
Router Simple adapter dispatch chi router tree with /v1/*, /anthropic/*, /v1beta/models/*, /admin/*

Mermaid diagram updated from simple adapter-based flow to a comprehensive diagram showing HTTP surface, compatibility core, shared runtime, and Vercel Node runtime subgraphs with detailed connection paths.

3.2 toolcall-semantics.md — Canonical XML Only

File: docs/toolcall-semantics.md
Changes: +16 / -63 lines (significant rewrite)

The tool calling specification was narrowed from a broad XML/Markup family parser to a single canonical format:

Aspect Before (3.6.1) After (4.x)
Supported formats <tool_call>, <function_call>, <invoke>, <tool_use>, antml variants ONLY <tool_calls><invoke name="..."><parameter name="...">
JSON tool_calls Supported if inside markup NOT parsed as executable
Fenced code blocks Not mentioned Explicitly excluded from parsing
Missing opening tag Not handled Go parser repairs missing <tool_calls> when </tool_calls> is present
filterToolCallsDetailed Structural cleaning only Removed — no allow-list filtering

Streaming behavior documented: canonical blocks enter structured capture; non-conforming content remains as plain text.

3.3 API.md — Model Portfolio Update

File: API.md
Changes: +12 / -63 lines (model list condensed)

Aspect Before (3.6.1) After (4.x)
V4 Flash/Pro introduced deepseek-v4-flash, deepseek-v4-pro, deepseek-v4-flash-search, deepseek-v4-pro-search, deepseek-v4-vision, deepseek-v4-vision-search
Historical models removed deepseek-chat, deepseek-reasoner, deepseek-expert-*, deepseek-vision-* Removed in favor of V4 line
Claude models updated claude-sonnet-4-5 default claude-sonnet-4-6 now default (with backward compat aliases)
Deprecated families claude-1.*, claude-2.*, claude-instant-*, gpt-3.5* Now explicitly rejected
model_aliases naming Used claude_mapping Renamed to model_aliases for consistency
history_split.enabled Configurable Globally forced to true
history_split.trigger_after_turns Not exposed Now settable via /admin/settings
Tool config settings Listed as configurable Marked as fixed (feature_match + high, read-only)
compat fields Importable Excluded from /admin/config/import merge mode
Default model for tests deepseek-chat deepseek-v4-flash

3.4 DEPLOY.md — Vercel Architecture Expansion

File: docs/DEPLOY.md
Changes: +12 / -0 lines

Change Details
DS2API_VERCEL_STREAM_LEASE_TTL_SECONDS default Changed from "sync with responses.store_ttl_seconds" to fixed 900
New env var DS2API_RAW_STREAM_SAMPLE_ROOT — raw stream sample save/read directory
Vercel sections renumbered 3.3 → 3.4, 3.4 → 3.5, 3.5 → 3.6
Model example deepseek-chatdeepseek-v4-flash

3.5 Pow/README.md — WASM to Pure Go

File: pow/README.md
Changes: -30 / +8 lines

The PoW implementation moved from WASM-based (wazero runtime + sha3_wasm_bg.*.wasm assets) to a pure Go implementation:

Metric WASM (v3.6.1) Pure Go (4.x)
Hash performance 5.33M hash/s Referenced as faster
Solve performance ~75 solves/s/core ~2.8× faster
Dependencies removed github.com/tetratelabs/wazero, WASM binary assets Pure Go only

3.6 AGENTS.md — Documentation Sync Rules

File: AGENTS.md
Changes: +6 / -0 lines

New rule: When business logic or user-visible behavior changes, documentation must be updated in the same change. docs/prompt-compatibility.md specifically called out as the source-of-truth for the API-to-web-chat compatibility flow, with concrete file lists to check.

3.7 CONTRIBUTING.md — Quality Gates

File: docs/CONTRIBUTING.md
Changes: +11 / -0 lines

Addition Details
PR gates Added ./scripts/lint.sh + ./tests/scripts/check-refactor-line-gate.sh + ./tests/scripts/run-unit-all.sh + npm run build --prefix webui
Go linting gofmt -w step before golangci-lint
I/O Close errors Must be logged, not silently ignored
run-live.sh Clarified as optional (real-account E2E), not part of fixed PR gates

3.8 TESTING.md — Test Path Updates

File: docs/TESTING.md
Changes: +25 / -0 lines

Change Before After
Test paths internal/adapter/openai/... internal/httpapi/openai/...
PR gate section Not present Added with explicit command list

4. Structural Changes Summary

Directory Reorganization

REMOVED:
  internal/adapter/{claude,gemini,openai}/

ADDED:
  internal/httpapi/{admin,claude,gemini,openai/{chat,responses,files,embeddings,history,shared}}/
  internal/promptcompat/
  internal/toolstream/
  internal/chathistory/
  internal/deepseek/{client,protocol,transport}/   (was flat)

REFACTORED:
  internal/deepseek/pow.go  →  pow/  (Pure Go PoW, no WASM)
  API surface: router.go → chi router with protocol/resource sub-routes

Key Cross-Cutting Changes

  1. PoW: WASM dependency removed; pure Go Keccak-f[1600] implementation with pow.SolvePow() / pow.SolveAndBuildHeader()
  2. Tool calling: XML/Markup parser narrowed to canonical <tool_calls> only; toolcall settings fixed to feature_match + high; prompt-driven examples dynamically generated from declared tools
  3. Model management: V4 model line introduced; model_aliases renamed from claude_mapping; deprecated model families explicitly rejected
  4. History split: Globally forced enabled=true; trigger_after_turns configurable; HISTORY.txt packaging with IGNORE wrapper
  5. CORS: Expanded to cover all protocol surfaces; supports x-goog-api-key, Anthropic-Version, Anthropic-Beta; third-party headers passed through
  6. Vercel streaming: Finalization semantics aligned between Go and Node; lease TTL fixed at 900s
  7. Web security: Secret previews fully masked; uuid dependency replaced for http-environment key generation

5. Migration Considerations

For users upgrading from v3.6.1:

  • PoW: Binaries no longer need WASM assets; go.mod simplified (no wazero)
  • Config: claude_mapping renamed to model_aliases in /admin/config and /admin/settings; old keys accepted as fallback
  • Model IDs: deepseek-chat / deepseek-reasoner deprecated in favor of deepseek-v4-flash / `deepseek-...
Read more

v3.6.1

23 Apr 12:40
e4a4b0a

Choose a tag to compare

重要须知

自该版本v3.6.1以后开始实验性支持1M以上的超长上下文(基于拆分HISTORY.txt文件)可在管理面板选择关闭恢复原来模式(不推荐),此前上下文窗口约为社区反馈的40k(专家模式)。

本次更新内容

  • 修复v3.6.0从源码构建docker失败问题
  • webui增加对历史对话保存展示HISTORY文件内容的支持
  • 增加安全报告规范和社区贡献者守则

What's Changed

Full Changelog: v3.6.0...v3.6.1

v3.6.0

23 Apr 01:15
d2c6445

Choose a tag to compare

更新内容

  • 自定义key和账号的备注信息
  • 默认启用-历史对话拆分文件上传 解除上下文窗口限制(1M)
  • 后台历史对话记录查看
  • 修复已知标签引用问题

What's Changed

  • 给webui新增“对话记录” by @ouqiting in #281
  • 修复搜索场景下 citation 标签偶发未替换问题(FINISHED 后继续收集引用元数据) by @livesRan in #282
  • feat(account): add structured API key and account name/remark support by @CJackHwang in #279
  • 非常大的更新(3.6.0) by @CJackHwang in #284

New Contributors

Full Changelog: v3.5.2...v3.6.0

v3.5.2

21 Apr 10:52
e9a544c

Choose a tag to compare

补丁

v3.5.1映射问题修复

LICENSE变更

从GPL3.0更新license为AGPL3.0

What's Changed

  • 修复重复 URL 且 cite_index 不稳定时 citation 映射不完整的问题 by @livesRan in #275
  • Fix citation link mapping for duplicate URLs and unstable cite_index by @CJackHwang in #276

Full Changelog: v3.5.1...v3.5.2