Skip to content

Allow configuring mach6 skill agent models via settings with TUI ranking #219

@maxscheurer

Description

@maxscheurer

Summary

Users who want to change the default models used by mach6 skill agents (e.g. code-reviewer, explore, feature-dev) currently must copy the entire agent .md file to ~/.dreb/agents/ and edit the model: field. This works, but means losing upstream updates to the agent's system prompt, tools list, and description when dreb is updated.

Current Behavior

  • Agent definitions bundle model fallback lists in their .md frontmatter (e.g. model: zai/glm-5-turbo, anthropic/sonnet)
  • The only way to override these is to place a same-named .md file in ~/.dreb/agents/ or .dreb/agents/, which replaces the entire agent definition — prompt, tools, and all
  • The settings system (~/.dreb/agent/settings.json) has defaultProvider/defaultModel but no per-agent model overrides
  • Upgrading dreb doesn't update locally-copied agent files, so users miss improvements to prompts and tool configurations

Proposed Behavior

Add a mach6 section in settings with per-agent model overrides:

{
  "mach6": {
    "models": {
      "code-reviewer": ["anthropic/opus", "anthropic/sonnet"],
      "explore": ["anthropic/sonnet"],
      "feature-dev": ["anthropic/opus", "anthropic/sonnet"],
      "independent-assessor": ["anthropic/opus"]
    }
  }
}

Resolution order: per-invocation model override → mach6.models setting → agent definition model field → parent model fallback.

TUI Experience

  • A "Mach6 Models" section in /settings (clearly labeled as mach6-specific)
  • Shows each mach6 agent with its current model ranking
  • Selecting an agent opens a ranking editor where you can:
    • See available models (from the model registry)
    • Add/remove models from the fallback list
    • Reorder models via up/down keys to set priority (first = preferred, rest = fallbacks)
  • Visual feedback showing the ranked list (e.g. 1. anthropic/opus 2. anthropic/sonnet)

Acceptance Criteria

  • New mach6.models field in Settings interface — a Record<string, string | string[]> mapping agent names to ordered model fallback lists
  • resolveModelForSubagentSpawn respects mach6.models overrides (after per-invocation, before agent definition)
  • Global (~/.dreb/agent/settings.json) and project (.dreb/settings.json) levels both work, with project overriding global via existing deepMergeSettings
  • TUI /settings has a "Mach6 Models" submenu with a ranking/reorder UI for each agent's fallback list
  • Existing behavior unchanged when mach6.models is not set
  • Documentation updated

Technical Notes

  • Settings infrastructure already supports deep merge and TUI editing — settings-manager.ts, settings-selector.ts
  • Model resolution lives in resolveModelForSubagentSpawn() in packages/coding-agent/src/tools/subagent.ts
  • The TUI submenu pattern exists for "Thinking Level" and "Theme" — a ranked list editor is a new component but fits the existing pattern
  • discoverAgentTypes() returns the full agent map — can filter to mach6-relevant agents for the settings UI
  • The ranking UI could use arrow keys (up/down to reorder) similar to sortable list patterns — @dreb/tui may need a new RankedList or ReorderableList component
  • Consider grouping agents by tier in the UI (e.g. "strong" agents like feature-dev/independent-assessor vs "standard" agents like explore/code-reviewer) to help users understand which ones benefit from stronger models

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions