🐛 fix(web): return DSH client plugin from loader bundle - #480
Open
zrr1999 wants to merge 3 commits into
Open
Conversation
zrr1999
added a commit
that referenced
this pull request
Aug 20, 2026
…reams (#481) ## 动机 deepseek-v4-flash 的完整链式思考(CoT)仍持续泄露进 Spark 会话历史与制品:百度网关把 thinking 作为普通 `thinking` content 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 测试 tmpdir `git init`(preflight 超时后 `captureWorkspaceRevision` 不再在非 repo 目录里 `git diff --cached` 报 usage)、mock 掉真实 `vp lint` 子进程、restart arming 超时 30s。 ## 说明 - 本地验证:`spark-cue` 266 passed、`spark-llm` 124 passed、`dsh-tool-cue` 11 passed、daemon lens/service 43 passed、`vp check --no-fmt --no-lint` 0 errors(7 个既有 warning:spark-cue unbound-method 与 spark-web-dsh esbuild helper,与 #478/#480 已知一致)。 - 实时流中的 thinking(UI 展示)保持明文;本次修复覆盖持久化/历史路径。 - 基于最新 `origin/main`(0a993bf0),不含被 #478/#480 覆盖的 web onboarding/UUID fallback 改动。 - 分支基于 cherry-pick,保留三提交结构(`fix(daemon)` → `feat(cue)` → `fix(llm)`)。 ## 后续工作 - 可选:提供配置开关以在实时流中也屏蔽明文 thinking(当前仅持久化路径收口)。
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(web): return DSH client plugin from loader bundle
通过普通 HTTP 的非 localhost 地址访问 Spark Web 时连续存在三个启动阻塞:
scripts/build.mjs生成的 ModuleLoader factory 没有返回插件对象;🐛 fix(cli): auto-pick web port and export the spark-web-dsh client bundle correctly #467 只手工修复了生成产物,后续 rebuild 会再次变成undefined。crypto.randomUUID(),选择工作区会失败。/api/credentials.describe会返回 403,但 onboarding 将其错误地呈现为配置失败。解决方案
apply的插件对象,并重新生成 bundle。crypto.getRandomValues()的 UUID v4 fallback。说明
验证:
pnpm --filter @zendev-lab/spark-web-dsh run buildpnpm --filter @zendev-lab/spark-web-dsh check(5 tests passed)git diff --checkspark web --host 0.0.0.0 --port 8888 --trusted-host 33.6.30.189:8888http://33.6.30.189:8888/直连返回HTTP/1.1 200 OKreturn module.exports包检查只有 esbuild helper 上既有的
typescript(unbound-method)warning,无类型错误。