Commit Graph

11 Commits

Author SHA1 Message Date
alex wiesner
c4d39f2812 changes 2026-03-13 20:15:22 +00:00
992ba401f9 fix(chat): prevent duplicate itinerary entries on repeat add_to_itinerary calls 2026-03-10 19:42:23 +00:00
635e0df0ab fix(chat): stop 429 retry spiral and add get_weather coord fallback
- search_places: detect HTTP 429 and mark retryable=False to stop the
  retry loop immediately instead of spiraling until MAX_ITERATIONS
- get_weather: extract collection coordinates (lat/lng from first
  location with coords) and retry when LLM omits required params;
  uses sync_to_async for the DB query in the async view
- AITravelChat: deduplicate context-only tools (get_trip_details,
  get_weather) in the render pipeline to prevent duplicate place cards
  from appearing when the retry loop causes multiple get_trip_details calls
- Tests: 5 new tests covering 429 non-retryable path and weather
  coord fallback; all 39 chat tests pass
2026-03-10 19:18:55 +00:00
89b42126ec fix(chat): fix location clarification loop and test isolation bugs
- Add _COMMAND_VERBS guard to _is_likely_location_reply() so messages
  starting with imperative verbs (find, search, show, get, ...) are not
  mistakenly treated as user location replies. This prevented 'Find
  good places' from being used as a retry location, which was causing
  the clarification path to never fire and the tool loop to exhaust
  MAX_ALL_FAILURE_ROUNDS instead.
- Extract city from comma-delimited fallback address strings when
  city/country FKs are absent, e.g. 'Little Turnstile 6, London'
  → 'London', so context-based location retry works for manually-
  entered itinerary stops without geocoded FK data.
- Add attempted_location_retry flag: if retry was attempted but all
  retry attempts failed, convert result to an execution failure rather
  than emitting a clarification prompt (user already provided context
  via their itinerary).
- Fix test assertion ordering in test_collection_context_retry_extracts_
  city_from_fallback_address: streaming_content must be consumed before
  checking mock call counts since StreamingHttpResponse is lazy.
2026-03-10 18:37:30 +00:00
dbabbdf9f0 fix(chat): stop retry spirals on tool failures 2026-03-10 18:05:34 +00:00
212ce33e36 fix(chat): normalize itinerary search locations 2026-03-10 17:29:37 +00:00
46d7704e4f fix(chat): use itinerary context for restaurant searches 2026-03-10 17:12:29 +00:00
a023a9548c fix(chat): retry search_places using user location reply 2026-03-10 16:48:39 +00:00
403f47b57c test(chat): use transaction case for async stream assertion 2026-03-10 16:34:56 +00:00
84384df236 fix(chat): clarify missing-location search requests 2026-03-10 16:26:02 +00:00
c918c9ce2f fix(chat): support shared trips and polish controls 2026-03-09 22:04:53 +00:00