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

推荐订阅源

Google DeepMind News
Google DeepMind News
L
LangChain Blog
H
Help Net Security
博客园_首页
T
Tailwind CSS Blog
Microsoft Security Blog
Microsoft Security Blog
T
The Blog of Author Tim Ferriss
雷峰网
雷峰网
Recent Announcements
Recent Announcements
D
DataBreaches.Net
U
Unit 42
Vercel News
Vercel News
I
InfoQ
Martin Fowler
Martin Fowler
Microsoft Azure Blog
Microsoft Azure Blog
Apple Machine Learning Research
Apple Machine Learning Research
S
SegmentFault 最新的问题
Jina AI
Jina AI
博客园 - 叶小钗
博客园 - 【当耐特】
罗磊的独立博客
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
月光博客
月光博客
Last Week in AI
Last Week in AI

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(scripts): cap gh-read json bodies · openclaw/openclaw...
vincentkoc · 2026-05-30 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

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

66

parsePermissionKeys,

77

parseRepoArg,

88

readBoundedGitHubErrorText,

9+

readBoundedGitHubJson,

910

resolveGitHubFetchTimeoutMs,

1011

} from "../../scripts/gh-read.js";

1112

@@ -68,11 +69,7 @@ describe("gh-read helpers", () => {

6869

});

6970
7071

it("times out stalled GitHub API response body reads", async () => {

71-

const response = {

72-

ok: true,

73-

status: 200,

74-

json: () => new Promise(() => {}),

75-

} as Response;

72+

const response = new Response(new ReadableStream({}), { status: 200 });

7673

const request = githubJson("/app/installations", "token", undefined, {

7774

timeoutMs: 5,

7875

fetchImpl: (() => Promise.resolve(response)) as typeof fetch,

@@ -94,6 +91,53 @@ describe("gh-read helpers", () => {

9491

expect(text.length).toBeLessThan(4200);

9592

});

9693
94+

it("reads bounded GitHub API JSON responses", async () => {

95+

await expect(readBoundedGitHubJson(new Response('{"id":123}'), 1024)).resolves.toEqual({

96+

id: 123,

97+

});

98+

});

99+
100+

it("rejects oversized GitHub API JSON responses by content length", async () => {

101+

let canceled = false;

102+

const response = new Response(

103+

new ReadableStream({

104+

cancel() {

105+

canceled = true;

106+

},

107+

}),

108+

{

109+

headers: {

110+

"content-length": "1025",

111+

},

112+

},

113+

);

114+
115+

await expect(readBoundedGitHubJson(response, 1024)).rejects.toMatchObject({

116+

code: "ETOOBIG",

117+

message: "GitHub API response body exceeded 1024 bytes",

118+

});

119+

expect(canceled).toBe(true);

120+

});

121+
122+

it("rejects oversized streamed GitHub API JSON responses", async () => {

123+

const encoder = new TextEncoder();

124+

const response = new Response(

125+

new ReadableStream({

126+

start(controller) {

127+

controller.enqueue(encoder.encode('{"body":"'));

128+

controller.enqueue(encoder.encode("x".repeat(1024)));

129+

controller.enqueue(encoder.encode('"}'));

130+

controller.close();

131+

},

132+

}),

133+

);

134+
135+

await expect(readBoundedGitHubJson(response, 1024)).rejects.toMatchObject({

136+

code: "ETOOBIG",

137+

message: "GitHub API response body exceeded 1024 bytes",

138+

});

139+

});

140+
97141

it("rejects invalid GitHub API timeout values", () => {

98142

expect(resolveGitHubFetchTimeoutMs("1000")).toBe(1000);

99143

expect(() => resolveGitHubFetchTimeoutMs("1s")).toThrow(