Compare commits
No commits in common. "584aa46f6f1c8ae94a6973612df076d297d532c0" and "6bf10421719f11be6fec74532f83d164ebca5ba2" have entirely different histories.
584aa46f6f
...
6bf1042171
2 changed files with 4 additions and 14 deletions
|
|
@ -268,7 +268,7 @@ def revoke_task(
|
||||||
def list_failures(
|
def list_failures(
|
||||||
db: Annotated[Session, Depends(get_db)],
|
db: Annotated[Session, Depends(get_db)],
|
||||||
run_id: int | None = None,
|
run_id: int | None = None,
|
||||||
limit: int = Query(default=50, ge=1),
|
limit: int = Query(default=50, ge=0),
|
||||||
) -> list[dict[str, Any]]:
|
) -> list[dict[str, Any]]:
|
||||||
"""Per-request failure log for manual browser verification."""
|
"""Per-request failure log for manual browser verification."""
|
||||||
where = ""
|
where = ""
|
||||||
|
|
@ -1284,7 +1284,9 @@ _FRESHNESS_SOURCES: list[FreshnessSource] = [
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
def _classify_freshness(age_days: float | None, fresh_days: float, stale_days: float) -> str:
|
def _classify_freshness(
|
||||||
|
age_days: float | None, fresh_days: float, stale_days: float
|
||||||
|
) -> str:
|
||||||
"""fresh / stale / critical / unknown по возрасту последнего успешного прогона."""
|
"""fresh / stale / critical / unknown по возрасту последнего успешного прогона."""
|
||||||
if age_days is None:
|
if age_days is None:
|
||||||
return "unknown"
|
return "unknown"
|
||||||
|
|
|
||||||
|
|
@ -165,18 +165,6 @@ def orchestrate_chat(
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# Нет tool_calls → финальная проза.
|
# Нет tool_calls → финальная проза.
|
||||||
# Проверяем finish_reason: 'length' / 'content_filter' означают обрезанный
|
|
||||||
# или отфильтрованный ответ — неполная проза клиенту не отдаётся (LLMResult
|
|
||||||
# docstring §64: «консьюмер ОБЯЗАН проверять даже при ok=True»).
|
|
||||||
if result.finish_reason not in (None, "stop", "end_turn", "tool_calls"):
|
|
||||||
logger.warning(
|
|
||||||
"chat: non-stop finish_reason=%r for cad=%s run=%s → deterministic fallback",
|
|
||||||
result.finish_reason,
|
|
||||||
cad_num,
|
|
||||||
run_id,
|
|
||||||
)
|
|
||||||
return _deterministic(report_dict, message, f"finish_reason:{result.finish_reason}")
|
|
||||||
|
|
||||||
answer = (result.content or "").strip()
|
answer = (result.content or "").strip()
|
||||||
if not answer:
|
if not answer:
|
||||||
# Модель вернула пустоту — пустой ответ клиенту не отдаём, деградируем.
|
# Модель вернула пустоту — пустой ответ клиенту не отдаём, деградируем.
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue