openclaw/extensions/telegram
Ptah.ai 8c43768e27
fix: expose telegram topic names in agent context (#65973) (thanks @ptahdunbar)
* feat(telegram): expose forum topic names in agent context

Telegram Bot API does not provide a method to look up forum topic names
by thread ID. This adds an in-memory LRU cache that learns topic names
from service messages (forum_topic_created, forum_topic_edited,
forum_topic_closed, forum_topic_reopened) and seeds from
reply_to_message.forum_topic_created as a fallback for pre-existing
topics.

The resolved topic name is surfaced as:
- TopicName in MsgContext (available to {{TopicName}} in templates)
- topic_name in the agent prompt metadata block
- topicName in plugin hook event metadata

Includes unit tests for the topic-name-cache module (11 tests including
eviction and read-recency).

Known limitation: cache is in-memory only; after a restart it falls back
to the creation-time name until a rename event is observed.

* refactor(telegram): distill topic name flow

* fix: expose telegram topic names in agent context (#65973) (thanks @ptahdunbar)

---------

Co-authored-by: Ayaan Zaidi <hi@obviy.us>
2026-04-13 23:38:14 +05:30
..
src fix: expose telegram topic names in agent context (#65973) (thanks @ptahdunbar) 2026-04-13 23:38:14 +05:30
allow-from.ts perf: split telegram audit runtime seams 2026-03-22 00:53:12 +00:00
api.ts refactor: clean bundled channel bootstrap boundaries 2026-04-05 18:18:59 +01:00
channel-config-api.test.ts refactor: split doctor legacy normalizers and test ownership 2026-04-05 17:17:16 +01:00
channel-config-api.ts test(agents): stabilize announce cleanup assertions (#61088) 2026-04-05 03:09:28 +03:00
channel-plugin-api.ts refactor: add metadata-first channel configured-state probes 2026-04-06 01:02:45 +01:00
config-api.ts fix(providers): stabilize runtime normalization hooks 2026-04-04 19:34:56 +01:00
configured-state.ts refactor: add metadata-first channel configured-state probes 2026-04-06 01:02:45 +01:00
contract-api.ts test: stabilize loaded full-suite checks 2026-04-12 11:52:56 -07:00
index.test.ts test(extensions): dedupe bundled entry smoke tests 2026-04-12 03:09:18 +01:00
index.ts fix: repair Telegram setup package entry 2026-04-08 04:48:32 +01:00
openclaw.plugin.json refactor: resolve channel env vars from plugin manifests 2026-04-06 19:53:27 +01:00
package.json chore: bump version to 2026.4.12 2026-04-12 10:37:18 -07:00
runtime-api.ts perf(plugins): narrow boundary compile sdk imports 2026-04-08 08:52:51 +01:00
secret-contract-api.ts fix: repair Telegram setup package entry 2026-04-08 04:48:32 +01:00
session-key-api.ts Fix: move bootstrap session grammar into plugin-owned session-key surfaces (#58400) 2026-03-31 19:41:01 -04:00
setup-entry.ts fix: repair Telegram setup package entry 2026-04-08 04:48:32 +01:00
setup-plugin-api.ts fix: repair Telegram setup package entry 2026-04-08 04:48:32 +01:00
test-api.ts fix(tests): narrow bundled plugin test seams 2026-04-06 23:35:07 +01:00
test-support.ts perf(plugins): narrow boundary compile import surfaces 2026-04-08 08:52:52 +01:00
tsconfig.json chore(plugins): bulk add package boundary tsconfig rollout 2026-04-07 08:48:23 +01:00
update-offset-runtime-api.ts refactor: remove remaining core extension reach-ins 2026-03-27 13:46:16 +00:00