Skip to content

fix(tui)!: per-agent role models in workflow.yaml + canonical SDD preload#68

Merged
davidarce merged 2 commits into
mainfrom
fix/workflow-role-per-agent-models
May 9, 2026
Merged

fix(tui)!: per-agent role models in workflow.yaml + canonical SDD preload#68
davidarce merged 2 commits into
mainfrom
fix/workflow-role-per-agent-models

Conversation

@davidarce

Copy link
Copy Markdown
Owner

Summary

  • WorkflowRole.Model (single string) is replaced by WorkflowRole.Models map[string]string keyed by agent name (claude/opencode/copilot). Required for kind: subagent; rejected on kind: orchestrator.
  • DevRune fetches SDD's workflow.yaml from the canonical catalog source (github:davidarce/devrune-starter-catalog) at wizard start via the existing cache layer, before the model-selection step. The synthetic hardcoded SDD role list is gone.
  • Each renderer (claude / opencode / copilot) reads role.Models[agent] instead of role.Model. buildWorkflowPlaceholderReplacements gains an agentName parameter.

Why

The TUI model-selection step on a fresh install never received the yaml's declared model defaults. app.go passed an empty []WorkflowManifest to RunWorkflowModelSelection (model selection runs before the catalog scan by design), so the synthetic fallback in workflow_models.go:909-917 used Model: roleName placeholders instead of real values. Even when the user later saved choices to devrune.yaml, the catalog could only express one tier per role across all agents — not enough for "haiku on claude, claude-haiku-4.5 on opencode, Claude Haiku 4.5 on copilot".

Schema

roles:
  - name: sdd-explorer
    kind: subagent
    skill: sdd-explore
    models:
      claude: haiku
      opencode: haiku
      copilot: Claude Haiku 4.5

Architecture

internal/tui/scanner.go exposes FetchSDDWorkflow(ctx, cachePath) and the constant CanonicalSDDSource. app.go:115-133 calls it before invoking RunWorkflowModelSelection, passing the resulting manifest. The same fetch is performed again at the regular scan step but the cache layer makes it near-instant. Network failures fall through silently — the wizard continues with "inherit" defaults.

Breaking change

Catalogs that still declare model: instead of models: will fail Validate(). Requires the matching catalog update in davidarce/devrune-starter-catalog#53.

Test plan

  • go test ./... (full suite)
  • Unit tests added: TestSubagentRoles_FiltersByModelsMap, TestWorkflowRole_ValidateModelsRequired, TestWorkflowRole_ModelFor
  • Manual: install SDD from scratch, verify model-selection step seeds per-agent defaults from the catalog
  • Manual: re-run "manage sdd models" and verify saved selections still load
  • Manual: install offline (no cache, no network) — wizard continues with "inherit" defaults

Closes #67

🤖 Generated with Claude Code

davidarce added 2 commits May 9, 2026 20:54
…reload

BREAKING CHANGE: WorkflowRole.Model (single string) is removed. Subagent roles
must now declare a non-empty `models` map keyed by agent name (claude,
opencode, copilot). Catalogs that still use `model:` will fail Validate().

Why
---
The TUI model-selection step on a fresh install never received the yaml's
declared model defaults. app.go passed an empty []WorkflowManifest to
RunWorkflowModelSelection (model selection runs before the catalog scan by
design), so the synthetic fallback in workflow_models.go used `Model: roleName`
placeholders instead of real values. Even when the user later saved choices
to devrune.yaml, the catalog could only express one tier per role across all
agents — not enough for "haiku on claude, claude-haiku-4.5 on opencode,
Claude Haiku 4.5 on copilot".

Schema
------
  roles:
    - name: sdd-explorer
      kind: subagent
      skill: sdd-explore
      models:
        claude: haiku
        opencode: haiku
        copilot: Claude Haiku 4.5

Validate() now requires a non-empty `models` for kind: subagent and rejects
`models` on kind: orchestrator.

Architecture
------------
DevRune fetches SDD's workflow.yaml from the canonical catalog source
(github:davidarce/devrune-starter-catalog) at wizard start via the existing
cache layer, before the model-selection step. Cache makes subsequent runs
near-instant; first run is the same fetch the regular scan step performs
moments later. The synthetic hardcoded SDD role list is gone.

Renderer migration
------------------
buildWorkflowPlaceholderReplacements gains an `agentName` parameter; each
renderer (claude / opencode / copilot) passes its own name and reads
role.Models[agent] instead of role.Model. ModelFor(agent) is a new accessor
that returns the empty string when the map is nil.

Closes #67
GPT-5.5 is the latest standard OpenAI model available in Copilot. Slotted
above GPT-5.4 in the OpenAI block (newest-first within versioned siblings,
matching the existing convention for Opus 4.7 vs 4.6).

Tier 2.0 / multiplier 1× / "Pro and above" — same shape as GPT-5.4. Tests
that lock the canonical option order are shifted accordingly (xAI moves
from idx 11 → 12; tier-2 filter total 10 → 11).
@davidarce
davidarce force-pushed the fix/workflow-role-per-agent-models branch from fea8399 to 201baed Compare May 9, 2026 18:54
@davidarce
davidarce merged commit 63f3e08 into main May 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(tui): workflow model selection ignores yaml roles & model defaults on fresh install

1 participant