[PR #8323] feat(dashboard): add Model Selection History & Contextual Routing Visualization #12704

Closed
opened 2026-02-16 18:17:36 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/8323

State: closed
Merged: No


Summary

This PR refactors the swarm_dashboard.py to include a Model Selection History panel, enabling real-time visualization of the Contextual Bandit's routing decisions.

Changes

  • New Panel: Added "Recent Model Activity" to the dashboard, displaying the last 15 task outcomes (Time, Model, Task, Status, Cost).
  • Contextual Routing Visualization: The history panel surfaces the why behind model selection, integrating data from the new routing_decisions table.
  • Path Resolution: Introduced swarm/path_resolver.py to dynamically locate metrics databases, fixing hardcoded path issues and ensuring consistency across the orchestrator.
  • Metrics Seeding: Added swarm/benchmark/seed_metrics.py to bootstrap the routing intelligence with historical performance data.

Live Test Results

The refactor was verified in a live test where the Swarm correctly routed:

  • Planning tasks to deepseek-reasoner-r1 (100% reasoning success).
  • Coding tasks to gemini-2.5-flash (high speed/low cost).
  • Integration tasks to grok-code (free-tier optimization).

The dashboard successfully displayed these decisions, providing transparency into the agentic workflow.

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/8323 **State:** closed **Merged:** No --- ## Summary This PR refactors the `swarm_dashboard.py` to include a **Model Selection History** panel, enabling real-time visualization of the Contextual Bandit's routing decisions. ## Changes - **New Panel**: Added "Recent Model Activity" to the dashboard, displaying the last 15 task outcomes (Time, Model, Task, Status, Cost). - **Contextual Routing Visualization**: The history panel surfaces the *why* behind model selection, integrating data from the new `routing_decisions` table. - **Path Resolution**: Introduced `swarm/path_resolver.py` to dynamically locate metrics databases, fixing hardcoded path issues and ensuring consistency across the orchestrator. - **Metrics Seeding**: Added `swarm/benchmark/seed_metrics.py` to bootstrap the routing intelligence with historical performance data. ## Live Test Results The refactor was verified in a live test where the Swarm correctly routed: - **Planning** tasks to `deepseek-reasoner-r1` (100% reasoning success). - **Coding** tasks to `gemini-2.5-flash` (high speed/low cost). - **Integration** tasks to `grok-code` (free-tier optimization). The dashboard successfully displayed these decisions, providing transparency into the agentic workflow.
yindo added the pull-request label 2026-02-16 18:17:36 -05:00
yindo closed this issue 2026-02-16 18:17:36 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#12704