Conversation
DSH Desktop mounts `dsh-image-generation`, which claims the global `image_generate` tool unconditionally and throws when the name is already taken. This plugin also prefers the canonical name (V1ki#76), and entries are applied concurrently, so whichever side reaches the registry first decides the outcome. When this plugin wins, the host's `apply` throws and the whole plugin tree fails to load (`plugin tree failed to load: ... tool "image_generate" is already registered`). The plugin's own collision fallback cannot help: the failure happens on the host side. Treat `image_generate` as host-owned, the same way `web_search` was left to the host's seam in f839fdb: register directly under `dsh_subscriptions_image_generate` and never attempt the canonical name. `x_search` and `video_generate` have no host owner, so they keep the canonical-first rule. On a host that ships no image tool the plugin's image tool is now namespaced too; the registry cannot tell whether the host's unprotected registration is still coming, so the alias is the only order-independent choice. The keyed toolview key and title follow the registered name through TOOL_ALIASES, and the per-agent deny list now scopes to that alias, so turning the subscription image switch off no longer hides the host's `image_generate` tool. Tests: new host-owned registration coverage in tool-registration.spec.ts and updated provider-settings RPC expectations.
Owner
|
感谢 @Arrosam 的 PR,也感谢把重名问题和启动顺序的竞争分析清楚。不过这次决定不改名,原因如下:
两个插件谁先加载谁拿到原名,这个问题确实存在。如果你同时在用 Thanks @Arrosam for the PR and for spelling out the collision and the startup race. I've decided not to rename, for these reasons:
Which plugin loads first does decide who gets the canonical name. If you run |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
DSH Desktop mounts
dsh-image-generationas its one sharedimage_generatetool, and that plugin registers it unconditionally — a duplicate throws inside itsapply. This plugin also prefers the canonicalimage_generatename (#76), and loader entries are applied concurrently, so whichever side applies first decides the outcome. When this plugin wins, the host'sapplythrows and the whole plugin tree fails to boot:The plugin's own collision fallback cannot help here, because the failure happens on the host side, not inside
registerWithAlias. In practice this is intermittent: some launches boot (the host registers first and the plugin falls back to its alias) and some abort, which makes it look like a random startup failure.Fix
Treat
image_generateas host-owned — the same call as f839fdb forweb_search: register directly underdsh_subscriptions_image_generateand never attempt the canonical name.x_searchandvideo_generatehave no host owner, so they keep the canonical-first rule from #76.src/tools/registration.ts: addHOST_OWNED_TOOLSand route those names straight toregisterScoped; every other name behaves exactly as before.src/client/index.ts,src/client/ImageGenerateToolview.tsx: the keyed toolview key and title followTOOL_ALIASES.image_generate, so inline rendering keeps working.src/index.ts: comment only.README.md/README.zh.md: document the registered name.image_generate.Behaviour notes
dsh_subscriptions_image_generate; the host'simage_generatetool stays visible.Verification
tsc -p tsconfig.test.jsonclean.node --test "lib-test/test/**/*.spec.js": 507 tests, 500 pass, 0 fail, 7 skipped.tsc+tsdownbuild clean;lib/client.jscarries the new toolview key.