[Fixed in 0.1.7-alpha.1] Dev source launch (pnpm dsh) fails every tool call with "Cannot read properties of undefined (reading 'prepare')" — resolutionMode 'runtime' default mixes src/lib module planes #7228
Replies: 2 comments
|
Update — fixed, verified on The fix landed as What changed:
Verified locally on a clean tree at All three previously failed in default (src) mode on |
|
Follow-up: the crash window of this bug also left durable log damage (dangling |
Uh oh!
There was an error while loading. Please reload this page.
Summary
On current
master, every dev source launch ofdsh(pnpm dsh <profile> ...) fails on every tool call with:The turn ends with
reason: { kind: 'error', code: 'UNKNOWN' }before any tool executes. It is not escalation/sandbox-specific — even a plainbashcall likegit statuscrashes. GUI sessions (web profile) show the turn failing withUNKNOWN.Reproduction (keyless, clean tree)
Note the snapshot suite run without
DSH_EXAMPLE_MODE(i.e. the defaultsrclaunch mode). It fails:The same crash hits any real run, e.g.
pnpm dsh --profile headless "task"orpnpm dsh web— every tool call dies before dispatch.Root cause: two module planes in one process
dshsource launch runs through tsx (node --import tsx/esm apps/cli/src/bin.ts). Every package's leaf tsconfig extendstsconfig.base.json, whosepathsmap resolves workspace bare imports tosrc/. So a module loaded fromlib/still resolves its workspace imports intosrc/.Since #4471 (commit
9ddef327a4, "feat: resolution mode link to runtime"), the profile loader resolves plugin entries in'runtime'mode through built artifacts (package.jsonexports →lib/). The result is two executions of@deepseek-ai/dsh-toolsin one process:toolsservice instance is constructed frompackages/core/tools/lib/index.js;agent-loop's staticimport { TOOL_RUNTIME_SCHEDULER } from '@deepseek-ai/dsh-tools'binds the copy compiled frompackages/core/tools/src/index.ts.Two
Symbol(...)calls with the same description are not===. Inagent-loop/src/tool-calls.ts:170:ctx.toolsis the lib-constructedToolRuntime, which owns the lib-copy symbol, so the lookup with the src-copy symbol isundefinedand every tool call throws. Instrumenting the bundles confirms it:Introduced by
9ddef327a4— the default changed:Verified causally: reverting only that one default back to
'link'on the same tree makesbash-tool-turn,bash-startup-timeout, andfs-editsnapshot replays pass again.Why the gates miss it
scripts/run-gates.tsruns the snapshot suite withDSH_EXAMPLE_MODE: 'lib'(pure artifact plane — no mixing, passes). The plain developer flow (pnpm dsh …, orpnpm run test:snapshotwithout the env override) runs insrcmode and crashes.Suggested fix
Either:
'link'default for non-packaged launches (verified working), or'runtime', but make the source launch single-plane — e.g. have runtime-mode plugin resolution go through the same resolution the importing modules use, or prevent tsconfig-pathsresolution for specifiers that the loader resolves through artifacts (identity-sensitive seams likeTOOL_RUNTIME_SCHEDULER, class identity, and branded types otherwise break).Environment
master@ddefc45fbc(v0.1.6-alpha.2)All reactions