Repository navigation
Closed
Labels
P0Emergency: data loss, security bypass, crash loop, or unusable core runtime.Emergency: data loss, security bypass, crash loop, or unusable core runtime.clawsweeper:needs-infoClawSweeper needs more reporter information before it can verify this issue.ClawSweeper needs more reporter information before it can verify this issue.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.ClawSweeper marked this issue as needing security-sensitive review.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.impact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.Security boundary, credential, authz, sandbox, or sensitive-data risk.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.impact:ux-release-blockerA non-technical user is blocked without terminal, logs, config, or support.A non-technical user is blocked without terminal, logs, config, or support.issue-rating: 🦐 gold shrimpDecent issue quality, but reproduction details are still incomplete.Decent issue quality, but reproduction details are still incomplete.
Description
Summary
The runtime context injection feature (introduced in v2026.7.0+) is leaking the full <<<BEGIN_OPENCLAW_INTERNAL_CONTEXT>>> block into Telegram chat replies. This includes:
- Full conversation history being re-injected every turn (previous messages, session tool calls)
- The block appearing literally in my streamed replies to the user
- Making the session unusable — every reply contains a wall of metadata and history
Steps to reproduce
- Install OpenClaw v2026.7.1
- Start a Telegram DM conversation
- After a few exchanges, the runtime context block appears in respones
- The block grows with each turn as it accumulates
Expected behavior
The <<<BEGIN_OPENCLAW_INTERNAL_CONTEXT>>> block should be stripped before being passed to the model, or at minimum before being delivered to the user. Same pattern as Feishu bug #96921 which was fixed for Feishu but not Telegram.
Environment
- OpenClaw: 2026.7.1
- Channel: Telegram (DM)
- Model: deepseek/deepseek-v4-flash (primary deepseek/deepseek-v4-pro)
- Node: v24.18.0 (macOS)
Reacted by clawsweeper
Metadata
Metadata
Assignees
Labels
P0Emergency: data loss, security bypass, crash loop, or unusable core runtime.Emergency: data loss, security bypass, crash loop, or unusable core runtime.clawsweeper:needs-infoClawSweeper needs more reporter information before it can verify this issue.ClawSweeper needs more reporter information before it can verify this issue.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.ClawSweeper marked this issue as needing security-sensitive review.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.impact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.Security boundary, credential, authz, sandbox, or sensitive-data risk.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.impact:ux-release-blockerA non-technical user is blocked without terminal, logs, config, or support.A non-technical user is blocked without terminal, logs, config, or support.issue-rating: 🦐 gold shrimpDecent issue quality, but reproduction details are still incomplete.Decent issue quality, but reproduction details are still incomplete.
Type
Fields
Priority
None yet
Activity
clawsweeper commentedon Jul 16, 2026
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed July 15, 2026, 11:12 PM ET / July 16, 2026, 03:12 UTC.
Summary
Keep open: the report describes a severe, release-current Telegram regression, and current main has a central sanitizer that should remove this exact delimiter, but the evidence does not yet isolate whether Telegram streaming previews, inbound replay, or another projection bypasses that sanitizer. No merged fix or canonical replacement currently owns this Telegram-specific failure. (github.com)
Reproducibility: no. not yet at high confidence on current main. The release-specific steps are credible, but current main's final-text sanitizer already strips the reported delimiter, so a live Telegram trace is needed to identify the bypassing preview, ingress, or replay path.
Ways to help us reproduce this
Next step
The issue is security-sensitive and the bypass boundary is not yet isolated, so it should receive maintainer-led reproduction rather than an automatic repair attempt.
Security
Needs attention: The issue plausibly exposes sensitive runtime and session metadata in Telegram, but the affected trust boundary and exact delivery path still need confirmation.
Review details
Best possible solution:
Keep runtime context structured and model-visible, but route every Telegram preview and final reply through one shared user-visible sanitizer; add mixed-wrapper and wrapper-only regression coverage, and provide an in-product chat reset action if contaminated session state survives the fix.
Do we have a high-confidence way to reproduce the issue?
No, not yet at high confidence on current main. The release-specific steps are credible, but current main's final-text sanitizer already strips the reported delimiter, so a live Telegram trace is needed to identify the bypassing preview, ingress, or replay path.
Is this the best way to solve the issue?
No, stripping the block before it reaches the model is not the best general fix because runtime context is intentionally model-facing. The maintainable fix is to preserve structured internal context while sanitizing every user-visible streaming and final-delivery projection through one canonical boundary.
AGENTS.md: found and applied where relevant.
Remaining risk / open question:
Codex review notes: model internal, reasoning high; reviewed against 957cc81175a3.
Label changes
Label changes:
P0: The report says every Telegram reply becomes an unusable wall of internal metadata, with no in-product recovery path described.impact:security: Conversation history, identifiers, and session tool details are reportedly exposed in a user-visible channel message.impact:session-state: The internal context is reportedly re-injected and grows on each turn, indicating transcript or runtime-context state is feeding back into later turns.impact:ux-release-blocker: A normal Telegram user cannot continue the conversation once every reply is dominated by internal context, and recovery currently lacks a visible product control.issue-rating: 🦐 gold shrimp: Current issue advisory state selects this label.clawsweeper:needs-info: Current issue advisory state selects this label.clawsweeper:no-new-fix-pr: Current issue advisory state selects this label.clawsweeper:needs-security-review: Current issue advisory state selects this label.Label justifications:
P0: The report says every Telegram reply becomes an unusable wall of internal metadata, with no in-product recovery path described.impact:ux-release-blocker: A normal Telegram user cannot continue the conversation once every reply is dominated by internal context, and recovery currently lacks a visible product control.impact:session-state: The internal context is reportedly re-injected and grows on each turn, indicating transcript or runtime-context state is feeding back into later turns.impact:security: Conversation history, identifiers, and session tool details are reportedly exposed in a user-visible channel message.Evidence reviewed
Security concerns:
The reported wrapper contains conversation history, identifiers, and tool-call details that are intended to remain internal; a live trace should establish whether any data can reach unintended channel participants.
Confidence: 0.78
What I checked:
src/agents/internal-runtime-context.ts:1317, 957cc81175a3)src/agents/pi-embedded-helpers/sanitize-user-facing-text.ts:1789, 957cc81175a3)extensions/telegram/src, 957cc81175a3)extensions/discord/src/monitor/message-text.ts, 957cc81175a3)src/infra/outbound/payloads.ts, c476409)Likely related people:
src/infra/outbound/payloads.ts,src/infra/outbound/deliver.ts)src/agents/pi-embedded-runner/run/runtime-context-prompt.ts,src/agents/internal-runtime-context.ts)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.steipete commentedon Jul 29, 2026
Thanks for the concrete Telegram reproduction. This is fixed on main by PR #115561, #115561, landed as f849080. The fix is in the shared outbound delivery owner, before a channel adapter receives the assistant payload, so a complete inline internal runtime-context block is removed for every channel rather than adding a Telegram-only workaround. Standalone canonical context handling, ordinary user text that mentions a single marker, escaped nested metadata, and extra closing-marker collisions remain protected. Before-fix reproduction is https://github.com/openclaw/openclaw/actions/runs/30420240724. Exact-head proof is 238 passing real outbound-adapter, delivery queue, channel contract, sanitizer, and runtime-context tests in https://github.com/openclaw/openclaw/actions/runs/30422340930; full changed-gate evidence is https://github.com/openclaw/openclaw/actions/runs/30421706284 and exact-head GitHub CI is https://github.com/openclaw/openclaw/actions/runs/30422727996. Closing as fixed on main alongside #113754. If a tagged release containing this commit still displays a complete runtime-context block in a Telegram reply, please open a new report with the exact release, redacted output, and delivery route.