fix(reply): stop models answering past an available tool

M0 on Strata caught both v2 models skipping a tool they had been given:
the recommended model made up "24 degrees, sunny" instead of calling the
weather tool, and the fast model said "timer set" without calling the
timer tool (3 of 3 each). qwen2.5:7b does the same through the engine.

- Prompt: TOOL_HONESTY_RULES in the persona (live facts only from a tool
  result this turn, actions only claimed after a tool reports success, no
  answer text next to a tool call), restated at the end of the system
  message by tool_honesty_reminder() with the turn's real tool names.
- Engine: skipped-tool guard. When a native-tool model answers before any
  tool has run and the plan names a callable tool as a concrete call, the
  answer is dropped and the plan steps are direct-executed, then the model
  answers from the results. Only literal, schema-valid steps run (regex
  fast path, no LLM repair); otherwise the held-back answer is delivered.
- Planner: the AVAILABLE TOOLS lines now carry argument names
  (planner_tool_catalog), so concrete steps use the tool's real keys.
- Eval evals/test_tool_skip_confabulation.py; on qwen2.5:7b, 3 runs each,
  available-tool cases went from 0/12 to 9/12 calling the tool.
- M0 kit: tools_fast / tools_recommended stages (run_m0_tools.bat) rerun
  tool calling before and after the fix on the real models, loading the
  production system_prompt.py and planner.py.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
javis-bot
2026-11-10 15:05:40 +09:00
parent 73fa93f346
commit 903e0eb9de
18 changed files with 916 additions and 44 deletions

View File

@@ -36,6 +36,10 @@ STAGES = [
("llm_fast", "LLM 빠름 모델 (Qwen3.6-35B-A3B, 약 23GB 받기)", "base", "llm.py", ["model=fast"], 35),
("llm_recommended", "LLM 권장 모델 (Qwen3.8-Flash-Next Q2_0, 약 66GB 받기)", "base", "llm.py",
["model=recommended"], 80),
# Tool calling again with Jarvis's fix (prompt rules + planner + skipped-tool guard).
# Reuses the models the two stages above downloaded.
("tools_fast", "도구 호출 다시 재기: 빠름 모델", "base", "llm.py", ["model=fast", "only=tools"], 0),
("tools_recommended", "도구 호출 다시 재기: 권장 모델", "base", "llm.py", ["model=recommended", "only=tools"], 0),
]
@@ -135,7 +139,7 @@ def main() -> int:
"errors": [{"where": "disk", "error": f"free {free_gb(work):.0f} GB < {need_gb} GB"}]})
continue
stage_opts = list(opts)
if key.startswith("llm_") and a.llm_url:
if key.startswith(("llm_", "tools_")) and a.llm_url:
stage_opts.append(f"url={a.llm_url}")
try:
run_stage(key, venv, script, stage_opts, work, env)