feat(stove-api): expose estimate and operator controls
This commit is contained in:
+7
-1
@@ -27,9 +27,15 @@ def cleanup(*, now=None) -> dict:
|
||||
"UPDATE stove_api_requests SET status=? WHERE status=? AND ts<?",
|
||||
(stove_history.STATUS_NO_RESPONSE, stove_history.STATUS_OPENED,
|
||||
stove_history.iso(now - stove_history.STALE_OPEN_SEC))).rowcount
|
||||
with db._conn() as conn:
|
||||
settled = conn.execute(
|
||||
"UPDATE llm_usage SET input_tokens=0, cache_tokens=0, output_tokens=0, "
|
||||
"cost_basis='unknown' WHERE path='api:stove-estimate' AND cost_basis='pending' "
|
||||
"AND ts<?", (now - 600,)).rowcount
|
||||
freed = _free_old_bodies(stove_history.iso(now - stove_history.BODY_KEEP_SEC))
|
||||
total = _finish_caps()
|
||||
return {"closed_stale": closed, "deleted_bodies": freed, "history_bytes": total}
|
||||
return {"closed_stale": closed, "settled_ai": settled,
|
||||
"deleted_bodies": freed, "history_bytes": total}
|
||||
|
||||
|
||||
def _free_old_bodies(old: str) -> int:
|
||||
|
||||
Reference in New Issue
Block a user