fix/telegram-context-controls#83633
Conversation
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Close as superseded: the Telegram DM duplicate-context problem is real, but a newer clean, proof-positive PR now tracks the narrower default-behavior fix while this branch is conflicted and adds broader public config semantics. Canonical path: Follow #89855 for the default duplicate-DM context fix, and open a fresh product-approved config PR only if maintainers still want public Telegram context controls afterward. So I’m closing this here and keeping the remaining discussion on #89855 and #87566. Review detailsBest possible solution: Follow #89855 for the default duplicate-DM context fix, and open a fresh product-approved config PR only if maintainers still want public Telegram context controls afterward. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection shows current main and v2026.6.6 still build Telegram chat-window context with recentLimit: 10, and the PR screenshots show the before/after prompt-content behavior for the opt-out path. Is this the best way to solve the issue? No, this branch is no longer the best landing path. The newer clean PR fixes the default persistent-DM duplication at the session-aware boundary without adding public config keys, while this PR is conflicted and broader than needed. Security review: Security review cleared: No concrete security or supply-chain regression was found; the relevant concern is the intentional prompt-data exposure boundary, handled as merge risk. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against f1b8827d20c8. |
|
Small correction: I used the wrong config option name in the PR description. The correct option is:
I updated the PR description to match the actual implementation. |
Mantis Telegram Desktop ProofSummary: Mantis did not generate before/after GIFs because this PR does not have a clean Telegram-visible before/after proof in the standard Mantis run.
|
|
Addressed the default-contract mismatch in docs. The runtime behavior was already preserving compatibility:
This follow-up only corrects the documented default to match runtime behavior. Validation:
|
|
Security boundary note: This PR does not add new permissions, network calls, token handling, or command/tool execution surface. The only data-access behavior changed is that Telegram DM context injection can now be reduced or disabled by config. Defaults preserve the previous behavior. |
|
ClawSweeper PR egg ✨ Hatched: 🥚 common Mossy Patch Peep Hatch commandComment Hatchability rules:
Rarity: 🥚 common. What is this egg doing here?
|
|
ClawSweeper applied the proposed close for this PR.
|
Summary
Conversation Contextblock was injected without a config-level control.Conversation Contextinjection.Conversation Contextinjection remains enabled.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Real behavior proof (required for external PRs)
External contributors must show after-fix evidence from a real OpenClaw setup. Unit tests, mocks, lint, typechecks, snapshots, and CI are supplemental only. Screenshots are encouraged even for CLI, console, text, or log changes; terminal screenshots and copied live output count. Be mindful of private information like IP addresses, API keys, phone numbers, non-public endpoints, or other private details when providing evidence.
Behavior or issue addressed:
Conversation Contextblock into the current agent input.Conversation Contextblock.Real environment tested:
channels.telegram.dmRecentLimit: 0channels.telegram.conversationContext: falseExact steps or command run after this patch:
channels.telegram.dmRecentLimitto0.channels.telegram.conversationContexttofalse.Evidence after fix (screenshot, recording, terminal capture, console output, redacted runtime log, linked artifact, or copied live output):
Observed result after fix:
Conversation Contextblock was not injected.What was not tested:
Before evidence (optional but encouraged):
Root Cause (if applicable)
For bug fixes or regressions, explain why this happened, not just what changed. Otherwise write
N/A. If the cause is unclear, writeUnknown.Root cause:
Conversation Contextblock.Missing detection / guardrail:
Contributing context (if known):
Regression Test Plan (if applicable)
For bug fixes or regressions, name the smallest reliable test coverage that should catch this. Otherwise write
N/A.Coverage level that should have caught this:
Target test or file:
Scenario the test should lock in:
channels.telegram.dmRecentLimit: 0disables Telegram DM history injection.channels.telegram.conversationContext: falsedisablesConversation Contextinjection.Why this is the smallest reliable guardrail:
Existing test that already covers this (if any):
If no new test is added, why not:
User-visible / Behavior Changes
Existing defaults are unchanged.
New Telegram config options allow operators to:
channels.telegram.dmRecentLimitConversation Contextinjection withchannels.telegram.conversationContext: falseNo migration is required. Existing deployments keep the same behavior unless the new config options are explicitly set.
Diagram (if applicable)
Security Impact (required)
Yes/No): NoYes/No): NoYes/No): NoYes/No): NoYes/No): YesYes, explain risk + mitigation:channels.telegram.dmRecentLimit.Conversation Contextblock withchannels.telegram.conversationContext: false.Repro + Verification
Environment
channels.telegram.dmRecentLimit: 0channels.telegram.conversationContext: falseSteps
channels.telegram.dmRecentLimitto0.channels.telegram.conversationContexttofalse.Expected
channels.telegram.dmRecentLimit: 0.Conversation Contextblock whenchannels.telegram.conversationContext: false.Actual
channels.telegram.dmRecentLimit: 0, Telegram DM history was not injected.channels.telegram.conversationContext: false, theConversation Contextblock was not injected.Evidence
Attach at least one:
Human Verification (required)
What you personally verified (not just CI), and how:
Verified scenarios:
channels.telegram.dmRecentLimit: 0disables Telegram DM history injection.channels.telegram.conversationContext: falsedisables theConversation Contextblock.Edge cases checked:
channels.telegram.dmRecentLimit: 0disables Telegram DM history injection.channels.telegram.conversationContext: falsedisables theConversation Contextblock.What you did not verify:
Review Conversations
If a bot review conversation is addressed by this PR, resolve that conversation yourself. Do not leave bot review conversation cleanup for maintainers.
Compatibility / Migration
Yes/No): YesYes/No): YesYes/No): NoConversation Contextinjection remains enabled.Risks and Mitigations
Risk:
Risk:
Conversation Contextinjection may reduce continuity for some Telegram DM conversations.AI Assistance Disclosure
AI-assisted: Used Codex for implementation assistance and ChatGPT for PR wording/review planning. I manually reviewed the code, built OpenClaw locally, and verified the behavior in a real Telegram DM setup.