惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

U
Unit 42
Blog — PlanetScale
Blog — PlanetScale
H
Help Net Security
The GitHub Blog
The GitHub Blog
博客园 - Franky
酷 壳 – CoolShell
酷 壳 – CoolShell
Recent Announcements
Recent Announcements
量子位
aimingoo的专栏
aimingoo的专栏
大猫的无限游戏
大猫的无限游戏
博客园 - 叶小钗
Microsoft Azure Blog
Microsoft Azure Blog
Martin Fowler
Martin Fowler
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
A
About on SuperTechFans
T
Tailwind CSS Blog
V
V2EX
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
B
Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
S
SegmentFault 最新的问题
G
Google Developers Blog
M
MIT News - Artificial intelligence

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix(openrouter): bound video response reads · openclaw/op...
Alix-007 · 2026-06-29 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -546,6 +546,7 @@ describe("openrouter video generation provider", () => {

546546

provider: "openrouter",

547547

capability: "video",

548548

baseUrl: "https://custom.openrouter.test/api/v1",

549+

allowPrivateNetwork: false,

549550

request: requestOverrides,

550551

},

551552

);

@@ -672,11 +673,10 @@ describe("openrouter video generation provider", () => {

672673
673674

it("wraps non-JSON successful OpenRouter submit responses", async () => {

674675

postJsonRequestMock.mockResolvedValue({

675-

response: {

676-

json: async () => {

677-

throw new SyntaxError("Unexpected token < in JSON");

678-

},

679-

},

676+

response: new Response("<html></html>", {

677+

status: 200,

678+

headers: { "content-type": "text/html" },

679+

}),

680680

release: vi.fn(async () => {}),

681681

});

682682

@@ -691,6 +691,22 @@ describe("openrouter video generation provider", () => {

691691

).rejects.toThrow("OpenRouter video generation response malformed");

692692

});

693693
694+

it("bounds oversized successful OpenRouter submit responses", async () => {

695+

const oversized = releasedOversizedJsonStream();

696+

postJsonRequestMock.mockResolvedValue(oversized);

697+
698+

const provider = buildOpenRouterVideoGenerationProvider();

699+

await expect(

700+

provider.generateVideo({

701+

provider: "openrouter",

702+

model: "google/veo-3.1",

703+

prompt: "oversized body",

704+

cfg: {} as never,

705+

}),

706+

).rejects.toThrow("OpenRouter video generation: JSON response exceeds 16777216 bytes");

707+

expect(oversized.wasCanceled()).toBe(true);

708+

});

709+
694710

it("rejects unknown OpenRouter poll statuses without waiting for timeout", async () => {

695711

postJsonRequestMock.mockResolvedValue(

696712

releasedJson({

Original file line numberDiff line numberDiff line change

@@ -6,6 +6,7 @@ import {

66

assertOkOrThrowHttpError,

77

createProviderOperationDeadline,

88

postJsonRequest,

9+

readProviderJsonResponse,

910

resolveProviderHttpRequestConfig,

1011

resolveProviderOperationTimeoutMs,

1112

sanitizeConfiguredModelProviderRequest,

@@ -68,9 +69,12 @@ type OpenRouterFrameImagePart = OpenRouterImagePart & {

6869

async function readOpenRouterVideoJson(response: Response): Promise<Record<string, unknown>> {

6970

let payload: unknown;

7071

try {

71-

payload = await response.json();

72-

} catch {

73-

throw new Error(OPENROUTER_VIDEO_MALFORMED_RESPONSE);

72+

payload = await readProviderJsonResponse<unknown>(response, "OpenRouter video generation");

73+

} catch (error) {

74+

if (error instanceof Error && error.message.endsWith(": malformed JSON response")) {

75+

throw new Error(OPENROUTER_VIDEO_MALFORMED_RESPONSE, { cause: error });

76+

}

77+

throw error;

7478

}

7579

if (!isRecord(payload)) {

7680

throw new Error(OPENROUTER_VIDEO_MALFORMED_RESPONSE);