{
  "track_id": "qwen_llama_grok_followup_20260611",
  "name": "Qwen/Llama/Grok Follow-Up (tool loop, PROVIDERS move, UX adaptations 2-9, local-first, matrix v2, Anthropic/Gemini/DeepSeek migration)",
  "initialized": "2026-06-11",
  "owner": "tier2-tech-lead",
  "priority": "high",
  "status": "active",
  "type": "refactor + feature",
  "scope": {
    "new_files": [
      "tests/test_ai_client_tool_loop.py",
      "tests/test_ai_client_llama_ollama_native.py",
      "tests/test_ai_client_llama_meta_api.py",
      "scripts/audit_no_inline_tool_loops.py",
      "scripts/audit_providers_source_of_truth.py"
    ],
    "modified_files": [
      "src/ai_client.py",
      "src/vendor_capabilities.py",
      "src/gui_2.py",
      "src/models.py",
      "tests/test_minimax_provider.py",
      "tests/test_grok_provider.py",
      "tests/test_llama_provider.py",
      "tests/test_qwen_provider.py",
      "tests/test_anthropic_provider.py",
      "tests/test_gemini_provider.py",
      "tests/test_deepseek_provider.py",
      "docs/guide_ai_client.md",
      "docs/guide_models.md"
    ]
  },
  "blocked_by": {
    "qwen_llama_grok_integration_20260606": "phase_6_in_progress"
  },
  "blocks": [
    "anthropic_gemini_deepseek_capability_matrix_20260606"
  ],
  "estimated_phases": 5,
  "spec": "spec.md",
  "plan": "plan.md",
  "state": "state.toml",
  "todo": "TODO.md",
  "priority_order": "A (tool loop lift + PROVIDERS move + UX 2-9) > B (local-first + matrix v2) > C (Anthropic/Gemini/DeepSeek migration)",
  "user_directions": [
    "2026-06-11: User wants REPORT explaining why a follow-up is needed (gaps in parent track).",
    "2026-06-11: User wants LOCAL MODELS prioritized as first-class; current implementation treats Ollama as 'one of 3 backends' which under-emphasizes local.",
    "2026-06-11: User wants the source-of-truth sprawl cleaned up (PROVIDERS in models.py is wrong; should be elsewhere).",
    "2026-06-11: User wants ai_client.py further codepath consolidation; new files need review."
  ],
  "verification_criteria": [
    "src/ai_client.py:run_with_tool_loop handles no-tool-calls, dispatches tool calls, respects max-rounds, appends to history, doesn't crash on tool error",
    "All 8 vendors (_send_minimax, _send_qwen, _send_grok, _send_llama, _send_anthropic, _send_gemini, _send_gemini_cli, _send_deepseek) use run_with_tool_loop",
    "scripts/audit_no_inline_tool_loops.py passes (no inline tool loops in any _send_<vendor>)",
    "PROVIDERS is no longer declared in src/models.py",
    "scripts/audit_providers_source_of_truth.py passes",
    "All 9 UX adaptations from parent spec §6 are applied to src/gui_2.py (1 from parent Phase 5 + 8 from this track's Phase 3)",
    "src/ai_client.py:ollama_chat is the native Ollama adapter; Ollama backend routes to it when base_url is localhost/127.0.0.1 (replaces OpenAI-compatible)",
    "src/ai_client.py:meta_llama_chat is the Meta Llama API adapter; new 4th Llama backend (DEFER if https://llama.developer.meta.com/docs/overview still returns 400)",
    "src/vendor_capabilities.py: 12 new v2 fields added (local, reasoning, structured_output, code_execution, web_search, x_search, file_search, mcp_support, audio, video, grounding, computer_use)",
    "All vendor registry entries updated with the new fields",
    "Anthropic matrix entries populated (caching, extended_thinking, pdf, computer_use)",
    "Gemini matrix entries populated (caching, grounding, video, audio)",
    "DeepSeek matrix entries populated (reasoning, low_cost)",
    "GUI: 'Local Model' badge added to AI Settings panel",
    "GUI: 4 cost panel states (estimate / 'Free (local)' / '-' / new local-no-cost state)",
    "All existing tests still pass (38+ in batch; full suite has pre-existing live_gui flakes)",
    "No new threading.Thread calls",
    "docs/guide_ai_client.md + docs/guide_models.md updated"
  ],
  "links": {
    "parent_track": "conductor/tracks/qwen_llama_grok_integration_20260606/",
    "parent_spec": "conductor/tracks/qwen_llama_grok_integration_20260606/spec.md",
    "ai_client_guide": "docs/guide_ai_client.md",
    "models_guide": "docs/guide_models.md",
    "follow_up_audit_report": "docs/reports/qwen_llama_grok_followup_audit_20260611.md (already exists; written 2026-06-11 at end of parent track Phase 6)",
  }
}
