Repository navigation
[Bug] 桌面打包版:系统提示词宣传的 implementation checkout 指向 app.asar 内部虚拟路径,agent 工具全部无法访问(0.2.0-rc.2,master 未修) #9216
Replies: 1 comment
|
Your root-cause reading is correct, and the section is gated — so there is a workaround today, plus the cheap fix. The mechanism, confirmed. The text is produced verbatim by const SOURCE_ROOT = fileURLToPath(new URL('../../../..', import.meta.url))Inside a packaged app that resolves to It is gated, though, and the gate is documented. Workaround you can use before the fix. Patch layers replace the targeted row's complete - id: web-runtime
config:
openBrowser: !!js ctx.webStartup.openBrowser
printUrl: true
publicUrl: !!js ctx.webStartup.publicUrl
surfaceContext: false
trustedHosts: !!js ctx.webStartup.trustedHosts
Your fix request 1 is the right one and is implementable at the point you name: skip registering the section when the computed root is not an accessible directory — no new configuration, and in a packaged install the check simply fails and the section is skipped, while source and npm installs are unaffected (their root is a real directory). Requests 2 and 3 are heavier and, for the specific symptom here, unnecessary. Two of your symptoms are a different defect and deserve their own thread. One source note, in case it explains why not every install shows this: a complete agent-preset persona suppresses the section for that agent while keeping the host-owned shell variable ( |
Uh oh!
There was an error while loading. Please reload this page.
Summary
打包版桌面应用(Windows/macOS)中,每个会话的系统提示词都会写入:
但该路径位于
app.asar归档内部(app.asar是单个文件,不是目录),只有 Electron 主进程的 asar 补丁 fs 能读。所有 agent 侧真实工具都访问不了它:Get-ChildItem:找不到路径"…\app.asar\dsh",因为该路径不存在。os error 2 / 系统找不到指定的路径Cannot mix BigInt and other types(与 [Bug] Composed filesystem throws "Cannot mix BigInt and other types" on app.asar paths, which silently empties the whole skill catalog #9189 同类的 asar 层内部错误)而提示词又明确邀请 agent “Use this checkout only to inspect or extend DSH itself”,于是凡是涉及 DSH 内部的任务,agent 都会在首轮去列该目录并失败,把
[stderr] Get-ChildItem: 找不到路径…打进对话;之后每个后续轮次都可能重试,浪费 token、污染会话记录。在 DSH 相关的会话里几乎必现。触发条件 / Reproduction
app.isPackaged === true)。implementation checkout is at …\resources\app.asar\dsh …。Get-ChildItem "…\resources\app.asar\dsh"。(
npx @deepseek-ai/dsh web的 npm/源码安装方式不受影响——那里import.meta.url能解析到真实目录。)实际行为(Current behavior)
Get-ChildItem: 找不到路径"C:\Users\…\Programs\DeepSeek Harness\resources\app.asar\dsh",因为该路径不存在。(GUI 以[stderr]分段显示)os error 2/系统找不到指定的路径Cannot mix BigInt and other typesGet-ChildItem,且会重复出现。期望行为(Expected behavior)
打包模式下,系统提示词不应宣传一个只有 Electron 主进程内可见、任何 agent 工具都无法访问的虚拟路径。可接受的修法(任选其一):
app.asar内)时,不注册harness:source提示词段;~/.dsh/profiles/node_modules的同版本包),保证路径对工具真实可访问;根因(附代码出处)
packages/bundle/web-app/src/index.ts:该“从模块 URL 向上 4 级”的自定位手法,默认假设 harness checkout 是真实目录(对应设计笔记
.agents/notes/archived/feature/2026-07-21-dsh-system-prompt-source-path.md,其场景是源码安装/npm 安装)。桌面打包后import.meta.url位于…\resources\app.asar\dsh\node_modules\@deepseek-ai\dsh-web-app\lib\index.js,向上 4 级恰好是app.asar\dsh——一个只在 Electron 进程内“存在”的虚拟路径。apps/desktop/src/main.ts的runtimeResources()打包分支同样取join(app.getAppPath(), "dsh"),与上述一致,且无磁盘存在性守卫。master(2026-10-03 提交)上两处代码未变,问题仍存在。
关联讨论
附:本机临时规避
在用户级
~/.dsh/AGENTS.md增加一条全局规则,告知后续会话“该路径位于 app.asar 归档内,禁止用 shell 列目录,改用 asar 提取工具”,可消除噪音,但属于 workaround,未触及根因。All reactions