[codex] fix DeepSeek stream delta dedupe - #66
Closed
RuszLi wants to merge 1 commit into
Closed
Conversation
RuszLi
marked this pull request as ready for review
May 12, 2026 16:34
Owner
|
感谢提交这个PR,我们做了深入调研,包括分析实际 SSE 流和 DeepSeek 前端的 JS 源码,结论是这个PR是过度设计的。 实际流验证我们抓取了 5 个不同场景的实际流(简单问答、DEEP_SEARCH + 引用、思考中中断、输出中中断、thinking=OFF),所有 JS 源码验证从 // o 字段的 schema 定义:仅有 3 个合法值
o: union(["SET", "BATCH", "APPEND"])
// 状态更新引擎
switch (o) {
case "SET": target[prop] = value; break; // 直接替换
case "APPEND": target[prop] += value; break; // 纯字符串拼接
default: unreachable; break; // 其他值 = bug
}关键发现:
结论PR 引入的 所以我们决定关闭这个PR,保持旧代码不变。 |
Owner
|
基于实际流抓包和 DeepSeek JS 源码分析确认:协议中内容更新只有 APPEND(),不存在 snapshot 替换场景。旧代码的 bare → APPEND 处理是正确的。PR 的四个去重函数防御的是不存在的场景,属于过度设计。详见上方评论。 |
NIyueeE
added a commit
that referenced
this pull request
May 13, 2026
- Rewrite state.rs to match DeepSeek frontend DeltaParser algorithm (p/o persistence, BATCH recursive decomposition, path prepending) - Fix INCOMPLETE status not triggering stream termination in converter - Remove PR #66's over-engineered snapshot dedup (behavior doesn't exist in protocol) - Add current_op tracking to DsState for correct bare v routing - Tighten health_check to validate SSE content and detect muted accounts - Add runtime biz_code detection for SSE streams (mute/error at request time) - Init-failed accounts now added to pool as Invalid (visible in frontend) instead of silently dropped; startup no longer blocked on all-fail - Remove 3x retry loop from init_account (failures handled by recovery task) - Bump X-Client-Version default to 2.1.0, add vision model_type - Align docs/deepseek-api-reference.md with actual API responses (PARSING status, VISION model_kind, fragment-level BATCH patterns, INCOMPLETE terminal state, no event:finish in practice) - Update e2e runner to derive model list from config.toml dynamically - Fix clippy warnings and cargo fmt issues
Contributor
Author
|
昨天我对接openclaw,在飞书channel上使用,确实遇到了重复返回同一段内容好多次的问题。
没截图下来。复现不出来。
niyue ***@***.***> 于2026年5月13日周三 10:59写道:
… *NIyueeE* left a comment (NIyueeE/ds-free-api#66)
<#66 (comment)>
基于实际流抓包和 DeepSeek JS 源码分析确认:协议中内容更新只有 APPEND(),不存在 snapshot 替换场景。旧代码的 bare
→ APPEND 处理是正确的。PR 的四个去重函数防御的是不存在的场景,属于过度设计。详见上方评论。
—
Reply to this email directly, view it on GitHub
<#66 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BQNK6DHSVZ7WBLTAT4WWVIL42PQHXAVCNFSM6AAAAACY3AW3O6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DIMZWG42TONBSHA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
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.
Fix DeepSeek streaming replay by treating snapshot-like fragment updates as snapshots and emitting only new suffix content. Also suppresses repeated append fragments that would resend the same visible text through Feishu/OpenClaw streaming. Scope: only src/openai_adapter/response/state.rs. Validation: staged diff checked with git diff --cached --check; local Rust tests were not run because this machine is missing a usable Rust toolchain; Docker rebuild and /health check passed earlier.