# Implementation Plan: Per-Ticket Model Override (per_ticket_model_20260306)

> **Reference:** [Spec](./spec.md) | [Architecture Guide](../../../docs/guide_architecture.md)

## Phase 1: Model Override Field
Focus: Add field to Ticket dataclass

- [ ] Task 1.1: Initialize MMA Environment
- [ ] Task 1.2: Add model_override to Ticket
    - WHERE: `src/models.py` `Ticket` dataclass
    - WHAT: Add optional model override field
    - HOW:
      ```python
      @dataclass
      class Ticket:
       # ... existing fields ...
       model_override: Optional[str] = None
      ```

- [ ] Task 1.3: Update serialization
    - WHERE: `src/models.py` `Ticket.to_dict()` and `from_dict()`
    - WHAT: Include model_override
    - HOW: Add field to dict conversion

## Phase 2: Model Dropdown UI
Focus: Add model selection to ticket display

- [ ] Task 2.1: Get available models list
    - WHERE: `src/gui_2.py` or from cost_tracker
    - WHAT: List of available models
    - HOW:
      ```python
      AVAILABLE_MODELS = ["gemini-2.5-flash-lite", "gemini-2.5-flash", "gemini-3.1-pro-preview", "claude-3-5-sonnet", "deepseek-v3"]
      ```

- [ ] Task 2.2: Add dropdown to ticket UI
    - WHERE: `src/gui_2.py` ticket rendering
    - WHAT: Combo for model selection
    - HOW:
      ```python
      current_model = ticket.model_override or "Default"
      if imgui.begin_combo("Model", current_model):
       if imgui.selectable("Default", ticket.model_override is None):
        ticket.model_override = None
       for model in AVAILABLE_MODELS:
        if imgui.selectable(model, ticket.model_override == model):
         ticket.model_override = model
       imgui.end_combo()
      ```

## Phase 3: Visual Indicator
Focus: Show when override is active

- [ ] Task 3.1: Color-code override tickets
    - WHERE: `src/gui_2.py` ticket rendering
    - WHAT: Visual distinction for override
    - HOW:
      ```python
      if ticket.model_override:
       imgui.text_colored(vec4(255, 200, 100, 255), f"[{ticket.model_override}]")
      ```

## Phase 4: Execution Integration
Focus: Use override in worker execution

- [ ] Task 4.1: Check override in ConductorEngine.run()
    - WHERE: `src/multi_agent_conductor.py` `run()`
    - WHAT: Use ticket.model_override if set
    - HOW:
      ```python
      if ticket.model_override:
       model_name = ticket.model_override
      else:
       # Use existing escalation logic
       models = ["gemini-2.5-flash-lite", "gemini-2.5-flash", "gemini-3.1-pro-preview"]
       model_idx = min(ticket.retry_count, len(models) - 1)
       model_name = models[model_idx]
      ```

## Phase 5: Testing
- [ ] Task 5.1: Write unit tests
- [ ] Task 5.2: Conductor - Phase Verification
