Skip to content

Dashboard fallback: show last working version when agent breaks dashboard.yaml #66

Closed

Description

@vybe

Problem

When an agent modifies its dashboard.yaml and introduces errors (YAML syntax, missing fields, etc.), the Dashboard tab immediately shows a red error screen with the raw validation message. The previously working dashboard disappears entirely.

This is a common scenario — agents update their own dashboards and sometimes break them.

Desired Behavior

When dashboard.yaml fails validation, show the last known good dashboard with a yellow/amber banner indicating the current version is broken, along with the error details. Once the agent fixes the YAML, the banner disappears and the live version resumes.

Current Architecture

  • Agent-server (docker/base-image/agent_server/routers/dashboard.py) reads and validates dashboard.yaml, returns has_dashboard: false + error on failure
  • Backend (src/backend/services/agent_service/dashboard.py) passes the error through — no fallback
  • agent_dashboard_values table stores historical widget values only (metric/progress/status), not the full config structure
  • Frontend (src/frontend/src/components/DashboardPanel.vue) shows error state when has_dashboard: false

Implementation Plan

1. New DB table: agent_dashboard_configs

Single-row-per-agent cache of the last valid config:

CREATE TABLE IF NOT EXISTS agent_dashboard_configs (
    agent_name TEXT PRIMARY KEY,
    config_json TEXT NOT NULL,
    dashboard_mtime TEXT NOT NULL,
    captured_at TEXT NOT NULL
);

2. Backend service changes

File: src/backend/services/agent_service/dashboard.py + src/backend/db/dashboard_history.py

  • On successful dashboard read (has_dashboard: true): upsert the full config into agent_dashboard_configs
  • On error (has_dashboard: false + error): query agent_dashboard_configs for cached config. If found, return it with:
    • stale: true
    • stale_error: "<validation error from broken version>"

3. Frontend banner

File: src/frontend/src/components/DashboardPanel.vue

  • When dashboardData.stale === true: render the cached dashboard normally but show an amber banner at the top with the error message
  • Auto-refresh continues polling — banner disappears once the agent fixes the YAML

Files touched

Layer File Change
DB Schema src/backend/db/schema.py Add agent_dashboard_configs table
DB Ops src/backend/db/dashboard_history.py Add save_good_config() + get_last_good_config()
Backend src/backend/services/agent_service/dashboard.py Save on success, fallback on error
Frontend src/frontend/src/components/DashboardPanel.vue Amber stale banner

No changes needed to agent-server side.

Activity

  1. added
    priority-p2
    type-feature
    on Mar 4, 2026
  2. added
    complexity-low
    theme-ui-ux
    on Jun 3, 2026
  3. added
    status-incubating
    on Jun 14, 2026
  4. vybe commented on Jun 15, 2026

    @vybe
    ContributorAuthor

    Grooming triage: verified shipped — src/backend/services/agent_service/dashboard.py:298 returns cached stale-data fallback when the live dashboard breaks. Closing as done.

  5. added a commit that references this issue on Jul 2, 2026
  6. removed
    status-incubating
    on Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    complexity-lowpriority-p2theme-ui-uxtype-feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions