openclaw - 💡(How to fix) Fix Telegram forum topic exec approval follow-up is delivered to general topic instead of the originating topic [2 comments, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#58864Fetched 2026-04-08 02:31:48
View on GitHub
Comments
2
Participants
1
Timeline
1
Reactions
0
Author
Participants
Timeline (top)
commented ×1

When an exec approval request is triggered from a Telegram forum topic, the approval prompt can be delivered correctly to the approver's Telegram DM, but after the approval is granted, the follow-up result is delivered to the group's general topic (topic:1) instead of the originating forum topic.

In my case, the request originated from topic:345, but the post-approval result (Exec finished ...) was sent to topic:1 (general).

Root Cause

Because of that, this does not look like a generic Telegram forum-topic/session-modeling issue. It looks more like the originating topic is being lost somewhere in the exec approval request state or in the approval follow-up direct-delivery path.

Code Example

Exec finished (gateway id=..., session=..., code 0)
...
RAW_BUFFERClick to expand / collapse

Summary

When an exec approval request is triggered from a Telegram forum topic, the approval prompt can be delivered correctly to the approver's Telegram DM, but after the approval is granted, the follow-up result is delivered to the group's general topic (topic:1) instead of the originating forum topic.

In my case, the request originated from topic:345, but the post-approval result (Exec finished ...) was sent to topic:1 (general).

Environment

  • OpenClaw version: 2026.3.31
  • Channel: Telegram
  • Chat type: group forum topic
  • Approval delivery config used during testing:
    • channels.telegram.execApprovals.enabled: true
    • channels.telegram.execApprovals.approvers: ["<my Telegram user id>"]
    • channels.telegram.execApprovals.target: "both"
    • channels.telegram.capabilities.inlineButtons: "all"

Steps to reproduce

  1. In a Telegram forum group, send a message from a non-general topic (for example topic:345) that triggers an exec approval.
  2. Receive the approval prompt in Telegram DM.
  3. Approve the request from Telegram DM.
  4. Observe where the post-approval follow-up is delivered.

Expected behavior

The approval prompt and the post-approval follow-up should stay associated with the originating forum topic.

If the request originated from topic:345, the follow-up result should be delivered back to topic:345.

This also matches the current docs, which say Telegram forum topics preserve the topic for both the approval prompt and the post-approval follow-up.

Actual behavior

The approval prompt is received correctly in Telegram DM, but after approval:

  • the follow-up result is delivered to the group's general topic (topic:1)
  • not to the originating topic (topic:345)

In addition, Telegram often only receives the direct exec result text such as:

Exec finished (gateway id=..., session=..., code 0)
...

while the richer assistant follow-up is only visible in Web UI.

What I verified

I checked a few things locally to rule out simpler routing mistakes:

  1. The originating Telegram session for topic:345 is stored correctly.

    • origin.threadId = 345
    • lastThreadId = 345
  2. topic:1 and topic:345 are separate session entries, not aliases of the same session.

  3. The tool calls that triggered these approval tests were recorded under the topic:345 session transcript, not only under topic:1.

  4. Static inspection of the local OpenClaw code suggests that the normal session target resolution for:

    • sessionKey = agent:main:telegram:group:<chat-id>:topic:345
    • turnSourceThreadId = 345

    resolves to threadId = 345, not 1.

Because of that, this does not look like a generic Telegram forum-topic/session-modeling issue. It looks more like the originating topic is being lost somewhere in the exec approval request state or in the approval follow-up direct-delivery path.

Possibly relevant observations

The problem seems to affect the exec approval follow-up path specifically.

From local inspection, these code paths looked relevant:

  • buildExecApprovalFollowupTarget(...)
  • sendExecApprovalFollowup(...)
  • sendExecApprovalFollowupResult(...)
  • resolveExecApprovalSessionTarget(...)

I also noticed that the direct Telegram follow-up for exec approval uses the raw exec result text, while assistant-style follow-up appears to go through a separate path.

Impact

For Telegram forum groups, this makes exec approvals confusing to use because:

  • approval is granted from DM
  • follow-up appears in the wrong topic (general)
  • assistant continuation may not show up in Telegram as expected

Question

Is this a known issue in the Telegram forum-topic routing for exec approval follow-ups?

If needed, I can provide sanitized logs and the exact local observations I used to narrow this down.

extent analysis

TL;DR

The issue can be addressed by investigating and fixing the session target resolution in the exec approval follow-up path, specifically in functions like buildExecApprovalFollowupTarget and resolveExecApprovalSessionTarget.

Guidance

  • Review the buildExecApprovalFollowupTarget and resolveExecApprovalSessionTarget functions to ensure they correctly resolve the session target for exec approval follow-ups, keeping the originating topic (topic:345) instead of defaulting to the general topic (topic:1).
  • Verify that the sessionKey and turnSourceThreadId are correctly set and used in the approval follow-up path to maintain the association with the originating topic.
  • Check if the issue is specific to the direct exec result text path or if it also affects the assistant-style follow-up path, and adjust the fix accordingly.
  • Consider providing sanitized logs and local observations to further investigate the issue if needed.

Example

No specific code example can be provided without more context or details about the OpenClaw codebase, but the fix likely involves ensuring that the buildExecApprovalFollowupTarget function returns the correct threadId (e.g., 345) for the follow-up message.

Notes

The issue seems specific to the exec approval follow-up path in Telegram forum groups, and the fix may require changes to the session target resolution logic in the relevant functions. The problem does not appear to be a generic Telegram forum-topic or session-modeling issue.

Recommendation

Apply a workaround or fix to the session target resolution in the exec approval follow-up path, as the issue is likely due to a specific implementation detail in the OpenClaw codebase. This will help maintain the correct association between the originating topic and the follow-up message.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

The approval prompt and the post-approval follow-up should stay associated with the originating forum topic.

If the request originated from topic:345, the follow-up result should be delivered back to topic:345.

This also matches the current docs, which say Telegram forum topics preserve the topic for both the approval prompt and the post-approval follow-up.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING