dsh-acp-demo agents crash with InvariantError: "subagent/end" dispatched without a scope carrier (multi-instance @deepseek-ai/dsh-scope under global npm) #2149
nelsonBlack
started this conversation in
General
Replies: 1 comment
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Symptom: launching a
dsh-acp-demoagent and using the subagent or workflow tools kills the whole process: Paseo reportsACP agent exited unexpectedly (1)withInvariantError: invariant violated by "@deepseek-ai/dsh-scope": "subagent/end" is a scope-filtered event but was dispatched without a scope carrier.Root cause (confirmed by inspection of the stack + install layout):
@deepseek-ai/dsh-scopekeeps its carrier registry in a module-localWeakMap. A globalnpm i -gofdsh-acp-demo+ its peers (npm 11 peer auto-install) created ~24 real nested copies ofdsh-scope@0.1.0-rc.6(one under each consumer, no top-level copy). The invariant plugin validates carriers using the copy it was loaded from, whiledsh-subagentbuilds carriers withscopeTargetfrom a different copy — soisScopeCarrier()is false for everysubagent/enddispatch, parented or not.Local workaround (verified end-to-end with Paseo 0.4.0): unify
dsh-scopeto one top-level instance and remove the nested copies (plus a top-level@deepseek-ai/cordissymlink to the runtime's nested copy soContextidentity matches), and make the lifecycle emitter fall back to a carrier for parentless runs.Suggested upstream fixes (any of): publish so the peer/dependency layout hoists instead of nesting real copies (or dedupe in the loader), make the invariant accept carriers from sibling module instances, and always dispatch
subagent/endwith a carrier even when the run has no parent.All reactions