-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
[Feature]: Telegram quote/reply context should be a first-class, durable inbound contract instead of a split prompt/runtime patch surface #88032
Copy link
Copy link
Open
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper-recovery-stuckclawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.ClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.enhancementNew feature or requestNew feature or requestimpact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.Good issue quality with a plausible reproduction path needing some confirmation.
Description
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper-recovery-stuckclawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.ClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.enhancementNew feature or requestNew feature or requestimpact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.Good issue quality with a plausible reproduction path needing some confirmation.
Type
Fields
Priority
None yet
Summary
On this OpenClaw deployment, Telegram quote/reply handling has been functional only after local runtime patching, and it regressed again later because the implementation was effectively split across two independently drifting surfaces:
dist/get-reply-*.jsdist/bot-*.jsThe concrete failure mode was that the prompt-side quote markers were still present, but the runtime bot bundle had drifted back to
bodyForAgent: bodyTextinstead of passing the richer reply-aware body through to the agent.This suggests the Telegram quote/reply path is not yet a stable first-class contract inside OpenClaw. It behaves more like a fragile composition of prompt formatting plus runtime body mapping.
This is not just asking for one bug fix in one bundled file.
The broader request is to make quoted/replied message context a supported, durable part of the inbound message model so that:
dist/*files to preserve expected reply behaviorIn other words: reply context should feel like a product capability, not a lucky byproduct of two cooperating patches.
Problem to solve
Observed behavior
The inbound Telegram quote/reply path traced locally was:
The prompt-side work had already been patched so agent-visible prompt context exposed reply metadata such as:
reply_to_*fieldsBut a later live regression showed the runtime-side bot bundle had drifted back to plain:
even though it was already constructing a richer reply-aware body.
The local recovery was to restore the runtime-side mapping to the equivalent of:
After restart, reply-aware behavior returned.
Why this is brittle
The current shape appears brittle for a few reasons:
dist/*markers instead of relying on a supported upstream contract.Proposed solution
Requested outcome
bodyForAgent: bodyTextwhile still appearing superficially healthy.Nice-to-have
Alternatives considered
No response
Impact
When this drifts, the user can still be “replying” in Telegram, but the assistant loses the important reference context that makes the reply intelligible. The result is a degraded conversational experience that feels random from the user side, even though the underlying issue is a runtime contract gap.
Evidence/examples
Additional information
Environment
dist/bot-*.jsdist/get-reply-*.jsThis request is based on a real regression observed in production on an OpenClaw deployment, but the ask is upstream-facing: make quote/reply context durable enough that operators do not need local
dist/*patching and post-update marker checks just to preserve expected Telegram reply behavior.