Skip to content

Commit 74ed75f

Browse files
frankbuildobviyus
andauthored
fix: deliver verbose tool summaries in Telegram forum topics (#43236) (thanks @frankbuild)
* fix(auto-reply): deliver verbose tool summaries in Telegram forum topics Forum topics have ChatType 'group' but are threaded conversations where verbose tool output should be delivered (same as DMs). The shouldSendToolSummaries gate now checks IsForum to allow tool summaries in forum topic sessions. Fixes #43206 * test: add sendToolResult count assertion per review feedback * fix: add changelog for forum topic verbose tool summaries (#43236) (thanks @frankbuild) --------- Co-authored-by: Ayaan Zaidi <hi@obviy.us>
1 parent 4cb8dde commit 74ed75f

3 files changed

Lines changed: 33 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Docs: https://docs.openclaw.ai
1717

1818
### Fixes
1919

20+
- Telegram: deliver verbose tool summaries inside forum topic sessions again, so threaded topic chats now match DM verbose behavior. (#43236) Thanks @frankbuild.
2021
- Agents/sandbox: honor `tools.sandbox.tools.alsoAllow`, let explicit sandbox re-allows remove matching built-in default-deny tools, and keep sandbox explain/error guidance aligned with the effective sandbox tool policy. (#54492) Thanks @ngutman.
2122
- Agents/sandbox: make blocked-tool guidance glob-aware again, redact/sanitize session-specific explain hints for safer copy-paste, and avoid leaking control-character session keys in those hints. (#54684) Thanks @ngutman.
2223
- Feishu: close WebSocket connections on monitor stop/abort so ghost connections no longer persist, preventing duplicate event processing and resource leaks across restart cycles. (#52844) Thanks @schumilin.

src/auto-reply/reply/dispatch-from-config.test.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,34 @@ describe("dispatchReplyFromConfig", () => {
755755
expect(dispatcher.sendFinalReply).toHaveBeenCalledTimes(1);
756756
});
757757

758+
it("delivers tool summaries in forum topic sessions (group + IsForum)", async () => {
759+
setNoAbort();
760+
const cfg = emptyConfig;
761+
const dispatcher = createDispatcher();
762+
const ctx = buildTestCtx({
763+
Provider: "telegram",
764+
ChatType: "group",
765+
IsForum: true,
766+
MessageThreadId: 99,
767+
});
768+
769+
const replyResolver = async (
770+
_ctx: MsgContext,
771+
opts?: GetReplyOptions,
772+
_cfg?: OpenClawConfig,
773+
) => {
774+
await opts?.onToolResult?.({ text: "🔧 exec: ls" });
775+
return { text: "done" } satisfies ReplyPayload;
776+
};
777+
778+
await dispatchReplyFromConfig({ ctx, cfg, dispatcher, replyResolver });
779+
expect(dispatcher.sendToolResult).toHaveBeenCalledWith(
780+
expect.objectContaining({ text: "🔧 exec: ls" }),
781+
);
782+
expect(dispatcher.sendToolResult).toHaveBeenCalledTimes(1);
783+
expect(dispatcher.sendFinalReply).toHaveBeenCalledTimes(1);
784+
});
785+
758786
it("delivers deterministic exec approval tool payloads in groups", async () => {
759787
setNoAbort();
760788
const cfg = emptyConfig;

src/auto-reply/reply/dispatch-from-config.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,10 @@ export async function dispatchReplyFromConfig(params: {
587587
}
588588
}
589589

590-
const shouldSendToolSummaries = ctx.ChatType !== "group" && ctx.CommandSource !== "native";
590+
// Forum topics are threaded conversations within a group — verbose tool
591+
// summaries should be delivered into the topic thread, same as DMs.
592+
const shouldSendToolSummaries =
593+
(ctx.ChatType !== "group" || ctx.IsForum === true) && ctx.CommandSource !== "native";
591594
const acpDispatch = await dispatchAcpRuntime.tryDispatchAcpReply({
592595
ctx,
593596
cfg,

0 commit comments

Comments
 (0)