Skip to content

fix(tui): SDD phase models configured directly in opencode.json show as [default] in Configure Models #2771

Description

@efirvida

Pre-flight Checklist

  • I have searched existing issues and this is not a duplicate
  • I understand that PRs will be rejected if the linked issue does not have status:approved

📝 Bug Description

When SDD phase models are configured directly in opencode.json (e.g., by an AI agent setting agent.sdd-explore.model, agent.sdd-propose.model, etc.), the gga TUI "Configure OpenCode Models" screen does not reflect those assignments — all phases show [default].

OpenCode itself correctly picks up and uses the configured models at runtime for each SDD phase, confirming the config entries are valid.

What I did: I asked DeepSeek V4 Pro (via OpenCode) to choose the best cost/benefit models for each SDD phase and write them into my OpenCode config. It configured them in opencode.json under the agent map. I verified that each SDD phase (init, explore, propose, spec, design, tasks, apply, verify, archive, onboard) uses the right model at runtime.

What gga shows: Opening gga → "Configure OpenCode Models" shows every phase as [default], as if the config entries don't exist.

🔄 Steps to Reproduce

  1. Configure SDD phase models directly in opencode.json (not through gga TUI). For example:
    {
      "agent": {
        "sdd-explore": { "model": "deepseek/deepseek-v4-pro" },
        "sdd-apply":   { "model": "deepseek/deepseek-v4-pro" }
      }
    }
  2. Run gga
  3. Go to "Configure Models" → "Configure OpenCode Models"
  4. Observe the phase assignments

✅ Expected Behavior

The "Configure OpenCode Models" screen should load the model assignments from opencode.json (agent.<phase>.model) and display the actual configured provider/model for each phase, matching what OpenCode uses at runtime.

❌ Actual Behavior

All SDD phases show [default]. The models configured in opencode.json are not reflected.

Gentle AI Version

  • gentle-ai: 2.3.0
  • gga: 2.10.1

Operating System

Linux

AI Agent / Client

OpenCode

📋 Affected Area

TUI (terminal UI)

Additional Context

Looking at the code path:

  • ReadCurrentModelAssignments() (internal/components/sdd/read_assignments.go:44) reads from opencode.DefaultSettingsPath() which resolves to ~/.config/opencode/opencode.json
  • It extracts agent.<phase>.model for phases in configurableAgentSet
  • This is called at internal/tui/model.go:2005-2007 when entering the Configure OpenCode Models screen, guarded by if m.Selection.ModelAssignments == nil

The user confirmed they use opencode.json (not .jsonc), so the file path should be correct. If the models are in agent.<phase>.model format with a provider/model separator (/ or :), ReadCurrentModelAssignments should pick them up.

Related but distinct issues: #771 (custom providers in .jsonc), #950 (wrong profile loaded by model screen).

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

    bugSomething isn't workingstatus:approvedApproved for implementation — PRs can now be openedtype:bugBug fixup-for-grabsScoped, approved and ready for a community contributor to pick up

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions