fix(ui): re-widen ToolCatalogEntry/Group source discriminator (#2543)#2548
Merged
alexey-pelykh merged 1 commit intomainfrom Apr 24, 2026
Merged
fix(ui): re-widen ToolCatalogEntry/Group source discriminator (#2543)#2548alexey-pelykh merged 1 commit intomainfrom
alexey-pelykh merged 1 commit intomainfrom
Conversation
…re plugin tag after #2522 over-narrowing Plugin system is a kept, load-bearing extensibility mechanism of the fork (10 active registerTool calls across 5 bundled extensions; buildPluginGroups in src/gateway/server-methods/tools-catalog.ts:71-123 emits source: "plugin" at runtime). PR #2522/#2534 narrowed the UI type system to source: "core" only on the premise that plugins were being gutted — premise was false, corrected in CLAUDE.md via #2544. Widens ToolCatalogEntry.source and ToolCatalogGroup.source back to "core" | "plugin" and restores the pluginId? field on both. Protocol schema (src/gateway/protocol/schema/agents-tools.ts) already carries the full union, so no schema change needed. UI has no current consumer of the tool catalog (removed in #2520), so there is no immediate behavior change — this corrects the latent type lie before any future tool-browsing UI inherits the wrong shape. Closes #2543 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
Re-widens
ToolCatalogEntry.sourceandToolCatalogGroup.sourceinui/src/ui/types.tsfrom"core"back to"core" | "plugin", and restores thepluginId?: stringoptional field on both types. Corrects the narrowing introduced by #2534 (from #2522) which was authored on the false premise that the plugin subsystem was being gutted.Why safe
"plugin"viabuildPluginGroupsatsrc/gateway/server-methods/tools-catalog.ts:99,110(10 activeregisterToolcalls acrossextensions/feishu,extensions/voice-call,extensions/tlon,extensions/zalouser).src/gateway/protocol/schema/agents-tools.ts:200,219declares the full"core" | "plugin"union withpluginId. No schema change needed.ui/src/ui/controllers/agents.test.ts:124-125usessource: "core"literal, which remains valid under the widened union..source(panel body was removed in gut(ui): remove dead Tools tab from Agents view #2520), so there is no runtime behavior change — this corrects the latent type lie before any future tool-browsing UI inherits the wrong shape.Acceptance criteria (from #2543)
ToolCatalogEntry.sourcetyped"core" | "plugin"ToolCatalogGroup.sourcetyped"core" | "plugin"pluginId?: stringpresent on both typespnpm checkgreen (pre-commit hook)pnpm testgreen — 800 files / 7014 passed / 3 skippedpnpm test:ui:smokegreen — 2 files / 12 passedTest plan
git showverified)source: "core"test fixturesbuild,test,lint,docs,test-ui-smokegreenCloses #2543