openclaw - 💡(How to fix) Fix [Bug]: Telegram quote/reply context missing from prompt.submitted in OpenAI Codex group-topic sessions

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…

Telegram reply/quote context appears to be missing from the actual submitted model prompt in an OpenAI Codex Telegram group-topic session on OpenClaw 2026.5.18.

This looks related to the earlier Telegram reply/quote context bugs, especially #77582, but that issue was closed as fixed in 2026.5.3-1. The behavior below is still reproducible on 2026.5.18 and may be a remaining path specific to OpenAI Codex / direct runtime / Telegram group topics.

Root Cause

The likely failure boundary is before or at prompt.submitted, because the submitted prompt lacks the quote/reply context entirely.

Code Example

What message did I quote?

---

Reply target of current user message (untrusted, for context):

---

I am quoting/replying to a message; can you see it?

---

Please verify again; I am quoting a message now.

---

type: prompt.submitted
sessionKey: agent:main:telegram:group:<redacted>:topic:<redacted>
provider: openai-codex
modelId: gpt-5.5
prompt: <clean current user message only>
RAW_BUFFERClick to expand / collapse

Summary

Telegram reply/quote context appears to be missing from the actual submitted model prompt in an OpenAI Codex Telegram group-topic session on OpenClaw 2026.5.18.

This looks related to the earlier Telegram reply/quote context bugs, especially #77582, but that issue was closed as fixed in 2026.5.3-1. The behavior below is still reproducible on 2026.5.18 and may be a remaining path specific to OpenAI Codex / direct runtime / Telegram group topics.

Environment

  • OpenClaw version: 2026.5.18 (50a2481)
  • Runtime/model: OpenAI Codex / gpt-5.5
  • Session type: Telegram group forum topic
  • Install: npm global install on macOS

Steps to reproduce

  1. Use a Telegram group forum topic connected to OpenClaw.

  2. In Telegram, reply to or quote an earlier message.

  3. Send a short message such as:

    What message did I quote?
  4. Inspect the session transcript and trajectory / submitted prompt.

Expected behavior

The model-visible current turn should include the Telegram reply/quote context, for example a block similar to:

Reply target of current user message (untrusted, for context):

or otherwise include the replied-to / selected quote body and message metadata in the current model input.

The assistant should be able to answer what message was quoted/replied to.

Actual behavior

The assistant only sees the clean current user text. The reply/quote target is absent.

In the affected local run, the trajectory prompt.submitted entries for the relevant turns contained only the standalone user text, for example:

I am quoting/replying to a message; can you see it?

and then:

Please verify again; I am quoting a message now.

There was no Reply target of current user message, selected quote text, reply_to metadata, or replied-message body in prompt.submitted.

This is stronger than just the sanitized session history omitting quote context: the recorded submitted prompt itself appears to be missing the current inbound reply/quote context.

Evidence from local inspection

  • openclaw_session_status(sessionKey="current") showed:
    • OpenClaw 2026.5.18 (50a2481)
    • Runtime: OpenAI Codex
    • Model: gpt-5.5
    • Session: Telegram group topic
  • openclaw_sessions_history(sessionKey="current", includeTools=false) showed only the clean user message content for the quoted/replied turn.
  • Local trajectory inspection showed prompt.submitted for the quoted/replied turn contained only the clean user text, with no reply target / quote block.

Sanitized trajectory shape:

type: prompt.submitted
sessionKey: agent:main:telegram:group:<redacted>:topic:<redacted>
provider: openai-codex
modelId: gpt-5.5
prompt: <clean current user message only>

Why this may be distinct from previous issues

Related issues:

  • #75194: Telegram reply/quote context not passed to assistant
  • #76419: Telegram reply context lost after runtime-context prompt split
  • #77582: Telegram selected quote context normalized but omitted from final model prompt

#77582 was closed as fixed, with a live confirmation on 2026.5.3-1. The current reproduction is on 2026.5.18, so either:

  1. The fix does not cover the OpenAI Codex / direct runtime path.
  2. The fix does not cover Telegram group/forum-topic sessions.
  3. The context is parsed upstream but not preserved into prompt.submitted for this runtime.
  4. The inbound Telegram quote/reply payload is not being captured in this specific group-topic path.

Suggested investigation

Check whether currentInboundContext / reply metadata is populated and threaded into buildCurrentInboundPrompt(...) for OpenAI Codex embedded/direct runs in Telegram group-topic sessions.

Relevant installed dist code path appears to include:

  • runtime-context-prompt-*.js
  • selection-*.js around buildCurrentInboundPrompt({ context: params.currentInboundContext, prompt: promptSubmission.prompt })
  • get-reply-*.js around construction of currentInboundContext

The likely failure boundary is before or at prompt.submitted, because the submitted prompt lacks the quote/reply context entirely.

Acceptance criteria

  • A Telegram reply/quote in a group forum topic produces a model-visible current prompt containing the replied-to or selected quote context.
  • prompt.submitted / finalPromptText includes the current turn reply/quote context, sanitized as untrusted context.
  • The behavior works with OpenAI Codex runtime, not only other providers/runners.
  • Existing fixes for #77582 remain covered and include this runtime/session shape.

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 model-visible current turn should include the Telegram reply/quote context, for example a block similar to:

Reply target of current user message (untrusted, for context):

or otherwise include the replied-to / selected quote body and message metadata in the current model input.

The assistant should be able to answer what message was quoted/replied to.

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 [Bug]: Telegram quote/reply context missing from prompt.submitted in OpenAI Codex group-topic sessions