-
-
Notifications
You must be signed in to change notification settings - Fork 130
Description
Describe the bug
The Vega chart creation plugin is not properly registered in the main plugin system, making it completely non-functional despite existing in the codebase. The plugin implementation exists at vega.ts:8-52 and is configured in default settings at [2](settings.json:432-434), but it's missing from the availablePlugins
registry. This causes:
- The plugin doesn't appear in Settings → Plugins UI
- The plugin doesn't appear in per-LLM tool selection
- LLMs cannot call the
vega_chart_creation
function - Vega charts are never generated, only raw JSON is returned
To Reproduce
- Go to 'Settings' → 'Plugins'
- Notice that no "Vega" plugin appears in the list (despite existing in codebase)
- Go to 'Chat' → Select any LLM → Settings → Plugins Customize
- Notice that no "Vega" plugin appears in the list here either
- In any chat, prompt an LLM either: A: "Use_ the vega_chart_creation function to create a bar chart" or B: "Create a Vega chart that displays a bar chart showing monthly sales data for the first 6 months of 2024: January: $45,000, February: $52,000, March: $48,000, April: $61,000, May: $58,000, June: $67,000. Generate a visualization so I can see it rendered inline in the chat and test the interactive features like theme switching, code viewing, and download functionality"
- See that the LLM returns raw Vega JSON specification instead of calling the plugin function
- Tested with multiple LLM providers: Grok 4, GPT-4.1, Kimi K2, and Claude Sonnet 4 - all exhibit the same behavior. Vega charts are never generated, only raw JSON is returned.
Expected behavior
- IMO, the Vega plugin doesn't need to appear in Witsy's UI under Settings → Plugins. It should be enabled by default (same as mermaid diagrams)
- The plugin should however appear in the per-LLM tool selection interfaces (described in step 3. above, under "To Reproduce")
- LLMs should be able to call the
vega_chart_creation
function and render the charts - The plugin should execute vega.ts:44-50 and generate PNG chart images that get embedded in chat responses
Desktop (please complete the following information):
- OS: macOS Sequoia 15.5
- Witsy Version: 2.11.2 (1042)
Additional context
As far as I can tell, the root cause is that the Vega plugin is not registered in the availablePlugins
object. While the plugin implementation exists and is actually also referenced in the UI settings component SettingsPlugins.vue:64, it's never actually loaded by the plugin system base.ts:402-455.
I think the fix would be to add vega: VegaPlugin
to the availablePlugins
registry along with the appropriate import statement. This would make the plugin available to both the UI system and the LLM loading mechanisms in base.ts:402-455.
This appears to be an incomplete feature integration where the plugin code was implemented but never properly wired into the main plugin architecture.