Skip to content

feat(tui): VS Code Copilot SDD profiles wizard and management screens #506

Description

@Snakeblack

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

🔍 Affected Area

TUI (terminal UI)

💡 Problem Statement

PR #505 ships the backend for VS Code Copilot SDD multi-mode — adapter activation, embedded templates, profile generator, injection wiring. After it merges, running gentle-ai → Start installation → VS Code Copilot → SDD multi-mode correctly writes the 10 default .agent.md files.

But the named-profile flow is not reachable from the TUI. The current OpenCode SDD Profiles entry in the welcome menu is hardcoded to OpenCode (internal/tui/screens/welcome.go:41-44, profiles.go:11-19). VS Code users have no way to:

  • Create a named profile like cheap or fast with per-phase model assignments
  • See the list of existing VS Code profiles on disk
  • Delete a profile and clean up ~/.copilot/agents/sdd-*-{name}.agent.md files

Same business context as #504: with GitHub Copilot moving to AI Credits in June, the per-phase model assignment story is exactly the cost lever enterprise teams need — and right now that story stops at the Go API. Without TUI integration, the feature is invisible to the people who would benefit most.

📦 Proposed Solution

Hybrid approach: keep one set of profile screens, make them adapter-aware. Single ActiveProfileAdapter model.AgentID field threads through the flow.

New backend helper

  • vscode.DetectVSCodeProfiles(agentsDir) — scans ~/.copilot/agents/sdd-*-{name}.agent.md, returns deduplicated []model.Profile. Mirrors sdd.DetectProfiles for OpenCode.

TUI changes

  • New hasDetectedVSCode() helper and VSCodeProfileList field in Model
  • Welcome menu: new conditional entry VS Code SDD Profiles (N) next to the existing OpenCode entry
  • Profiles screen: title and subtitle parameterized by active adapter (OpenCode vs VS Code)
  • ProfileDelete screen: wording adapts (opencode.json vs ~/.copilot/agents/), and skips the sync step for VS Code (direct file deletion via RemoveVSCodeProfileAgents)
  • Profile create: a new VSCodeModelPickerState driven by the static vscModelEntries table (the 9 Copilot models). Step 1 of create lets the user assign different models per phase, matching what OpenCode profiles already do. On confirm, calls GenerateVSCodeProfileFiles directly (no sync pipeline — VS Code profiles are just files).
  • Router: ScreenProfiles, ScreenProfileCreate, ScreenProfileDelete reused; behavior gated by ActiveProfileAdapter.

After this lands, the flow for a VS Code Copilot user mirrors what OpenCode users have today:

  1. gentle-ai → welcome → VS Code SDD Profiles (0)
  2. Create new profile → name it (e.g. cheap) → pick a model per phase from the Copilot list → confirm
  3. 10 sdd-*-cheap.agent.md files written to ~/.copilot/agents/ with resolved model: field
  4. Copilot picks them up immediately

🔄 Alternatives Considered

  • Parallel screens (ScreenVSCodeProfiles, etc.) — doubles screen count and duplicates handler logic, ~600+ LOC and harder to keep in sync.
  • Fully generalize the existing screens via interface — requires abstracting the sync pipeline and SyncOverrides, much more invasive than necessary for two adapters.
  • Skip per-phase model picker for V1 — leaves the cost-lever story incomplete. Defeats the AI Credits motivation.

📎 Additional Context

Depends on #504 / PR #505 (backend foundation). This PR is stacked on feat/vscode-copilot-sdd-multimode and will rebase onto main automatically when PR #505 merges.

Expected diff: ~430 LOC (production + tests). Hybrid approach keeps shared screens; only adapter-specific branches diverge.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions