openclaw - 💡(How to fix) Fix [2026.5.18] Reply target / inbound context dropped from model prompt in runtimeOnly path [1 pull requests]

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…

OpenClaw 2026.5.18 regresses Telegram (and likely other reply-aware channel) behavior: when a user replies to an earlier message and mentions the bot, on the runtime-only prompt path, the reply target / replied message body is no longer visible in the model's prompt. The bot answers based only on the new mention text, with no awareness of what was being replied to.

This worked in 2026.5.12 (last known good).

Update (post-Mantis run): the bug only triggers when promptSubmission.runtimeOnly === true, i.e. when transcriptPrompt becomes empty after mention/strip. Plain @bot text body replies (where transcriptPrompt is non-empty) do not hit the bug. See the "Triggering conditions" section below for the precise shape.

Root Cause

Root cause (dist source)

Fix Action

Fixed

Code Example

const promptForModel = buildCurrentInboundPrompt({
    context: promptSubmission.runtimeOnly ? void 0 : params.currentInboundContext,
    prompt: promptSubmission.prompt
});

---

if (promptSubmission.runtimeOnly && runtimeSystemContext) {
    const runtimeSystemPrompt = composeSystemPromptWithHookContext({
        baseSystemPrompt: systemPromptText,
        appendSystemContext: runtimeSystemContext
    });
    ...
}

---

context: params.currentInboundContext
RAW_BUFFERClick to expand / collapse

Summary

OpenClaw 2026.5.18 regresses Telegram (and likely other reply-aware channel) behavior: when a user replies to an earlier message and mentions the bot, on the runtime-only prompt path, the reply target / replied message body is no longer visible in the model's prompt. The bot answers based only on the new mention text, with no awareness of what was being replied to.

This worked in 2026.5.12 (last known good).

Update (post-Mantis run): the bug only triggers when promptSubmission.runtimeOnly === true, i.e. when transcriptPrompt becomes empty after mention/strip. Plain @bot text body replies (where transcriptPrompt is non-empty) do not hit the bug. See the "Triggering conditions" section below for the precise shape.

Triggering conditions

The runtimeOnly path is entered by resolveRuntimeContextPromptParts only when the transcript prompt is empty after the channel layer's mention strip. Real-world triggers:

  • Bare mention reply: user replies to a message with only the bot mention (@bot alone, no further text). After mention strip, transcript text is empty.
  • Sticker- / media-only reply: the inbound message carries the mention and a reply target but has no caption text reaching the agent runner as transcript.
  • Room events / suppressNextUserMessagePersistence: false with empty transcript: channel layer emits a runtime event with currentInboundContext populated (reply target) and an empty transcript prompt.

When the user replies and adds any body text alongside the mention (e.g. @bot what do you think?), transcriptPrompt is non-empty, runtimeOnly stays false, and currentInboundContext is correctly passed through. That common path is not affected.

Reproduction

  1. In any Telegram group where the bot is allowed, post message A from some account.
  2. From another account, reply to message A and mention the bot with no extra text (i.e. message body after mention strip is empty — bare @yourbot reply, sticker reply with mention, etc.).
  3. Bot responds. Response shows it does not know the content of message A.

Expected: bot's prompt includes a "Reply target of current user message" block carrying the content of message A.

Actual on 2026.5.18: that block is absent from what the model sees.

Root cause (dist source)

In dist/selection-Cr-9-UpD.js (around line 14201) / src/agents/pi-embedded-runner/run/attempt.ts:3621:

const promptForModel = buildCurrentInboundPrompt({
    context: promptSubmission.runtimeOnly ? void 0 : params.currentInboundContext,
    prompt: promptSubmission.prompt
});

When promptSubmission.runtimeOnly === true, params.currentInboundContext is unconditionally dropped. The directly following branch only re-injects runtimeSystemContext (plugin/hook-derived):

if (promptSubmission.runtimeOnly && runtimeSystemContext) {
    const runtimeSystemPrompt = composeSystemPromptWithHookContext({
        baseSystemPrompt: systemPromptText,
        appendSystemContext: runtimeSystemContext
    });
    ...
}

It does not re-inject currentInboundContext (channel-level reply target / replied message). So inbound reply context is lost in the runtimeOnly path.

The Telegram channel layer itself still resolves and attaches reply_to_message to the inbound context — the upstream Telegram update contains the replied text, and the channel handler attaches it. Loss happens in the prompt-assembly step shown above.

Channel impact

  • Telegram: confirmed broken (when transcript becomes empty after mention-strip).
  • Any other reply-aware channel that populates currentInboundContext on an empty transcript (Discord replies, Slack thread parents, room events) is affected the same way.

Suggested fix

Either:

  1. Pass currentInboundContext through unconditionally:
    context: params.currentInboundContext
  2. Or, if runtimeOnly was intentionally meant to relocate context into the system role, also append currentInboundContext (as untrusted inbound block) into runtimeSystemContext so the existing system-prompt-composition branch picks it up.

PR #83786 implements option 1.

Suggested regression test

Unit/integration test where:

  • transcriptPrompt: "",
  • non-empty currentInboundContext (with a Reply target text block),
  • agent runs with runtimeOnly: true,
  • assert the assembled model prompt contains the reply-target text.

For Mantis / end-to-end coverage: a Telegram scenario where the user replies to message A and sends a bare-mention message (no body text after the mention) — that triggers the runtimeOnly path and exposes the regression visually.

Versions

  • Broken: 2026.5.18 (commit 50a2481)
  • Last good: 2026.5.12

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix [2026.5.18] Reply target / inbound context dropped from model prompt in runtimeOnly path [1 pull requests]