Skip to content

Commit 0ce10d7

Browse files
authored
fix(agents): bound WHAM usage probe JSON response reads
1 parent ac5af25 commit 0ce10d7

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/agents/auth-profiles/usage.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {
1414
import type { OpenClawConfig } from "../../config/types.openclaw.js";
1515
import { createSubsystemLogger } from "../../logging/subsystem.js";
1616
import { resolveProviderRequestHeaders } from "../provider-request-config.js";
17+
import { readProviderJsonResponse } from "../provider-http-errors.js";
1718
import { notifyAuthProfileFailureHook, setAuthProfileFailureHook } from "./failure-hook.js";
1819
import { logAuthProfileFailureStateChange } from "./state-observation.js";
1920

@@ -265,7 +266,7 @@ async function probeWhamForCooldown(
265266
return { cooldownMs: WHAM_HTTP_ERROR_COOLDOWN_MS, reason: "wham_http_error" };
266267
}
267268

268-
const data = (await res.json()) as WhamUsageResponse;
269+
const data = await readProviderJsonResponse<WhamUsageResponse>(res, "WHAM usage probe");
269270
if (!data.rate_limit) {
270271
return { cooldownMs: WHAM_PROBE_FAILURE_COOLDOWN_MS, reason: "wham_probe_failed" };
271272
}

0 commit comments

Comments
 (0)