Idea: tool-scheduler prepare() failures are very hard to diagnose (Symbol mismatch invisible) #5758
Replies: 1 comment
|
Great diagnosis — this is a known, well-understood mechanism that has been reported in the community more than once. I can confirm the exact source chain in the current
So the two-copies-of- Your proposed diagnosability improvements are sound. A couple of refinements worth considering:
This is high-value because the "silent duplicate copy" failure mode has bitten multiple people — a clearer diagnostic would have saved each of them the same source-reading effort you went through. Happy to help test a patch if you'd like to open one. |
Uh oh!
There was an error while loading. Please reload this page.
Suggestion: tool-scheduler prepare() failures are very hard to diagnose
Where it's hard to debug:
packages/core/agent-loop+packages/core/toolsObserved failure: In a web profile, a tool call (e.g.
ask_user_question) fails at runtime with:code:
UNKNOWNThe trace points to
dsh-agent-loop/lib/index.js:195:Root cause found locally (not a code bug in the harness itself): the profile had a second copy of
@deepseek-ai/dsh-toolsinstalled (host =0.1.2-alpha.5, profile =0.1.2-rc.1).TOOL_RUNTIME_SCHEDULERis a module-scopedSymbol(packages/core/tools/lib/index.js). Because two different module instances ofdsh-toolswere loaded at runtime, the twoSymbols are not equal, soctx.tools[TOOL_RUNTIME_SCHEDULER]resolves toundefinedand.prepare()throws.Why the error message is misleading:
Cannot read properties of undefined (reading 'prepare')says nothing about why the key is missing. The real cause — twodsh-toolsinstances with mismatchedSymbols — is invisible. It can look like a plugin bug at first, and debugging it required reading source and comparing package versions.Proposed improvement (open to alternatives):
ctx.tools[TOOL_RUNTIME_SCHEDULER]isundefinedin the agent loop, throw a clearer error that names the missing scheduler and hints at a possible duplicate-instance / version-mismatch cause (e.g. check for multipleTOOL_RUNTIME_SCHEDULERsymbol identities, or log the resolveddsh-toolsversion at boot).@deepseek-ai/dsh-toolsmodule instance in the runtime.This is purely a diagnosability suggestion. The harness behavior itself is correct; the failure came from a version mismatch in the consuming profile. Happy to provide more details if useful.
All reactions