Claude Claude Opus 5.5 commited on
Commit
555a518
·
unverified ·
1 Parent(s): f26d8e1

eval: บันทึกฐาน Modutech ที่ agent ใช้จริงในผลเทสรูปและผู้ใช้จำลอง (บันทึกอย่างเดียว ไม่แตะ agent)

Browse files

- simulate_customers.py: system_info.modutech_json (agent เท่านั้น · bot/golden ไม่เปลี่ยน)
- run_image_surface_eval_agent.py: env.AGENT_MODUTECH_JSON + env.modutech_json_used
- ที่มา: สองสคริปต์นี้ไม่ได้ตั้ง r4/v31 ให้เอง ถ้าลืมตั้ง AGENT_MODUTECH_JSON จะตรวจย้อนหลังไม่ได้
- test_simulate_customers 43/43

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GwsdogGsnbFRJYfG8rdbzK

eval/run_image_surface_eval_agent.py CHANGED
@@ -293,7 +293,9 @@ def main() -> int:
293
 
294
  commit = os.popen(f'git -C "{ROOT}" rev-parse --short HEAD').read().strip()
295
  env = {k: os.environ.get(k) for k in ("AGENT_PROMPT", "AGENT_REPLY_GUARD", "AGENT_RESOLVE_TAB", "AGENT_DATASHEET_FILES",
296
- "AGENT_IMAGE_SURFACE", "GEMINI_MODEL", "GEMINI_THINKING")}
 
 
297
  json.dump({"labels": a.labels or a.from_rows, "brands": a.brands if a.from_rows else "modutech", "texts": texts, "runs": a.runs, "commit": commit, "env": env,
298
  "llm": A.engine.llm.describe(), "prompt": prompt_version(), "results": results},
299
  open(a.out, "w", encoding="utf-8"), ensure_ascii=False, indent=1)
 
293
 
294
  commit = os.popen(f'git -C "{ROOT}" rev-parse --short HEAD').read().strip()
295
  env = {k: os.environ.get(k) for k in ("AGENT_PROMPT", "AGENT_REPLY_GUARD", "AGENT_RESOLVE_TAB", "AGENT_DATASHEET_FILES",
296
+ "AGENT_IMAGE_SURFACE", "AGENT_MODUTECH_JSON", "GEMINI_MODEL", "GEMINI_THINKING")}
297
+ from agent.tools_impl import CATALOGUE_PATH # 10 พ.ย.: ฐาน Modutech ที่ใช้จริง (บันทึกอย่างเดียว)
298
+ env["modutech_json_used"] = CATALOGUE_PATH
299
  json.dump({"labels": a.labels or a.from_rows, "brands": a.brands if a.from_rows else "modutech", "texts": texts, "runs": a.runs, "commit": commit, "env": env,
300
  "llm": A.engine.llm.describe(), "prompt": prompt_version(), "results": results},
301
  open(a.out, "w", encoding="utf-8"), ensure_ascii=False, indent=1)
eval/simulate_customers.py CHANGED
@@ -138,6 +138,13 @@ def system_info_of(bot, module: str, meter) -> dict:
138
  "gemini_model": getattr(meter, "model_name", "") or os.getenv("GEMINI_MODEL", ""),
139
  "gemini_thinking": os.getenv("GEMINI_THINKING", ""),
140
  "token_scope": getattr(meter, "usage_scope", "")}
 
 
 
 
 
 
 
141
  if info["system"] == "bot":
142
  info["front_interpreter"] = (os.getenv("FRONT_INTERPRETER") or "rules").strip().lower()
143
  try:
 
138
  "gemini_model": getattr(meter, "model_name", "") or os.getenv("GEMINI_MODEL", ""),
139
  "gemini_thinking": os.getenv("GEMINI_THINKING", ""),
140
  "token_scope": getattr(meter, "usage_scope", "")}
141
+ if info["system"] == "agent":
142
+ # 10 พ.ย.: บันทึกฐาน Modutech ที่ agent ใช้จริง (r4 ต้องคู่กับ v31) · บันทึกอย่างเดียว ไม่เปลี่ยนพฤติกรรม
143
+ try:
144
+ from agent.tools_impl import CATALOGUE_PATH
145
+ info["modutech_json"] = os.path.relpath(CATALOGUE_PATH, ROOT).replace("\\", "/")
146
+ except Exception as e: # noqa: BLE001 — คนละไดรฟ์บน Windows ฯลฯ
147
+ info["modutech_json"] = os.getenv("AGENT_MODUTECH_JSON") or f"? ({type(e).__name__})"
148
  if info["system"] == "bot":
149
  info["front_interpreter"] = (os.getenv("FRONT_INTERPRETER") or "rules").strip().lower()
150
  try: