Repository navigation
fix(dsh): call ShellExecutor.execute() on dsh 0.2.x, keep run() for 0.1.x - #330
Conversation
….1.x dsh 0.2.x replaced ShellExecutor.run() with execute(), which returns a ShellExecution whose foreground outcome is handle.result(); 0.1.x has only run(). plugins/dsh declares @deepseek-ai/dsh-tools for BOTH generations (>=0.1.1-rc.2 <0.2.0 || >=0.2.0-rc.1 <0.3.0), so under 0.2.x every skillopt_* tool call failed with "shell.run is not a function". Feature-detect the seam instead of switching it: execute() wins when present, run() stays the 0.1.x path. The test covers all three shapes (0.2.x handle, 0.1.x direct, transitional both-present) and dies on the pre-fix body with the same production error.
|
Thanks for the contribution. Merged as Reviewed Independent checks exercised all seven registered tools through the actual packed and installed plugin with both supported dependency generations. They cover resolved specs, literal shell arguments, output/truncation, nonzero exits, timeout, cancellation and preparation/result errors. All 138 checks passed per generation, including on the pre-merge review integration; the corresponding execute-only baseline fails. The current-main merge preserves #311's package support and passes the full regression suite. The final published main also passes a separate 109 registered-plugin checks per supported dependency generation. This is a concrete invocation compatibility fix. It does not address the separate DSH transcript-format work in #266/#225. |
Problem
plugins/dsh/src/index.jsruns every skillopt_* tool throughshell.run(spec)(line 373 on current
main). dsh 0.2.x removed that method:ShellExecutornow declares a single abstract
execute(spec): Promise<ShellExecution>, and theforeground outcome comes from
await handle.result(). Under dsh 0.2.x everytool call therefore fails with
shell.run is not a function??the tool neverreaches the engine.
#311widened the@deepseek-ai/dsh-toolsrange but the call site was not partof that diff, so the range it declares
(
>=0.1.1-rc.2 <0.2.0 || >=0.2.0-rc.1 <0.3.0) currently admits a generationthat the code cannot call.
Why not a hard switch
The same range still admits
0.1.x, whereshell.run()is the only method andexecute()does not exist. Switching the call outright trades a 0.2-only bugfor a 0.1-only one. The file already feature-detects the neighbouring seam
(
typeof shell.resolve === 'function'on the line above), so this follows thesame idiom.
Change
+16/??insrc/index.js(helper + one call site).Verification
scripts/test-shell-seam.mjscovers the three executor shapes:execute()returns aShellExecution; outcome read fromresult()run()returns the outcome directly;executeabsentexecute()must winNegative control: with the body hard-switched back to
shell.run(spec), case 1dies with
TypeError: shell.run is not a function??the same error users hit on0.2.x, so the test fails exactly where the regression is.
Existing
scripts/test-quoting-bash.mjsis unaffected (needs a POSIX bash; onWindows
quoteArgv()prepends the PowerShell call operator, which is apre-existing condition of that script, not of this change).
Scope
Only the shell seam. The
CollectedOutputhandling below it (fmt()) and thetimedOut/exitCodeclassification are unchanged ??ShellRunResultkeepsthose fields.