From 59c3f33c2c83c4d642cd72b306d25e7a54d0116e Mon Sep 17 00:00:00 2001 From: javis-bot Date: Wed, 18 Nov 2026 02:30:49 +0900 Subject: [PATCH] test(notes): prepare the pick with the app's offer and require it to be reused The partial-transcript eval now offers chat, schedule, notes and screen as voice_worker/brain.py does, sets those backends for the reply, and fails when the intent judge made no pick or the pick lacks personalNotes, so it cannot pass by re-routing the final text. Co-Authored-By: Claude Opus 5.5 --- evals/test_personal_notes.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/evals/test_personal_notes.py b/evals/test_personal_notes.py index cd89de2..02891e3 100644 --- a/evals/test_personal_notes.py +++ b/evals/test_personal_notes.py @@ -47,11 +47,23 @@ def _run(mock_config, eval_db, eval_dialogue_memory, query, notes=None, partial= from jarvis.reply.engine import prepare_intent from voice_worker.brain import similar assert similar(partial, query) - kw = {"intent_judge": True, "prepared_tools": prepare_intent( - mock_config, partial, eval_dialogue_memory, False, notes_available=True)} + # The same offer as the app (voice_worker/brain.py): chat, schedule, notes and screen. + prepared = prepare_intent(mock_config, partial, eval_dialogue_memory, True, + schedule_available=True, notes_available=True, screen_available=True) + print(f"\n notes [{JUDGE_MODEL}] prepared on {partial!r}: {prepared}") + assert prepared is not None, "the intent judge made no pick, so nothing would be reused" + assert "personalNotes" in prepared, prepared + kw = {"intent_judge": True, "prepared_tools": prepared} turn_state.reset() turn_state.set_user("100") turn_state.set_notes(backend) + if partial is not None: + from test_chat_channels_tool import FakeChat + from test_schedule_tool import FakeSchedules + from test_screen_view_tool import FakeScreen + turn_state.set_chat(FakeChat()) + turn_state.set_schedule(FakeSchedules()) + turn_state.set_screen(FakeScreen()) try: reply = run_reply_engine(db=eval_db, cfg=mock_config, tts=None, text=query, dialogue_memory=eval_dialogue_memory, history=HistoryContext(),