fix(chat): clean up tool output and embedded UX

This commit is contained in:
2026-03-09 21:12:46 +00:00
parent bb54503235
commit d8c8ecf2bd
13 changed files with 588 additions and 198 deletions

View File

@@ -1,12 +1,12 @@
# Session Continuity
## Last Session (2026-03-09)
- Completed `chat-provider-fixes` change set with three workstreams:
- `chat-loop-hardening`: invalid required-arg tool calls now terminate cleanly, not replayed, assistant tool_call history trimmed consistently
- `default-ai-settings`: Settings page saves default provider/model via `UserAISettings`; DB defaults authoritative over localStorage; backend fallback uses saved defaults
- `suggestion-add-flow`: day suggestions use resolved provider/model (not hardcoded OpenAI); modal normalizes suggestion payloads for add-to-itinerary
- Completed `chat-provider-fixes` follow-up round with three additional workstreams:
- `chat-tool-grounding-and-confirmation`: trip context now injects collection UUID for `get_trip_details`/`add_to_itinerary`; system prompt confirms only before first add action; tool error wording aligned with short-circuit regex (`get_weather` gap resolved)
- `chat-tool-output-cleanup`: `role=tool` messages hidden from display; tool outputs render as concise summaries; persisted tool rows reconstructed into `tool_results` on reload
- `embedded-chat-ux-polish`: provider/model selectors in compact settings dropdown; sidebar closed by default in embedded mode; bounded height; visible streaming indicator
- All three workstreams passed reviewer + tester validation
- Documentation updated for all three workstreams
- Prior session completed `chat-loop-hardening`, `default-ai-settings`, `suggestion-add-flow` — all reviewed and tested
## Active Work
- `chat-provider-fixes` plan complete — all workstreams implemented, reviewed, tested, documented
@@ -16,6 +16,9 @@
## Known Follow-up Items (from tester findings)
- No automated test coverage for `UserAISettings` CRUD + precedence logic
- No automated test coverage for `send_message` streaming loop (tool error short-circuit, multi-tool partial success, `MAX_TOOL_ITERATIONS`)
- No automated test coverage for `DaySuggestionsView.post()`
- `get_weather` error `"dates must be a non-empty list"` does not trigger tool-error short-circuit (mitigated by `MAX_TOOL_ITERATIONS`)
- No automated test coverage for `DaySuggestionsView.post()`
- No Playwright e2e test for tool summary reconstruction on conversation reload
- LLM-generated name/location fields not truncated to `max_length=200` before `LocationSerializer` (low risk)
- `aria-label` values in `AITravelChat.svelte` sidebar toggle and settings button are hardcoded English (should use `$t()`)
- `<details>` settings dropdown in embedded chat does not auto-close on outside click
- `get_trip_details` excludes `shared_with` members from `filter(user=user)` — shared users get UUID context but tool returns DoesNotExist (pre-existing, low severity)