fix(telegram): restore thread_id=1 handling for DMs (regression from 19b8416a8) (openclaw#10942) thanks @garnetlyx

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm test:macmini

Co-authored-by: garnetlyx <12513503+garnetlyx@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
This commit is contained in:
Garnet Liu
2026-02-16 00:21:18 +08:00
committed by GitHub
parent 1843bcf1db
commit cc0bfa0f39
5 changed files with 42 additions and 11 deletions

View File

@@ -169,7 +169,7 @@ describe("deliverReplies", () => {
);
});
it("keeps message_thread_id=1 when allowed", async () => {
it("does not include message_thread_id for DMs (threads don't exist in private chats)", async () => {
const runtime = { error: vi.fn(), log: vi.fn() };
const sendMessage = vi.fn().mockResolvedValue({
message_id: 4,
@@ -191,7 +191,7 @@ describe("deliverReplies", () => {
expect(sendMessage).toHaveBeenCalledWith(
"123",
expect.any(String),
expect.objectContaining({
expect.not.objectContaining({
message_thread_id: 1,
}),
);