mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-10 16:51:13 +00:00
fix: preserve explicit Telegram topic targets on replies (#59634) (thanks @dashhuang)
This commit is contained in:
@@ -33,6 +33,7 @@ Docs: https://docs.openclaw.ai
|
||||
- Matrix/crypto persistence: capture and write the IndexedDB snapshot while holding the snapshot file lock so concurrent gateway and CLI persists cannot overwrite newer crypto state. (#59851) Thanks @al3mart.
|
||||
- Telegram/media: keep inbound image attachments readable on upgraded installs where legacy state roots still differ from the managed config-dir media cache. (#59971) Thanks @neeravmakwana.
|
||||
- Telegram/local Bot API: thread `channels.telegram.apiRoot` through buffered reply-media and album downloads so self-hosted Bot API file paths stop falling back to `api.telegram.org` and 404ing. (#59544) Thanks @SARAMALI15792.
|
||||
- Telegram/replies: preserve explicit topic targets when `replyTo` is present while still inheriting the current topic for same-chat replies without an explicit topic. (#59634) Thanks @dashhuang.
|
||||
|
||||
## 2026.4.2
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ describe("resolveTelegramAutoThreadId", () => {
|
||||
it("matches chats across Telegram target formats", () => {
|
||||
expect(
|
||||
resolveTelegramAutoThreadId({
|
||||
to: "telegram:group:-100123:topic:77",
|
||||
to: "telegram:group:-100123",
|
||||
toolContext: createToolContext(),
|
||||
}),
|
||||
).toBe("thread-1");
|
||||
@@ -36,4 +36,13 @@ describe("resolveTelegramAutoThreadId", () => {
|
||||
}),
|
||||
).toBeUndefined();
|
||||
});
|
||||
|
||||
it("does not override an explicit target topic", () => {
|
||||
expect(
|
||||
resolveTelegramAutoThreadId({
|
||||
to: "telegram:group:-100123:topic:77",
|
||||
toolContext: createToolContext(),
|
||||
}),
|
||||
).toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -9,6 +9,9 @@ export function resolveTelegramAutoThreadId(params: {
|
||||
return undefined;
|
||||
}
|
||||
const parsedTo = parseTelegramTarget(params.to);
|
||||
if (parsedTo.messageThreadId != null) {
|
||||
return undefined;
|
||||
}
|
||||
const parsedChannel = parseTelegramTarget(context.currentChannelId);
|
||||
if (parsedTo.chatId.toLowerCase() !== parsedChannel.chatId.toLowerCase()) {
|
||||
return undefined;
|
||||
|
||||
@@ -268,6 +268,20 @@ describe("telegramPlugin threading", () => {
|
||||
|
||||
expect(resolved).toBe("533274");
|
||||
});
|
||||
|
||||
it("does not override an explicit target topic when replyToId is present", () => {
|
||||
const resolved = telegramPlugin.threading?.resolveAutoThreadId?.({
|
||||
cfg: createCfg(),
|
||||
to: "telegram:-1001:topic:99",
|
||||
replyToId: "4103",
|
||||
toolContext: {
|
||||
currentChannelId: "telegram:-1001:topic:77",
|
||||
currentThreadTs: "77",
|
||||
},
|
||||
});
|
||||
|
||||
expect(resolved).toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
||||
describe("telegramPlugin bindings", () => {
|
||||
|
||||
Reference in New Issue
Block a user