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

推荐订阅源

S
SegmentFault 最新的问题
J
Java Code Geeks
V
V2EX
Blog — PlanetScale
Blog — PlanetScale
博客园 - 司徒正美
Hugging Face - Blog
Hugging Face - Blog
F
Fortinet All Blogs
aimingoo的专栏
aimingoo的专栏
B
Blog
A
About on SuperTechFans
有赞技术团队
有赞技术团队
月光博客
月光博客
Microsoft Azure Blog
Microsoft Azure Blog
阮一峰的网络日志
阮一峰的网络日志
腾讯CDC
美团技术团队
大猫的无限游戏
大猫的无限游戏
爱范儿
爱范儿
N
Netflix TechBlog - Medium
C
Check Point Blog
Recent Announcements
Recent Announcements
博客园 - Franky
博客园 - 叶小钗
T
Tailwind CSS Blog

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(cron): compare thread IDs when deduping failure desti...
vincentkoc · 2026-06-22 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -1,11 +1,28 @@

11

// Cron notification tests protect completion-delivery warning behavior,

22

// including URL redaction for invalid webhook destinations.

3-

import { describe, expect, it, vi } from "vitest";

3+

import { beforeEach, describe, expect, it, vi } from "vitest";

44

import type { CliDeps } from "../cli/deps.types.js";

55

import type { CronJob } from "../cron/types.js";

6+
7+

const mocks = vi.hoisted(() => ({

8+

sendFailureNotificationAnnounce: vi.fn(),

9+

}));

10+
11+

vi.mock("../cron/delivery.js", async (importOriginal) => {

12+

const actual = await importOriginal<typeof import("../cron/delivery.js")>();

13+

return {

14+

...actual,

15+

sendFailureNotificationAnnounce: mocks.sendFailureNotificationAnnounce,

16+

};

17+

});

18+
619

import { dispatchGatewayCronFinishedNotifications } from "./server-cron-notifications.js";

720
821

describe("dispatchGatewayCronFinishedNotifications", () => {

22+

beforeEach(() => {

23+

vi.clearAllMocks();

24+

});

25+
926

it("redacts invalid completion webhook targets in warnings", () => {

1027

const logger = {

1128

warn: vi.fn(),

@@ -46,4 +63,56 @@ describe("dispatchGatewayCronFinishedNotifications", () => {

4663

"cron: skipped completion webhook delivery, delivery.completionDestination.to must be a valid http(s) URL",

4764

);

4865

});

66+
67+

it("keeps configured failure destinations from inheriting the primary delivery thread", () => {

68+

const logger = {

69+

warn: vi.fn(),

70+

};

71+

const job = {

72+

id: "cron-threaded-failure-dest",

73+

name: "threaded failure dest",

74+

enabled: true,

75+

createdAtMs: 1,

76+

updatedAtMs: 1,

77+

schedule: { kind: "every", everyMs: 60_000 },

78+

sessionTarget: "isolated",

79+

sessionKey: "agent:main:telegram:group:-1001234567890:thread:42",

80+

wakeMode: "next-heartbeat",

81+

payload: { kind: "agentTurn", message: "hello" },

82+

delivery: {

83+

mode: "announce",

84+

channel: "telegram",

85+

to: "-1001234567890",

86+

threadId: 42,

87+

failureDestination: {

88+

mode: "announce",

89+

channel: "telegram",

90+

to: "-1001234567890",

91+

},

92+

},

93+

state: {},

94+

} satisfies CronJob;

95+
96+

dispatchGatewayCronFinishedNotifications({

97+

evt: {

98+

jobId: job.id,

99+

action: "finished",

100+

status: "error",

101+

error: "boom",

102+

},

103+

job,

104+

deps: {} as CliDeps,

105+

logger,

106+

resolveCronAgent: () => ({ agentId: "main", cfg: {} }),

107+

});

108+
109+

expect(mocks.sendFailureNotificationAnnounce).toHaveBeenCalledTimes(1);

110+

expect(mocks.sendFailureNotificationAnnounce.mock.calls[0]?.[4]).toEqual({

111+

channel: "telegram",

112+

to: "-1001234567890",

113+

accountId: undefined,

114+

sessionKey: "agent:main:telegram:group:-1001234567890:thread:42",

115+

inheritSessionThread: false,

116+

});

117+

});

49118

});