Skip to content

Dashboard agent models: new fallback models should be prepended, not appended #494

Description

@aebrer

Original Request

When editing the agent models settings (the fallback list of models to use for agent defs) in the Dashboard settings page, when the user clicks add model it currently appends it to the end of the list. It would be more convenient if it instead placed the new model at the top of the list. Thats it. Small change.

Summary

In the Dashboard Settings page, the per-agent fallback model list ("agent models") is ordered by priority — first available model wins. When a user adds a model via "add model…", the new model is appended to the end of the list (lowest priority). The new model should instead be placed at the top of the list, since adding a model is most often done to make it the top-priority choice.

Current Behavior

  • Dashboard → Settings → "agent models" section → pick an agent → "add model…" → select a model in the picker → the model is appended to the end of that agent's fallback list (lowest priority).
  • Implementation: the model picker's onPick handler in packages/dashboard/src/client/screens/settings.tsx saves [...currentList, entry] for the agent fallback list.

Proposed Behavior

  • Selecting a model for an agent fallback list inserts it at the top of the list (position 1, highest priority); existing entries keep their relative order and shift down by one.
  • Everything else about the picker/editor is unchanged, including the existing no-op when the selected model is already in the list.

Acceptance Criteria

  1. In the Dashboard Settings → agent models editor, selecting a model via "add model…" places the new model at the top (position 1) of the agent's fallback list, with existing entries keeping their relative order.
  2. A dashboard client test verifies the prepend behavior for a list that is already non-empty (the existing "settings agent-model editor adds a model override" test covers only adding to an empty list and would pass under either ordering).

Context

  • The dashboard "agent models" editor has been part of the Settings page since PR Build first-class dreb web dashboard (foundation) #321 ("Build first-class dreb web dashboard (foundation)").
  • agentModels documentation (packages/coding-agent/docs/settings.md, packages/coding-agent/docs/agent-models.md) already describes first-available-wins ordering; no doc changes needed.
  • Scope: dashboard only — the TUI /settings → Agent Models flow is a separate surface and is not touched by this issue.

Technical Notes

  • One-line change: in packages/dashboard/src/client/screens/settings.tsx, in the model-picker modal's onPick handler (active.kind === "agent" branch), change [...currentList, entry] to [entry, ...currentList].
  • The duplicate guard (if (currentList.includes(entry)) return;) is unchanged.
  • Test: extend or add to packages/dashboard/test/client/screens.test.tsx ("settings agent-model editor adds a model override") with a pre-populated list to pin the new ordering.

Activity

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

    dashboardDashboard 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