feat(voice_worker): a short voice prompt and one judgement before each v2 answer

- compact_prompt: the v2 persona in a tenth of v1's words, answers as short as
  possible, the full tool guidance only on turns with a data tool. A greeting's
  reply prompt went from about 4,500 to 1,400 tokens on Strata.
- intent_judge: the tool router judges whether the turn needs tools; the
  planner runs only when it does. prepare_intent runs the pick ahead on a
  partial transcript (worker message prepare), and the reply reuses it.
- Without stream_browser the screen-share tools are not offered.
- The time context carries the 12-hour form (10:37 was read as pm).
- A <tool_call> block written as the reply is parsed as a call, not spoken.

Evals (Qwen3.6 on Strata, EVAL_COMPACT_PROMPT=1 EVAL_INTENT_JUDGE=1):
221 passed, 4 failed (known failures); new evals/test_voice_reply_length.py
(v2 answers 234 chars against v1's 416) and test_reply_language_default.py.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
javis-bot
2026-11-12 12:25:15 +09:00
parent 7623d6d002
commit 46e4e75d05
13 changed files with 721 additions and 44 deletions

View File

@@ -39,6 +39,30 @@ from helpers import MockConfig, JUDGE_MODEL, is_judge_llm_available
# Shared Markers
# =============================================================================
# The v2 brain's reply options, to compare them with v1's on the same cases:
# EVAL_COMPACT_PROMPT=1 runs every eval with run_reply_engine(compact_prompt=True),
# EVAL_INTENT_JUDGE=1 with intent_judge=True (both together are the v2 brain's setup).
@pytest.fixture(autouse=True)
def _v2_reply_options(monkeypatch):
on = lambda name: os.environ.get(name, "").strip() in ("1", "true", "yes")
options = {k: True for k, env in (("compact_prompt", "EVAL_COMPACT_PROMPT"),
("intent_judge", "EVAL_INTENT_JUDGE")) if on(env)}
if not options:
return
import functools
import jarvis.reply.engine as engine
original = engine.run_reply_engine
@functools.wraps(original)
def v2(*args, **kwargs):
for k, v in options.items():
kwargs.setdefault(k, v)
return original(*args, **kwargs)
monkeypatch.setattr(engine, "run_reply_engine", v2)
_JUDGE_LLM_AVAILABLE = is_judge_llm_available()
requires_judge_llm = pytest.mark.skipif(
not _JUDGE_LLM_AVAILABLE,