Repository navigation
Replies: 1 comment
机制:两个 触发链是运行时生命周期问题:
这就是 "晚注册的 provider 被滚掉" 的完整路径。 为什么必须是 "waiting":若 provider 在 离线可探测性:诚实说明——这是纯运行时注册/加载时序缺陷,无离线可判定的 manifest 症状。撞名检查( 加固方向(个人看法,非官方承诺):给同名同 provider 的并发 waiting 实例做共享注册意图协调,或用配置期唯一性校验替代运行期撞名回滚。 (dsh-doctor 未引用——本缺陷无离线可抓的 manifest 指纹。) |
Uh oh!
There was an error while loading. Please reload this page.
Summary
Two live
@deepseek-ai/dsh-tool-subagentinstances can currently declare the same model-facingtoolNamewhile both selected providers are absent. Both plugin fibers activate successfully and retain provider-lifecycle listeners. The conflict is discovered only later, when the second provider arrives and its listener attempts the duplicate tool registration.That turns a local configuration error into a load-order-dependent provider-registration failure: a
provider-addedlistener is allowed to unwind the provider registration transaction. I reproduced the missing early rejection against officialmasterand prepared a tested fix in a public fork. Since this repository does not expose external pull-request creation, I am sharing the complete patch here according to the repository's contribution workflow.Reproduction
dsh-system-prompt,dsh-tools, anddsh-subagent.dsh-tool-subagentwith{ provider: 'later-a', toolName: 'shared_subagent' }whilelater-ais absent.{ provider: 'later-b', toolName: 'shared_subagent' }whilelater-bis absent.On official
master, both instances activated. The focused regression failed with:undefinedis the captured load error: no error was raised. The focused command was:Root cause
dsh-tool-subagentregisterssubagent/provider-addedandsubagent/provider-removedlisteners before checking whether its selected provider exists, which is correct for sibling load-order independence. However, it does not reserve the eventual tool name at apply time. The only duplicate-name check is insidectx.tools.register()inmount(provider), so two waiting instances remain latent until provider arrival. At that point the error escapes the addition listener and can roll back the provider that triggered it.Continuable instances happen to reserve a related prompt-section name, but one-shot instances have no equivalent early ownership record. Name validity should not depend on background mode or provider timing.
Proposed fix
The patch adds an app-scoped intent registry for live
tool-subagentnames:WeakMap<Context, Set<string>>is keyed byctx.root, so separate applications in one process do not share names;toolNamebefore observing provider lifecycle events;This keeps the existing reactive provider design: the model-facing tool still appears only while its selected provider exists, and its wording is still re-derived after provider reload.
Verification
The new regression proves that:
toolName;Full validation completed successfully:
Patch
Lzb-gzist:agent/subagent-toolname-intent-reservationAll reactions