feat(judge): watch the judge providers' plan usage; switch to the fallback before the wall
deploy / test (push) Successful in 5m35s
deploy / build (push) Successful in 6m0s

GLM's weekly window ran out while the judge had spent ~0.1% of it: other
consumers of the shared key starve the judge, and ClawMates learned only from
failed phases. A poller now reads z.ai's quota API and Kimi's usages API every
10 minutes, warns once per window per reset at 80%, and the evaluator skips a
judge whose plan is at 95% in any window for the (equally independent)
fallback — only on a real reading, never on a missing one. GET
/api/judge/quota shows the readings.

Parsers pinned to the shapes both APIs returned on 2026-09-23.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
Omar Sobh
2026-09-23 07:55:10 -05:00
co-authored by Claude Opus 5.5
parent dd335ccfe6
commit 318a6791b9
5 changed files with 335 additions and 1 deletions
+2
View File
@@ -12,6 +12,7 @@ pub mod corpus;
mod error;
pub mod evaluator;
pub mod evaluator_tools;
pub mod judge_quota;
mod extract;
pub mod fleet;
pub mod fleet_herdr;
@@ -190,6 +191,7 @@ pub fn router(state: AppState) -> Router {
.route("/api/nodes", get(routes::nodes::list))
.route("/api/fleet/capacity", get(routes::nodes::capacity))
.route("/api/fleet/backends", get(routes::nodes::backends))
.route("/api/judge/quota", get(routes::nodes::judge_quota))
.route("/api/nodes/pair", post(routes::nodes::pair))
.route("/api/nodes/live", get(routes::nodes::live))
.route("/api/nodes/agent", get(routes::nodes::agent_ws))