fix(agents): align OpenRouter model scan body cap · openclaw/openclaw@ad3b2f4
vincentkoc
·
2026-06-23
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -147,7 +147,7 @@ describe("scanOpenRouterModels", () => {
|
147 | 147 | // cancelled the upstream body once the byte cap was crossed. |
148 | 148 | expect(cancel).toHaveBeenCalledOnce(); |
149 | 149 | expect(pullCount).toBeGreaterThan(0); |
150 | | -expect(pullCount).toBeLessThan(4 * 1024 * 1024); // nowhere near draining forever |
| 150 | +expect(pullCount).toBeLessThan(16 * 1024 * 1024); // nowhere near draining forever |
151 | 151 | }); |
152 | 152 | |
153 | 153 | it("rejects a malformed catalog success body", async () => { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -29,8 +29,9 @@ const DEFAULT_CONCURRENCY = 3;
|
29 | 29 | // The OpenRouter /models catalog is a provider-controlled, runtime-fetched body |
30 | 30 | // (already >100 KB and growing). Read it under a byte cap before JSON.parse so a |
31 | 31 | // faulty or hostile provider cannot stream an unbounded document and exhaust |
32 | | -// process memory. 4 MiB matches the cap used for the same endpoint elsewhere. |
33 | | -const OPENROUTER_MODELS_BODY_MAX_BYTES = 4 * 1024 * 1024; |
| 32 | +// process memory. Keep this aligned with the runtime capability cache for the |
| 33 | +// same endpoint so scan and runtime discovery fail at the same boundary. |
| 34 | +const OPENROUTER_MODELS_BODY_MAX_BYTES = 16 * 1024 * 1024; |
34 | 35 | |
35 | 36 | const BASE_IMAGE_PNG = |
36 | 37 | "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+X3mIAAAAASUVORK5CYII="; |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。