





















@@ -20,6 +20,7 @@ import {
2020agentOutputHasExpectedOkMarker,
2121agentTurnUsedEmbeddedFallback,
2222buildCrossOsReleaseSmokePluginAllowlist,
23+buildDiscordFetchInit,
2324buildPackagedUpgradeUpdateArgs,
2425buildReleaseOnboardArgs,
2526buildWindowsDevUpdateToolchainCheckScript,
@@ -41,6 +42,7 @@ import {
4142CROSS_OS_WINDOWS_PACKAGED_UPGRADE_WRAPPER_TIMEOUT_MS,
4243CROSS_OS_DASHBOARD_FETCH_TIMEOUT_MS,
4344CROSS_OS_DASHBOARD_SMOKE_TIMEOUT_MS,
45+CROSS_OS_DISCORD_FETCH_TIMEOUT_MS,
4446CROSS_OS_AGENT_TURN_TIMEOUT_SECONDS,
4547CROSS_OS_COMMAND_HEARTBEAT_SECONDS,
4648isImmutableReleaseRef,
@@ -204,9 +206,7 @@ describe("scripts/openclaw-cross-os-release-checks", () => {
204206});
205207206208it("rejects malformed cross-OS positive integer environment values", () => {
207-expect(parsePositiveIntegerEnv("OPENCLAW_CROSS_OS_COMMAND_HEARTBEAT_SECONDS", 60, {})).toBe(
208-60,
209-);
209+expect(parsePositiveIntegerEnv("OPENCLAW_CROSS_OS_COMMAND_HEARTBEAT_SECONDS", 60, {})).toBe(60);
210210expect(
211211parsePositiveIntegerEnv("OPENCLAW_CROSS_OS_COMMAND_HEARTBEAT_SECONDS", 60, {
212212OPENCLAW_CROSS_OS_COMMAND_HEARTBEAT_SECONDS: "25",
@@ -1215,6 +1215,28 @@ describe("scripts/openclaw-cross-os-release-checks", () => {
12151215});
12161216});
121712171218+it("bounds Discord API calls with a timeout signal", () => {
1219+expect(CROSS_OS_DISCORD_FETCH_TIMEOUT_MS).toBeGreaterThanOrEqual(10_000);
1220+1221+const init = buildDiscordFetchInit("discord-token", {
1222+method: "POST",
1223+headers: {
1224+"Content-Type": "application/json",
1225+},
1226+body: "{}",
1227+});
1228+1229+expect(init).toMatchObject({
1230+method: "POST",
1231+body: "{}",
1232+headers: {
1233+Authorization: "Bot discord-token",
1234+"Content-Type": "application/json",
1235+},
1236+});
1237+expect(init.signal).toBeInstanceOf(AbortSignal);
1238+});
1239+12181240it("keeps the dev-update lane for main only", () => {
12191241expect(shouldRunMainChannelDevUpdate("main")).toBe(true);
12201242expect(shouldRunMainChannelDevUpdate("08753a1d793c040b101c8a26c43445dbbab14995")).toBe(false);
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。