Repository navigation
Description
Bug type
Behavior bug (incorrect output/state without crash)
Beta release blocker
No
Summary
Telegram forum topic names are not reliably included in agent context, so agents can receive only a message_thread_id/topic id and block even when the topic title is the intended task context.
Steps to reproduce
- Run OpenClaw 2026.5.19 with the Telegram provider connected to a forum-enabled Telegram supergroup and routed agent.
- Use a forum topic whose title is needed as workflow context.
- Send a topic-scoped native command or routed request that relies on the current Telegram topic title, without also typing the issue number or branch/topic name in the message body.
- Inspect the resulting agent session/trajectory.
Observed local evidence, with project-specific identifiers intentionally redacted:
- OpenClaw version:
OpenClaw 2026.5.19 (a185ca2). - The session key shape included a Telegram group topic id.
- The agent trajectory trusted metadata for that turn included Telegram channel/provider/chat type but no
topic_name. - The agent replied that OpenClaw only provided the Telegram topic id, not the topic title, so it could not safely infer the intended issue/branch.
- The local topic-name cache had a matching title for the same redacted group/topic key.
Expected behavior
When OpenClaw has, creates, edits, or observes a Telegram forum topic title, agent turns in that topic should include both the topic id and topic name in trusted metadata before prompt construction. This should work for normal topic messages, native slash commands, and system/wakeup turns that reconstruct delivery context from session state.
Actual behavior
The agent can receive only the topic id/thread id, with no trusted topic_name, and then asks the user for an issue/branch/topic name even though the current Telegram topic title is the intended context.
OpenClaw version
2026.5.19 (a185ca2)
Operating system
Ubuntu 24.04
Install method
npm global under nvm, launched via systemd user service
Model
openai/gpt-5.5 (not model-specific)
Provider / routing chain
Telegram group topic -> OpenClaw gateway -> routed OpenClaw agent -> OpenAI provider
Additional provider/model setup details
The behavior is in Telegram channel metadata/session context before model execution. No provider-specific behavior is required to reproduce.
Logs, screenshots, and evidence
$ openclaw --version
OpenClaw 2026.5.19 (a185ca2)
Redacted local evidence:
- A Telegram forum-topic session had a topic-scoped session key.
- The agent-visible trusted metadata did not include topic_name.
- The agent response stated that only the Telegram topic id was available.
- The local topic-name cache had a matching title for the same redacted group/topic key.Impact and severity
Affected: Telegram forum-topic users who use topic names as workflow context, especially issue/topic workflows.
Severity: Medium to high for mobile workflows. It blocks otherwise valid commands unless the user redundantly types the issue number or branch/topic name in the message body.
Frequency: Observed when the agent turn receives only the Telegram topic id in metadata, including native command/topic flows.
Consequence: Agents ask for clarification instead of starting the requested work, even though the Telegram topic title is the intended source of truth.
Additional information
This seems difficult to solve cleanly as an external plugin today because the available message hooks appear observational for this path; they do not provide a supported way to mutate trusted inbound context before prompt construction.
A robust core fix would likely:
- persist topic names from Telegram
forum_topic_createdandforum_topic_editedservice messages; - persist topic names immediately after successful
createForumTopicandeditForumTopicactions; - resolve cached topic names into
TopicNamefor normal inbound messages, native slash commands, and system/wakeup turns; - include tests that verify
topic_namesurvives all three paths.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon May 24, 2026
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve.
Latest ClawSweeper review: 2026-05-24 11:20 UTC / May 24, 2026, 7:20 AM ET.
Workflow note: Future ClawSweeper reviews update this same comment in place.
How this review workflow works
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only.@clawsweeper reviewto request a fresh review only.@clawsweeper autofix,@clawsweeper automerge,@clawsweeper fix ci, or@clawsweeper address review.@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.Summary
Keep open: current main partially covers normal Telegram inbound messages, but source inspection still shows missing topic-name propagation for native slash-command context, topic create/edit actions, and reconstructed delivery/system turns.
Reproducibility: yes. at source level: current main builds native Telegram command and restart-continuation contexts with MessageThreadId but without TopicName, while the normal inbound path has a cache-backed TopicName flow. I did not run live Telegram because this review is read-only.
Next step
The source gaps are concrete and bounded to Telegram context propagation, with clear tests to extend.
Review details
Best possible solution:
Keep the fix in the Telegram channel boundary by making one canonical topic-name resolver/cache update path feed normal inbound, native command, successful create/edit, and reconstructed system delivery contexts.
Do we have a high-confidence way to reproduce the issue?
Yes, at source level: current main builds native Telegram command and restart-continuation contexts with MessageThreadId but without TopicName, while the normal inbound path has a cache-backed TopicName flow. I did not run live Telegram because this review is read-only.
Is this the best way to solve the issue?
Yes: extending the existing Telegram topic-name cache/resolver across the missing Telegram-owned paths is narrower and more maintainable than adding a core workaround or external plugin hook.
Label changes:
P2: The bug blocks topic-scoped Telegram workflows that rely on topic titles, but the blast radius is limited to Telegram forum-topic context propagation.impact:session-state: The missing topic name is trusted conversation/session context that should survive routing and prompt construction.issue-rating: 🦞 diamond lobster: Current issue advisory state selects this label.clawsweeper:source-repro: Current issue advisory state selects this label.clawsweeper:queueable-fix: Current issue advisory state selects this label.clawsweeper:fix-shape-clear: Current issue advisory state selects this label.Label justifications:
P2: The bug blocks topic-scoped Telegram workflows that rely on topic titles, but the blast radius is limited to Telegram forum-topic context propagation.impact:session-state: The missing topic name is trusted conversation/session context that should survive routing and prompt construction.Acceptance criteria:
What I checked:
extensions/telegram/src/bot-message-context.ts:175, 578e73f66763)src/auto-reply/reply/inbound-meta.ts:504, 578e73f66763)extensions/telegram/src/bot-native-commands.ts:1151, 578e73f66763)extensions/telegram/src/action-runtime.ts:721, 578e73f66763)extensions/telegram/src/bot-message-dispatch.ts:651, 578e73f66763)src/gateway/server-restart-sentinel.ts:308, 578e73f66763)Likely related people:
extensions/telegram/src/bot-message-context.ts,extensions/telegram/src/topic-name-cache.ts,src/auto-reply/reply/inbound-meta.ts)extensions/telegram/src/bot-message-context.ts,extensions/telegram/src/topic-name-cache.ts,extensions/telegram/src/bot-message-context.dm-threads.test.ts)extensions/telegram/src/bot-message-dispatch.ts,extensions/telegram/src/bot-message-dispatch.test.ts)extensions/telegram/src/bot-native-commands.ts,src/gateway/server-restart-sentinel.ts,extensions/telegram/src/bot-message-context.ts)Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 578e73f66763.
fix(telegram): propagate forum topic names into agent context (#86299)
fix(telegram): propagate forum topic names into agent context (opencl…
fix(telegram): propagate forum topic names into agent context (opencl…
fix(telegram): propagate forum topic names into agent context (opencl…