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:
@@ -204,6 +204,30 @@ The engine consumes the plan in two phases.
|
||||
the synthetic assistant `tool_calls` message, and no progress nudge is
|
||||
appended.
|
||||
|
||||
### Intent judge (v2)
|
||||
|
||||
The v2 brain (`src/voice_worker/voice_worker.spec.md`, "History and brain") judges each turn once
|
||||
before the answer: `run_reply_engine(intent_judge=True)` runs the tool router as usual (the harness's
|
||||
judgement of whether the turn needs a tool and which ones) and runs the planner **only when the
|
||||
router picked a tool** other than the sentinels (`stop`, `toolSearchTool`) and the always-offered
|
||||
`chatChannels`. A turn without a tool (greetings, small talk, facts the model knows) goes straight
|
||||
to its answer with one LLM call before it; a tool turn keeps the planner's ordered steps, which
|
||||
multi-step asks need ("who directed Possessor, and what else did they make").
|
||||
|
||||
Measured on Strata (Qwen3.6, 2026-11-12): the router took 0.42 s and the planner 0.49-0.94 s, one
|
||||
after the other, before every answer; each call costs at least one full prompt read. Tried first
|
||||
and dropped: the planner alone over the whole catalogue (one call) planned "reply with the
|
||||
weather" without a tool step and lost the weather tool (20 eval failures against 4), and the router
|
||||
alone without a planner failed the chained Possessor research 3 of 3 times. With this rule the
|
||||
whole eval suite passes as with v1's flow (`EVAL_COMPACT_PROMPT=1 EVAL_INTENT_JUDGE=1`).
|
||||
|
||||
`prepare_intent(cfg, text, dialogue_memory, chat_available)` runs the same router pick ahead of
|
||||
time, with the inputs the reply would give it (the catalogue with `chatChannels` when a chat backend
|
||||
will be there, the context hint from the asker's dialogue memory); None when the router gave up (its
|
||||
fall-open to the whole catalogue is not a pick). The pick is passed back as
|
||||
`run_reply_engine(prepared_tools=...)` and the router is not run again. The brain calls it on a
|
||||
partial transcript while the user is still talking.
|
||||
|
||||
### resolve_next_tool_call
|
||||
|
||||
- **Fast path**: if the step text is fully concrete (tool name in the
|
||||
|
||||
Reference in New Issue
Block a user