Skip to content

fix(ui): re-widen ToolCatalogEntry/Group source discriminator (#2543)#2548

Merged
alexey-pelykh merged 1 commit intomainfrom
fix/rewiden-tool-catalog-source
Apr 24, 2026
Merged

fix(ui): re-widen ToolCatalogEntry/Group source discriminator (#2543)#2548
alexey-pelykh merged 1 commit intomainfrom
fix/rewiden-tool-catalog-source

Conversation

@alexey-pelykh
Copy link
Copy Markdown

Summary

Re-widens ToolCatalogEntry.source and ToolCatalogGroup.source in ui/src/ui/types.ts from "core" back to "core" | "plugin", and restores the pluginId?: string optional 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 retention clarified in docs: clarify plugin system is kept, not removed #2544 (CLAUDE.md § Fork Context now explicitly lists plugins under "What stays").
  • Backend already emits "plugin" via buildPluginGroups at src/gateway/server-methods/tools-catalog.ts:99,110 (10 active registerTool calls across extensions/feishu, extensions/voice-call, extensions/tlon, extensions/zalouser).
  • Protocol schema already alignedsrc/gateway/protocol/schema/agents-tools.ts:200,219 declares the full "core" | "plugin" union with pluginId. No schema change needed.
  • Type widening is backward-compatible — existing test fixture at ui/src/ui/controllers/agents.test.ts:124-125 uses source: "core" literal, which remains valid under the widened union.
  • No current UI consumer branches on .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.source typed "core" | "plugin"
  • ToolCatalogGroup.source typed "core" | "plugin"
  • pluginId?: string present on both types
  • pnpm check green (pre-commit hook)
  • pnpm test green — 800 files / 7014 passed / 3 skipped
  • pnpm test:ui:smoke green — 2 files / 12 passed

Test plan

  • Diff matches AC specification byte-for-byte (git show verified)
  • Type-widening does not break existing source: "core" test fixtures
  • Protocol schema contract reverified (no divergence after change)
  • CI: build, test, lint, docs, test-ui-smoke green

Closes #2543

…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>
@alexey-pelykh alexey-pelykh enabled auto-merge (squash) April 24, 2026 14:48
@alexey-pelykh alexey-pelykh merged commit c5d2cc1 into main Apr 24, 2026
16 checks passed
@alexey-pelykh alexey-pelykh deleted the fix/rewiden-tool-catalog-source branch April 24, 2026 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(ui): re-widen ToolCatalogEntry/Group source discriminator to preserve plugin tag — corrects #2522 narrowing

1 participant