fix(debrief): raise public coaching budget 1200→6000 so loss coaching stops failing closed

This commit is contained in:
Macky
2026-10-03 11:58:31 +07:00
parent 9df2938557
commit d18fbfa608
2 changed files with 22 additions and 1 deletions

View File

@@ -412,7 +412,12 @@ class Simulator:
system,
user_prompt,
temperature=0.2,
max_tokens=1200,
# 6000 (was 1200): same hidden-reasoning truncation class as the final
# judge (500 #4). At 1200 the Qwen GGUF's internal chain consumed the
# shared cap on a full seller transcript, truncated the JSON, and the
# coaching silently failed closed to {} — the loss debrief then showed
# only the outcome banner + persona, with no "why" and no coaching.
max_tokens=6000,
)
return result if isinstance(result, dict) else {}

View File

@@ -59,6 +59,22 @@ def test_judge_budget_covers_hidden_reasoning():
assert stub.json_kwargs[0]["max_tokens"] >= 1600
def test_public_debrief_budget_covers_hidden_reasoning():
# The public coaching pass (why / failurePoints / coaching) analyzes the full
# seller transcript. Same hidden-reasoning truncation class as the final judge
# (500 #4): at 1200 the internal chain ate the budget, the JSON got truncated,
# complete_json threw LLMError, and _public_debrief failed closed to {} — so the
# loss debrief showed only the outcome banner + persona, no "why" and no coaching.
# 6000 matches the final judge.
stub = _CapturingLLM("")
Simulator(stub).public_debrief(
messages=[{"role": "seller", "text": "สวัสดี"}],
outcome="lost",
score=30,
)
assert stub.json_kwargs[0]["max_tokens"] >= 6000
def test_final_judge_budget_covers_hidden_reasoning():
# The FINAL judge (end-of-session verdict) is the fatal path — a truncation
# there 500s the whole chat send (the 2026-10-02 live incident: JSON cut off