# Plan: Travel Agent Context + Models Follow-up ## Scope Address three follow-up issues in collection-level AI Travel Assistant: 1. Provider model dropdown only shows one option. 2. Chat context appears location-centric instead of full-trip/collection-centric. 3. Suggested prompts still assume a single location instead of itinerary-wide planning. ## Tasks - [x] **F1 — Expand model options for OpenCode Zen provider** - **Acceptance criteria**: - Model dropdown offers multiple valid options for `opencode_zen` (not just one hardcoded value). - Options are sourced in a maintainable way (backend-side). - Selecting an option is sent through existing `model` override path. - **Agent**: explorer → coder → reviewer → tester - **Dependencies**: discovery of current `/api/chat/providers/{id}/models/` behavior. - **Workstream**: `main` (follow-up bugfix set) - **Implementation note (2026-03-09)**: Updated `ChatProviderCatalogViewSet.models()` in `backend/server/chat/views/__init__.py` to return a curated multi-model list for `opencode_zen` (OpenAI + Anthropic options), excluding `openai/o1-preview` and `openai/o1-mini` per critic guardrail. - [x] **F2 — Correct chat context to reflect full trip/collection** - **Acceptance criteria**: - Assistant guidance/prompt context emphasizes full collection itinerary and date window. - Tool calls for planning are grounded in trip-level context (not only one location label). - No regression in existing collection-context fields. - **Agent**: explorer → coder → reviewer → tester - **Dependencies**: discovery of system prompt + tool context assembly. - **Workstream**: `main` - **Implementation note (2026-03-09)**: Updated frontend `deriveCollectionDestination()` to summarize unique itinerary stops (city/country-first with fallback names, compact cap), enriched backend `send_message()` trip context with collection-derived multi-stop itinerary data from `collection.locations`, and added explicit system prompt guidance to treat collection chats as trip-level and call `get_trip_details` before location search when additional context is needed. - [x] **F3 — Make suggested prompts itinerary-centric** - **Acceptance criteria**: - Quick-action prompts no longer require/assume a single destination. - Prompts read naturally for multi-city/multi-country collections. - **Agent**: explorer → coder → reviewer → tester - **Dependencies**: discovery of prompt rendering logic in `AITravelChat.svelte`. - **Workstream**: `main` - **Implementation note (2026-03-09)**: Updated `AITravelChat.svelte` quick-action guard to use `collectionName || destination` context and itinerary-focused wording for Restaurants/Activities prompts; fixed `search_places` tool result parsing by changing `.places` reads to backend-aligned `.results` in both `hasPlaceResults()` and `getPlaceResults()`, restoring place-card rendering and Add-to-Itinerary actions. ## Notes - User-provided trace in `agent-interaction.txt` indicates location-heavy responses and a `{"error":"location is required"}` tool failure during itinerary add flow. --- ## Discovery Findings ### F1 — Model dropdown shows only one option **Root cause**: `backend/server/chat/views/__init__.py` lines 417–418, `ChatProviderCatalogViewSet.models()`: ```python if provider in ["opencode_zen"]: return Response({"models": ["openai/gpt-5-nano"]}) ``` The `opencode_zen` branch returns a single-element list. All other non-matched providers fall to `return Response({"models": []})` (line 420). **Frontend loading path** (`AITravelChat.svelte` lines 115–142, `loadModelsForProvider()`): - `GET /api/chat/providers/{provider}/models/` → sets `availableModels = data.models`. - When the list has exactly one item, the dropdown shows only that item (correct DaisyUI `