fix(chat): stabilize assistant add flow and location routing

This commit is contained in:
2026-03-10 15:59:07 +00:00
parent 49abfad192
commit 1ad9d20037
7 changed files with 60 additions and 9 deletions

View File

@@ -51,10 +51,11 @@ Run in order: format → lint → check → build.
- Use DaisyUI semantic colors/classes (`bg-primary`, `text-base-content`).
- Chat providers: dynamic catalog from `GET /api/chat/providers/`; configured in `CHAT_PROVIDER_CONFIG`.
- Chat model override: dropdown selector fed by `GET /api/chat/providers/{provider}/models/`; per-provider persistence via `localStorage` key `voyage_chat_model_prefs`; backend `send_message` accepts optional `model`.
- Chat context: collection chats inject collection UUID + multi-stop itinerary context; system prompt guides `get_trip_details`-first reasoning and confirms only before first `add_to_itinerary`.
- Chat context: collection chats inject collection UUID + multi-stop itinerary context; system prompt guides `get_trip_details`-first reasoning and confirms only before first `add_to_itinerary`; `search_places` prompt guard requires the LLM to have a concrete location string before calling the tool (asks clarifying question otherwise).
- Chat tool output: `role=tool` messages hidden from display; tool outputs render as concise summaries; persisted tool rows reconstructed on reload via `rebuildConversationMessages()`.
- Chat errors: `_safe_error_payload()` maps LiteLLM exceptions to sanitized user-safe categories (never raw `exc.message`).
- Invalid tool calls (missing required args) are detected and short-circuited with a user-visible error — not replayed into history.
- Geocoding: `background_geocode_and_assign()` runs in a thread after Location save; populates `region`, `city`, `country`, and also fills `Location.location` from reverse geocode `display_name` (truncated to field max_length) if blank or different.
- Chat agent tools (`get_trip_details`, `add_to_itinerary`) respect collection sharing — both owners and `shared_with` members can use them; `list_trips` remains owner-only.
- Do **not** attempt to fix known test/config issues during feature work.
- Commit and merge completed feature branches promptly once validation passes (avoid leaving finished work unmerged).