Skip to content

Add scoped-model configuration to dashboard settings #404

Description

@m-aebrer

Summary

Add a dashboard Settings component for configuring the persistent scoped-model list used for model cycling. It should provide browser parity with the saved configuration from the TUI's /scoped-models selector while making ordering, persistence, and "all models" behavior explicit.

Current Behavior

The TUI /scoped-models selector lets users enable, disable, and reorder models, then persist the result as enabledModels in settings.

The dashboard currently:

  • Shows the active runtime's scopedModels in the session model picker.
  • Provides Settings controls for the default model and per-agent model fallbacks.
  • Cannot display or edit persistent enabledModels.
  • Cannot persist scoped models because get_settings and set_settings do not expose that field.

Users must edit settings.json or return to the TUI to configure model cycling.

Proposed Behavior

Add a Scoped models editor to dashboard Settings that:

  • Loads all available models and the effective persisted enabledModels scope.
  • Groups models by provider and supports search.
  • Enables or disables individual models and whole providers.
  • Shows enabled models in their model-cycling order.
  • Allows enabled models to be reordered.
  • Uses staged changes with an explicit save action.
  • Persists canonical provider/model references through the settings RPC.
  • Treats all models selected as an unfiltered scope and removes the persisted filter.
  • Prevents saving an ambiguous zero-model scope and displays an explicit validation message.
  • Explains that the setting applies to newly created sessions and does not mutate running sessions.
  • Surfaces validation, persistence, and project-shadowing warnings verbatim.

Acceptance Criteria

  • Dashboard Settings displays the persisted scoped-model configuration.
  • Available models are searchable and grouped by provider.
  • Users can enable or disable individual models.
  • Users can enable or disable all models for a provider.
  • Users can enable all models.
  • Enabled models can be reordered, and the saved order determines model-cycling order.
  • Saving a partial selection persists ordered canonical provider/model entries as enabledModels.
  • Saving all available models clears the enabledModels filter rather than freezing the current model inventory.
  • A zero-model selection may be used while editing but cannot be saved silently as "all models."
  • Existing pattern-based enabledModels settings are resolved using the core model resolver rather than reimplementing pattern matching in the browser.
  • The RPC contract has an explicit representation for clearing enabledModels; it does not rely on serializing undefined.
  • Invalid input or failed writes leave the prior durable setting intact and surface an explicit error.
  • A project-level enabledModels override that shadows a global dashboard write produces a visible warning.
  • The UI works on desktop and mobile layouts.
  • Tests cover RPC validation/persistence/clearing and dashboard selection, ordering, save, and error states.
  • User-facing dashboard, settings, and RPC documentation is updated.

Context

Scoped-model UI was deliberately sequenced after the dashboard foundation work:

The TUI already provides the reference behavior through /scoped-models.

Technical Notes

Relevant implementation areas include:

  • packages/coding-agent/src/core/settings-manager.ts
    • Existing getEnabledModels() and setEnabledModels() methods.
  • packages/coding-agent/src/core/model-resolver.ts
    • Reuse resolveModelScope() for existing patterns and ordering.
  • packages/coding-agent/src/modes/rpc/rpc-types.ts
    • Add enabledModels to settings snapshot/update types.
    • Define an explicit clear representation, such as null in updates.
  • packages/coding-agent/src/modes/rpc/rpc-mode.ts
    • Add snapshot mapping, atomic validation, persistence, and shadow warnings.
  • packages/dashboard/src/shared/protocol.ts
    • Extend dashboard settings DTOs.
  • packages/dashboard/src/client/screens/settings.tsx
    • Add the scoped-model editor, likely reusing the existing model-picker primitives.
  • packages/dashboard/test/client/screens.test.tsx
    • Cover interaction and error behavior.

Documentation should remain synchronized across:

  • README.md
  • packages/coding-agent/README.md
  • packages/coding-agent/docs/settings.md
  • packages/coding-agent/docs/rpc.md
  • packages/coding-agent/docs/dashboard.md
  • packages/dashboard/README.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1Important for workflow completenessdashboardDashboard server or clientenhancementNew feature or requestuxUser experience improvements

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions