🐛 fix(llm): redact plaintext deepseek-v4-flash thinking from baidu streams - #481
Open
zrr1999 wants to merge 3 commits into
Open
🐛 fix(llm): redact plaintext deepseek-v4-flash thinking from baidu streams#481zrr1999 wants to merge 3 commits into
zrr1999 wants to merge 3 commits into
Conversation
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.
动机
deepseek-v4-flash 的完整链式思考(CoT)仍持续泄露进 Spark 会话历史与制品:百度网关把 thinking 作为普通
thinkingcontent block(明文 CoT)返回,而 pi-ai 只在redacted_thinking(加密摘要)块上标记redacted: true,导致明文思维链一路透传到持久化层。同批次把另外两个本地已验证的改进一并合入:daemon lens 测试在慢文件系统/hook 负载下不再 flaky;cue 工具描述与守卫让模型在调用前就知道「不是 bash」并给出可重发的改写建议。解决方案
spark-llm(baidu-oneapi):归一化出口normalizeBaiduOneApiMessage新增 thinking 隐私处理——把非 redacted 的明文 thinking 折叠为{thinking: "", redacted: true},保留thinkingSignature加密负载供多轮 continuity;新增 message/事件流单元测试。spark-cue/dsh-tool-cue:cue-* 工具描述与 system prompt 前置告知 "not bash" + 操作符摘要;cueShellCommandIssue()返回结构化{reason, suggestion},对ls | head、a; b直接给出可重发的改写建议;兼容旧cueShellCommandSyntaxIssue。spark-daemon测试硬化:lens 测试 tmpdirgit init(preflight 超时后captureWorkspaceRevision不再在非 repo 目录里git diff --cached报 usage)、mock 掉真实vp lint子进程、restart arming 超时 30s。说明
spark-cue266 passed、spark-llm124 passed、dsh-tool-cue11 passed、daemon lens/service 43 passed、vp check --no-fmt --no-lint0 errors(7 个既有 warning:spark-cue unbound-method 与 spark-web-dsh esbuild helper,与 🐛 fix(web): support configured DSH providers over HTTP #478/🐛 fix(web): return DSH client plugin from loader bundle #480 已知一致)。origin/main(0a993bf0),不含被 🐛 fix(web): support configured DSH providers over HTTP #478/🐛 fix(web): return DSH client plugin from loader bundle #480 覆盖的 web onboarding/UUID fallback 改动。fix(daemon)→feat(cue)→fix(llm))。后续工作