fix(insta-lab): 선별 zero-pref 크래시 가드 + judge max_tokens 상향 + 404 테스트

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-11 02:31:18 +09:00
parent 7d1857c8a4
commit 83398c8413
4 changed files with 16 additions and 1 deletions

View File

@@ -55,6 +55,8 @@ def score_candidates(
w = weights or DEFAULT_WEIGHTS
now = _parse_iso(now_iso) if now_iso else datetime.now(timezone.utc)
max_w = max(prefs.values()) if prefs else 1.0
if max_w <= 0:
max_w = 1.0
out: List[Dict[str, Any]] = []
for c in candidates:
cat = c.get("category", "")

View File

@@ -43,7 +43,7 @@ def judge_candidates(candidates: List[Dict[str, Any]]) -> Dict[int, float]:
try:
client = Anthropic(api_key=ANTHROPIC_API_KEY)
resp = client.messages.create(
model=ANTHROPIC_MODEL_HAIKU, max_tokens=512,
model=ANTHROPIC_MODEL_HAIKU, max_tokens=1024,
messages=[{"role": "user", "content": PROMPT.format(items=items)}],
)
return parse_judge_response(resp.content[0].text)