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

推荐订阅源

腾讯CDC
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
P
Proofpoint News Feed
D
DataBreaches.Net
D
Docker
云风的 BLOG
云风的 BLOG
大猫的无限游戏
大猫的无限游戏
月光博客
月光博客
J
Java Code Geeks
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
罗磊的独立博客
Martin Fowler
Martin Fowler
U
Unit 42
Engineering at Meta
Engineering at Meta
IT之家
IT之家
Vercel News
Vercel News
B
Blog RSS Feed
人人都是产品经理
人人都是产品经理
博客园 - Franky
博客园 - 【当耐特】
Stack Overflow Blog
Stack Overflow Blog
G
Google Developers Blog
MongoDB | Blog
MongoDB | 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(telegram): suppress superseded turn replies · opencla...
steipete · 2026-05-04 · via Recent Commits to openclaw:main

@@ -3468,6 +3468,84 @@ describe("dispatchTelegramMessage draft streaming", () => {

34683468

expect(firstAnswerDraft.clear).not.toHaveBeenCalled();

34693469

});

347034703471+

it("ignores stale answer finalization after a newer message supersedes the same session", async () => {

3472+

let releaseFirstFinal!: () => void;

3473+

const firstFinalGate = new Promise<void>((resolve) => {

3474+

releaseFirstFinal = resolve;

3475+

});

3476+

let resolvePreviewVisible!: () => void;

3477+

const previewVisible = new Promise<void>((resolve) => {

3478+

resolvePreviewVisible = resolve;

3479+

});

3480+3481+

const firstAnswerDraft = createTestDraftStream({

3482+

messageId: 1001,

3483+

onUpdate: (text) => {

3484+

if (text === "Old reply partial") {

3485+

resolvePreviewVisible();

3486+

}

3487+

},

3488+

});

3489+

const firstReasoningDraft = createDraftStream();

3490+

const secondAnswerDraft = createDraftStream();

3491+

const secondReasoningDraft = createDraftStream();

3492+

createTelegramDraftStream

3493+

.mockImplementationOnce(() => firstAnswerDraft)

3494+

.mockImplementationOnce(() => firstReasoningDraft)

3495+

.mockImplementationOnce(() => secondAnswerDraft)

3496+

.mockImplementationOnce(() => secondReasoningDraft);

3497+

dispatchReplyWithBufferedBlockDispatcher

3498+

.mockImplementationOnce(async ({ dispatcherOptions, replyOptions }) => {

3499+

await replyOptions?.onPartialReply?.({ text: "Old reply partial" });

3500+

await firstFinalGate;

3501+

await dispatcherOptions.deliver({ text: "Old reply final" }, { kind: "final" });

3502+

return { queuedFinal: true };

3503+

})

3504+

.mockImplementationOnce(async ({ dispatcherOptions }) => {

3505+

await dispatcherOptions.deliver({ text: "New reply final" }, { kind: "final" });

3506+

return { queuedFinal: true };

3507+

});

3508+

const newReplyDelivered = observeDeliveredReply("New reply final");

3509+

editMessageTelegram.mockResolvedValue({ ok: true, chatId: "123", messageId: "1001" });

3510+3511+

const firstPromise = dispatchWithContext({

3512+

context: createContext({

3513+

ctxPayload: {

3514+

SessionKey: "s1",

3515+

Body: "earlier request",

3516+

RawBody: "earlier request",

3517+

MessageSid: "msg-1",

3518+

} as never,

3519+

}),

3520+

});

3521+3522+

await previewVisible;

3523+3524+

const secondPromise = dispatchWithContext({

3525+

context: createContext({

3526+

ctxPayload: {

3527+

SessionKey: "s1",

3528+

Body: "newer request",

3529+

RawBody: "newer request",

3530+

MessageSid: "msg-2",

3531+

} as never,

3532+

}),

3533+

});

3534+3535+

await newReplyDelivered;

3536+3537+

releaseFirstFinal();

3538+

await Promise.all([firstPromise, secondPromise]);

3539+3540+

expect(editMessageTelegram).not.toHaveBeenCalledWith(

3541+

123,

3542+

1001,

3543+

"Old reply final",

3544+

expect.any(Object),

3545+

);

3546+

expect(firstAnswerDraft.clear).not.toHaveBeenCalled();

3547+

});

3548+34713549

it("discards hidden short partials instead of flushing a stale preview after abort", async () => {

34723550

let releaseFirstCleanup!: () => void;

34733551

const firstCleanupGate = new Promise<void>((resolve) => {