gut(ui): remove plugin discriminator from tool catalog types (#2522)#2534
Merged
alexey-pelykh merged 1 commit intomainfrom Apr 24, 2026
Merged
gut(ui): remove plugin discriminator from tool catalog types (#2522)#2534alexey-pelykh merged 1 commit intomainfrom
alexey-pelykh merged 1 commit intomainfrom
Conversation
… no consumer (#2522) Narrow `source: "core" | "plugin"` to `source: "core"` and delete optional `pluginId?: string` on `ToolCatalogEntry` and `ToolCatalogGroup`. No UI code branches on these fields (zero grep hits in `ui/src/`), so the discriminator is dead weight from the gutted plugin system. Backend (`src/gateway/server-methods/tools-catalog.ts`) still emits `"plugin"` values via `buildPluginGroups`; gutting that path is out of scope for this issue and would be tracked separately. UI narrowing is safe at the type level because UI does not runtime-validate the response — the narrowed type is declarative documentation that the UI ignores the `"plugin"` case entirely. Refs #2522
alexey-pelykh
added a commit
that referenced
this pull request
Apr 24, 2026
…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>
10 tasks
alexey-pelykh
added a commit
that referenced
this pull request
Apr 24, 2026
…re plugin tag after #2522 over-narrowing (#2548) 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
Narrow
source: "core" | "plugin"→source: "core"and delete optionalpluginId?: stringonToolCatalogEntryandToolCatalogGroupinui/src/ui/types.ts. UI has zero consumers of either field (no branches onsource, no reads ofpluginId), so the discriminator is dead weight fromthe gutted plugin system.
Closes #2522.
Changes
ui/src/ui/types.ts(L352-367): 2 literals narrowed, 2 optional fields deleted.Backend coordination note
Backend (
src/gateway/server-methods/tools-catalog.ts:99,110) still emitssource: "plugin"viabuildPluginGroups— the plugin subsystem is notfully gutted yet. This is out of scope for #2522, which per its title/AC
is UI-only.
Narrowing is safe at the UI type level because the UI consumes the response
via an untyped generic cast (
request<ToolsCatalogResult>) with no runtimeschema validation. The narrowed type is declarative-only: it documents that
UI code should not branch on
"plugin", and since no UI code does, theruntime shape of the response is immaterial.
If/when the backend-side gut is done, the protocol schema at
src/gateway/protocol/schema/agents-tools.tsand the handler atsrc/gateway/server-methods/tools-catalog.tswill need a matching narrowing —tracked as a follow-up, not in this PR.
AC evidence
grep -rn 'pluginId' ui/src/→ zero hits ✅grep -rn 'source: "plugin"\|source:"plugin"' ui/src/→ zero hits ✅pnpm check→ green (format, tsgo, lint, CSS class drift) ✅pnpm test→ green (7014 passed, 3 skipped) ✅pnpm test:ui:smoke→ green (12 passed across 2 files) ✅Test plan
pnpm checkpassespnpm testpassespnpm test:ui:smokepasses🤖 Generated with Claude Code