Replies: 1 comment
|
Your analysis matches what we reproduced independently: after Minimal fix (normalize that anchor to its real path, keep Node/tsx owning exports and hooks), regression tests, and A/B plus end-to-end verification are in #7048. Unlike reverting the default to |
Uh oh!
There was an error while loading. Please reload this page.
Summary
In a source workspace (running
pnpm dsh webthrough the tsx source launch), every agent turn that executes a tool fails with:The failure starts with commit
9ddef327a4("feat: resolution mode link to runtime"), which flipped the non-packaged CLI default resolution mode fromlinktoruntime. That puts two module instances of@deepseek-ai/dsh-toolsin one process (onesrc/, onelib/), and the tool scheduler slot — keyed by aSymbol()— only exists under the other copy's symbol.This violates the repo's own "Source plane vs artifact plane, never mixed" rule for source launches. Packaged installs are unaffected (single
lib/plane). CI does not catch it because gates run against one consistent plane.Environment
ddefc45fbc(0.1.6-alpha.2 line), pulled across0d1f50007f..ddefc45fbc(882 commits, includes9ddef327a4)pnpm dsh web(node --import tsx/esm apps/cli/src/bin.ts)Reproduction
9ddef327a4,pnpm install && pnpm run build.pnpm dsh weband send any message that triggers a tool call.reason.kind: "error"and the message above, right after the assistant emits a tool call.Durable session-log timeline from my workspace (same session, same machine):
Root cause
apps/cli/src/profile-boot.ts:In
runtimemode the loader resolves each plugin's directory on disk and loads its builtlib/entry by file path (consistent with stack frames pointing atpackages/client/connection/lib/index.jsin a source launch). But tsx still applies tsconfigpathsto bare-specifier imports made from thoselib/files. So:toolsplugin entry is loader-loaded frompackages/core/tools/lib/index.js, and itsToolRuntimeclass field is keyed by that copy'sTOOL_RUNTIME_SCHEDULER = Symbol('@deepseek-ai/dsh-tools.scheduler')(symbol A).agent-loop's built bundle keepsfrom "@deepseek-ai/dsh-tools"external (peer dep), so its import is tsx-redirected topackages/core/tools/src/index.ts— a second module evaluation with its ownSymbol()(symbol B).ctx.tools[TOOL_RUNTIME_SCHEDULER]read attool-calls.ts:170(prepare(call.exec)) isundefined. String-keyed methods on the same service (ctx.tools.executionMode(...), line 89) work fine, which is why turns stream normally and only tool dispatch crashes.Probe
From any file in the repo:
Importing the same specifier vs. the lib file directly:
bare === lib : false # two evaluations, two SymbolsSuggested fixes
'link'(keepruntimefor packaged launches). One-line revert of the default.runtimemode a true artifact plane — loader-controlled resolution that bypasses tsconfigpathsfor plugin entries and their inter-package imports, sosrccan never meetlibin one process.Symbol.foror string registry keys) instead of per-evaluationSymbol()s.resolutionModeas a CLI flag — today there is no way to opt out without patching source.Workaround
Local, uncommitted patch (what I am running now):
After restarting, tool execution works again;
lib/staleness also stops mattering for source launches.All reactions