


























@@ -1771,7 +1771,7 @@ describe("dispatchTelegramMessage draft streaming", () => {
17711771expect(deliverReplies).not.toHaveBeenCalled();
17721772});
177317731774-it("emits a silent-reply fallback when no final reply was queued and nothing was delivered", async () => {
1774+it("does not emit a silent-reply fallback for no-response DM turns", async () => {
17751775dispatchReplyWithBufferedBlockDispatcher.mockResolvedValue({
17761776queuedFinal: false,
17771777counts: { block: 0, final: 0, tool: 0 },
@@ -1784,6 +1784,50 @@ describe("dispatchTelegramMessage draft streaming", () => {
17841784streamMode: "off",
17851785});
178617861787+expect(deliverReplies).not.toHaveBeenCalled();
1788+});
1789+1790+it("emits a silent-reply fallback for no-response group turns", async () => {
1791+dispatchReplyWithBufferedBlockDispatcher.mockResolvedValue({
1792+queuedFinal: false,
1793+counts: { block: 0, final: 0, tool: 0 },
1794+});
1795+1796+await dispatchWithContext({
1797+context: createContext({
1798+chatId: -1001234,
1799+isGroup: true,
1800+ctxPayload: {
1801+SessionKey: "agent:test:telegram:group:-1001234",
1802+ChatType: "group",
1803+} as TelegramMessageContext["ctxPayload"],
1804+primaryCtx: {
1805+message: { chat: { id: -1001234, type: "supergroup" } },
1806+} as TelegramMessageContext["primaryCtx"],
1807+msg: {
1808+chat: { id: -1001234, type: "supergroup" },
1809+message_id: 456,
1810+} as TelegramMessageContext["msg"],
1811+threadSpec: { id: undefined, scope: "none" },
1812+replyThreadId: undefined,
1813+}),
1814+cfg: {
1815+agents: {
1816+defaults: {
1817+silentReply: {
1818+direct: "disallow",
1819+group: "disallow",
1820+internal: "allow",
1821+},
1822+silentReplyRewrite: {
1823+group: true,
1824+},
1825+},
1826+},
1827+} as Parameters<typeof dispatchTelegramMessage>[0]["cfg"],
1828+streamMode: "off",
1829+});
1830+17871831expect(deliverReplies).toHaveBeenCalledTimes(1);
17881832const replies = deliverReplies.mock.calls[0]?.[0]?.replies as
17891833| Array<{ text?: string }>
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。