feat(m0): try the next model when tool calling still fails with the fix

User rule: if the tool-calling fix does not work, change the model. The
tools_fast / tools_recommended stages now measure the next, less
compressed model of the same family (fast: UD-Q6_K_XL then Q8_0;
recommended: IQ3_XXS then IQ3_S) when the default still gets a scored
case wrong, stop at the first one that passes every case, and record it
as tools_verdict.chosen. Candidates without enough free disk are skipped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
javis-bot
2026-11-10 15:09:58 +09:00
parent 903e0eb9de
commit 85a562c171
5 changed files with 118 additions and 12 deletions

View File

@@ -152,12 +152,17 @@ def run_case(c: ChatClient, system: str, planner, prompt: str, want: str | None,
return row
def test_tools_fixed(r: StageResult, c: ChatClient, tries: int = 3) -> None:
def tools_passed(summary: dict | None) -> bool:
"""Every scored case ended with the right tool call (by the model or the guard)."""
return bool(summary) and summary["total"] > 0 and summary["ok"] == summary["total"]
def test_tools_fixed(r: StageResult, c: ChatClient, tries: int = 3, key: str = "tools_fixed") -> dict | None:
say(" - 도구 호출 (수정 적용: 지시문 + 계획 + 건너뛴 도구 실행)")
src = jarvis_src()
if src is None:
r.error("tools_fixed", "jarvis_src 폴더가 없습니다")
return
r.error(key, "jarvis_src 폴더가 없습니다")
return None
sp, planner = load_jarvis(src, c)
names = [t["function"]["name"] for t in TOOLS]
system = f"{VOICE_SYSTEM}\n\n{sp.TOOL_HONESTY_RULES}\n\n{sp.tool_honesty_reminder(names)}"
@@ -177,6 +182,7 @@ def test_tools_fixed(r: StageResult, c: ChatClient, tries: int = 3) -> None:
"guard_ran": sum(1 for x in rows if x.get("guard_ran")),
"text_with_call": sum(1 for x in rows if x.get("text_with_call")),
"total": len(scored)}
r["tools_fixed"] = {"cases": rows, "summary": summary, "system": system}
r[key] = {"cases": rows, "summary": summary, "system": system}
say(f" 모델 스스로 {summary['model_ok']}/{summary['total']}, 계획 실행 포함 {summary['ok']}/{summary['total']}, "
f"도구 호출과 같이 쓴 답 {summary['text_with_call']}번")
return summary