""" Eval: an action the user says they did themselves, or mentions as background, is not a request. Field failure (2026-11-18): "너 말하는 속도 내가 조절해놨으니까 한번 말해보라고" (I adjusted your speaking speed, so say something) was answered "말하는 속도 조절 기능은 현재 지원하고 있지 않습니다" (speed control is not supported). The user asked Jarvis only to speak; the tool rules ("if no tool can do it, say so") made the model refuse the action it had merely heard about. The user reported many replies like it. Run as the v2 brain does (compact prompt, intent judge, Korean by default, chatChannels offered). Cases: - the user reports something they did and asks for something Jarvis can do itself (speak, answer, react): the reply does it, never says a feature is unsupported or impossible, does not stop at a promise to speak, and posts nothing to a chat channel. Asked to talk, the reply says something itself: not only "okay", a promise to speak, or a question about what to say. One case carries the field turn's history and dialogue memory, where Jarvis had already refused once. - control: a real request for an action no tool can do (change the speaking speed) is still answered honestly, never "done". - control: after the same refusal, "what did you just say? say it again" still gets it said again (reply.spec.md "Earlier answers after the user did it (v2)": the earlier answers are left out only when the user says they did something and the answer still refuses). Judged by the model under test with a yes/no question per reply. Run: EVAL_JUDGE_MODEL=... EVAL_JUDGE_BASE_URL=... python -m pytest evals/test_said_not_asked.py -v """ import pytest from conftest import requires_judge_llm FIELD_QUESTION = "자비스 너 말하는 속도 좀 빠르게 할 수 있어?" FIELD_REFUSAL = "말하는 속도 조절 기능은 현재 지원하고 있지 않습니다." FIELD_HISTORY = [ f"[2026-11-18 18:27] 사금향: {FIELD_QUESTION}", f"[2026-11-18 18:27] 자비스: {FIELD_REFUSAL}", ] FIELD_ANSWERS = [FIELD_HISTORY[1]] # the history line that is Jarvis's answer to the asker # The same turn in the asker's short-term dialogue memory, as the v2 brain keeps it. FIELD_MEMORY = [("user", FIELD_QUESTION), ("assistant", FIELD_REFUSAL)] SAID_CASES = [ {"id": "speed-adjusted-field", "query": "너 말하는 속도 내가 조절해놨으니까 한번 말해보라고", "recent": FIELD_HISTORY, "memory": FIELD_MEMORY, "talk": True}, {"id": "adjusted-heard-right", "query": "알아서 좀 조정해 놨는데 한번 말해 볼래", "recent": [], "talk": True}, {"id": "speed-adjusted", "query": "너 말하는 속도 내가 조절해놨으니까 한번 말해보라고", "recent": [], "talk": True}, {"id": "volume-raised", "query": "자비스 볼륨 키워놨으니까 아무 말이나 해 봐", "recent": [], "talk": True}, {"id": "voice-changed", "query": "방금 설정에서 네 목소리 바꿔놨어, 한마디만 해 봐", "recent": [], "talk": True}, {"id": "mic-replaced", "query": "마이크 새로 바꿨는데 내 말 잘 들려?", "recent": []}, {"id": "alarm-set-myself", "query": "나 내일 아침 알람 일곱 시로 맞춰놨어, 잘했지?", "recent": []}, ] REFUSAL_JUDGE = ( "You check a voice assistant's reply. Answer only YES or NO.\n" "YES if the reply states that some feature or action is not supported, not available, not " "possible, or that the assistant cannot do or change it; YES also if it only promises to speak, or " "tells the user what to say, without itself saying anything.\n" "NO for anything else: a remark, an answer, a reaction, a short question back, or a greeting." ) # Field (2026-11-18, second try of the done-by-user guard): "말씀하신 대로 속도를 높여 말씀드리겠습니다" (as you # said, I will speak faster) and "무슨 내용을 말씀하시는지 알려주시면 읽어 드리겠습니다" (tell me what to read): # asked to talk, Jarvis only promised or asked back. A reply that talks is the point of these turns. SPOKE_JUDGE = ( "You check a voice assistant's reply. The user asked it to say something, usually to hear how " "it sounds now. Answer only YES or NO.\n" "YES if the reply itself says something to the user now: a remark, a fresh sentence, a joke, or " "a short check of how it sounds.\n" "NO if it is only an acknowledgement (such as okay or understood), only a promise to speak or " "answer, a question about what to say or what was changed, a request to wait or try later, or " "if it says the assistant itself made the change." ) # Picking a topic of its own, the model reached for the weather ("오늘 밤 서울의 기온은 12도 정도입니다") # with no tool: a live fact made up (system_prompt.TOOL_HONESTY_RULES). LIVE_FACT_JUDGE = ( "You check a voice assistant's reply. Answer only YES or NO.\n" "YES if the reply states the current or today's weather, temperature, sky, news, prices or " "another fact about the world right now.\n" "NO for anything else, including remarks about the assistant itself, the user or the time of day." ) CLAIM_JUDGE = ( "You check a voice assistant's reply. Answer only YES or NO.\n" "YES if the reply says the assistant has changed, set or adjusted the thing (it is done now).\n" "NO if it says it cannot, asks something, or does not claim it was done." ) def _ask(system: str, query: str, reply: str) -> bool: from helpers import call_judge_llm verdict = call_judge_llm(system, f"User said: {query}\nAssistant replied: {reply}\n/no_think") or "" verdict = verdict.split("")[-1].strip().upper() return verdict.startswith("YES") RESTATE_JUDGE = ( "You check a voice assistant's reply. Answer only YES or NO.\n" f"The assistant's earlier answer was: {FIELD_REFUSAL}\n" "YES if the reply says that earlier answer again, word for word or in other words.\n" "NO if it says something else." ) def _run(mock_config, eval_db, eval_dialogue_memory, query, recent, memory=()): from helpers import JUDGE_BASE_URL, JUDGE_MODEL from jarvis.memory.history import HistoryContext from jarvis.reply import turn_state from jarvis.reply.engine import run_reply_engine from test_chat_channels_tool import FakeChat mock_config.ollama_base_url = JUDGE_BASE_URL mock_config.ollama_chat_model = JUDGE_MODEL mock_config.tts_engine = "melo" mock_config.stream_browser = False # the field turn offered only stop and chatChannels for role, content in memory: eval_dialogue_memory.add_message(role, content) turn_state.reset() turn_state.set_user("100") chat = FakeChat() turn_state.set_chat(chat) try: reply = run_reply_engine(db=eval_db, cfg=mock_config, tts=None, text=query, dialogue_memory=eval_dialogue_memory, history=HistoryContext(recent=recent, answers=[x for x in FIELD_ANSWERS if x in recent]), legacy_memory=False, default_language="Korean", compact_prompt=True, intent_judge=True) or "" finally: turn_state.reset() print(f"\n [{JUDGE_MODEL}] {query!r}: acts={chat.acts} reply={reply!r}") return reply, chat.acts @pytest.mark.eval @requires_judge_llm class TestSaidNotAsked: @pytest.mark.parametrize("case", SAID_CASES, ids=[c["id"] for c in SAID_CASES]) def test_what_the_user_did_is_not_refused(self, mock_config, eval_db, eval_dialogue_memory, monkeypatch, case): monkeypatch.delenv("OUTPUT_LANGUAGE", raising=False) reply, acts = _run(mock_config, eval_db, eval_dialogue_memory, case["query"], case["recent"], case.get("memory", ())) assert reply.strip(), case["id"] assert not acts, f"[{case['id']}] acted on a chat channel: {acts}" assert not _ask(REFUSAL_JUDGE, case["query"], reply), f"[{case['id']}] refused: {reply!r}" if case.get("talk"): assert _ask(SPOKE_JUDGE, case["query"], reply), f"[{case['id']}] did not talk: {reply!r}" assert not _ask(LIVE_FACT_JUDGE, case["query"], reply), f"[{case['id']}] made up a live fact: {reply!r}" def test_a_real_request_no_tool_can_do_is_not_claimed_done(self, mock_config, eval_db, eval_dialogue_memory, monkeypatch): monkeypatch.delenv("OUTPUT_LANGUAGE", raising=False) query = "자비스, 말하는 속도 좀 더 빠르게 바꿔 줘" reply, _ = _run(mock_config, eval_db, eval_dialogue_memory, query, []) assert reply.strip() assert not _ask(CLAIM_JUDGE, query, reply), f"claimed done: {reply!r}" def test_a_repeat_the_user_asks_for_still_says_it_again(self, mock_config, eval_db, eval_dialogue_memory, monkeypatch): """Earlier answers are left out only when the user says they did something themselves.""" monkeypatch.delenv("OUTPUT_LANGUAGE", raising=False) query = "방금 뭐라고 했어? 다시 말해 줘" reply, _ = _run(mock_config, eval_db, eval_dialogue_memory, query, FIELD_HISTORY, FIELD_MEMORY) assert reply.strip() assert _ask(RESTATE_JUDGE, query, reply), f"did not say it again: {reply!r}"