fix(conversation): topic chips after warmup + English chip copy

- Buffer topic_suggestions until chat UI attaches (uiOwner + callback); replay on attach
- build_topic_chips respects user language for label/text; router passes user_language

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Kevin
2026-05-12 11:10:21 +08:00
parent 7e64fc3faf
commit d155e45a44
5 changed files with 101 additions and 16 deletions

View File

@@ -286,3 +286,13 @@ def test_plan_follow_when_no_empty_slots():
)
assert p.mode == "follow_user_only"
assert p.low_information_reply is True
def test_build_topic_chips_english_uses_slot_name_map_en():
from app.agents.chat.prompts_conversation import build_topic_chips
chips = build_topic_chips("childhood", ["place"], max_chips=2, language="en")
assert len(chips) >= 1
place_chip = next(c for c in chips if c["id"] == "place")
assert place_chip["label"] == "where you grew up"
assert place_chip["text"].startswith("I'd like to talk about")