Skip to content

fix(telegram): avoid routine reply quoting - #71839

Closed
Zozi96 wants to merge 2 commits into
openclaw:mainfrom
Zozi96:fix/telegram-reply-quote-directive
Closed

Zozi96 wants to merge 2 commits into
openclaw:mainfrom
Zozi96:fix/telegram-reply-quote-directive

Conversation

@Zozi96

@Zozi96 Zozi96 commented Apr 25, 2026

Copy link
Copy Markdown

Summary

Stops Telegram draft previews and default assistant guidance from causing routine replies to quote the triggering message. This keeps native Telegram quoting available when explicitly useful, without making the first streamed paragraph appear as an automatic reply.

Changes

  • Removed automatic replyToMessageId from Telegram draft stream creation.
  • Updated assistant output directive guidance to avoid routine [[reply_to_current]] usage.
  • Added coverage that Telegram draft streams do not receive an implicit reply target.
  • Updated prompt guidance test expectations.

Testing

  • node scripts/run-vitest.mjs run --config test/vitest/vitest.extension-telegram.config.ts extensions/telegram/src/bot-message-dispatch.test.ts — 98 tests passed.
  • node --import tsx -e "...buildAgentSystemPrompt checks..." — prompt guidance OK.

@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@openclaw-barnacle openclaw-barnacle Bot added channel: telegram Channel integration: telegram agents Agent runtime and tooling size: XS labels Apr 25, 2026
@greptile-apps

greptile-apps Bot commented Apr 26, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR removes the automatic replyToMessageId from Telegram draft stream creation and softens the system prompt guidance around [[reply_to_current]] — from "Prefer" to "use only when it materially improves context." Both the dispatch logic change and the system prompt update are accompanied by matching test updates. The changes are minimal, focused, and straightforward.

Confidence Score: 5/5

Safe to merge — the change is small, well-tested, and removes unintended behavior without breaking existing reply functionality.

No logic errors, security issues, or missing side-effects detected. The removed variable (draftReplyToMessageId) had exactly one use site and is now cleanly absent. replyToMode is still passed to deliverReplies at line 582 so it is not orphaned. Tests cover both the absence of replyToMessageId in the draft stream call and the updated prompt text.

No files require special attention.

Reviews (1): Last reviewed commit: "fix(telegram): avoid routine reply quoti..." | Re-trigger Greptile

@Zozi96
Zozi96 force-pushed the fix/telegram-reply-quote-directive branch 3 times, most recently from 3774867 to d03780f Compare April 26, 2026 00:38
@clawsweeper

clawsweeper Bot commented Apr 26, 2026 •

Copy link
Copy Markdown
Contributor

Thanks for the context here. I swept through the related work, and this is now duplicate or superseded.

Keep open, but this PR is not merge-ready: it removes configured Telegram draft reply anchors broadly, while current main preserves those anchors and already has a narrower merged bot-quote fix for the closest related edge case.

Canonical path: Close this stale PR. The latest review rated it F, the branch still lacks merge-ready proof, and there has been no human follow-up after the durable review.

So I’m closing this here because the remaining work is already tracked in the canonical issue.

Review details

Best possible solution:

Close this stale PR. The latest review rated it F, the branch still lacks merge-ready proof, and there has been no human follow-up after the durable review.

Do we have a high-confidence way to reproduce the issue?

Yes at source level: current main still passes draftReplyToMessageId to Telegram draft streams when replyToMode is enabled, and the PR head removes that call-site property. I did not run a live Telegram repro in this read-only review.

Is this the best way to solve the issue?

No. The diff removes configured draft anchors broadly; the safer solution is to preserve replyToMode semantics and use the existing replyToMode: off path or a narrower prompt/docs change for routine reply guidance.

Security review:

Security review cleared: The diff touches Telegram dispatch logic, prompt text, and QA mock tests only; it does not change credentials, dependencies, workflows, lockfiles, packaging, or secret handling.

AGENTS.md: found and applied where relevant.

What I checked:

  • stale F-rated PR: PR was opened 2026-04-25T23:59:38Z, is older than 60 days, and the latest review rated it F.
  • proof blocker: real behavior proof is mock_only and proof tier is F, so this branch is not merge-ready without contributor follow-up.
  • no human follow-up: live comments and timeline hydrated by apply contain no non-automation activity after the ClawSweeper review.

Likely related people:

  • steipete: Peter Steinberger authored the commit that introduced reply tags and replyToMode prompt guidance, and later added selected-quote tool-progress warnings around this same behavior surface. (role: introduced reply-tag/replyToMode behavior; confidence: high; commits: 2c92ccd66e80, e2c8db2cad40; files: src/agents/system-prompt.ts, docs/channels/telegram.md, extensions/telegram/src/doctor.ts)
  • moeedahmed: Moeed Ahmed authored the merged bot-reply anchoring fix in fix(telegram): keep bot reply answers anchored to current message #90475, which changed the same draftReplyToMessageId decision surface more narrowly. (role: recent related-fix contributor; confidence: high; commits: 5cafe4b0cf71; files: extensions/telegram/src/bot-message-dispatch.ts, extensions/telegram/src/bot-message-dispatch.test.ts)
  • vincentkoc: Recent git history shows multiple Telegram dispatch and test changes in this file family, including streaming and reply-mode adjacent work. (role: recent Telegram dispatch contributor; confidence: medium; commits: 4954d025e21e, 334085fbe98a; files: extensions/telegram/src/bot-message-dispatch.ts, extensions/telegram/src/bot-message-dispatch.test.ts)
  • rubencu: Recent merged work changed Telegram stale reply delivery and transient preview behavior adjacent to the streaming preview lifecycle affected here. (role: adjacent Telegram streaming contributor; confidence: medium; commits: 996eb9a024d0, c65f356ddc95; files: extensions/telegram/src/bot-message-dispatch.ts, extensions/telegram/src/draft-stream.ts)

Codex review notes: model internal, reasoning high; reviewed against 69af58ba2613.

@Zozi96
Zozi96 force-pushed the fix/telegram-reply-quote-directive branch 5 times, most recently from 5862701 to 14ba4a1 Compare April 27, 2026 23:43
@Zozi96
Zozi96 force-pushed the fix/telegram-reply-quote-directive branch from 14ba4a1 to 4846566 Compare April 28, 2026 21:10
@clawsweeper clawsweeper Bot added the mantis: telegram-visible-proof Mantis should capture Telegram visible proof. label May 12, 2026
@openclaw-barnacle openclaw-barnacle Bot added the triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. label May 12, 2026
@clawsweeper clawsweeper Bot added mantis: telegram-visible-proof Mantis should capture Telegram visible proof. and removed mantis: telegram-visible-proof Mantis should capture Telegram visible proof. labels May 12, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. labels May 20, 2026
@clawsweeper

clawsweeper Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper PR egg

🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat.

Where did the egg go?
  • The egg game starts only after the PR passes the real-behavior proof check.
  • Before that, no creature or rarity is rolled. The treat waits for real proof.
  • This is still just collectible flavor: proof affects review readiness, not creature quality.

@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Jun 14, 2026
@clawsweeper clawsweeper Bot removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. mantis: telegram-visible-proof Mantis should capture Telegram visible proof. labels Jun 20, 2026
@openclaw-barnacle openclaw-barnacle Bot added the triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. label Jun 20, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. mantis: telegram-visible-proof Mantis should capture Telegram visible proof. labels Jun 20, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the stale Marked as stale due to inactivity label Jun 20, 2026
@clawsweeper

clawsweeper Bot commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper applied the proposed close for this PR.

@clawsweeper clawsweeper Bot closed this Jun 28, 2026

This branch had an error being deployed

1 failed deployment
qa-live-shared — 48465665 Deployed Jun 20, 2026 by clawsweeper[bot] via Run agentic native Telegram proof #206215
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling channel: telegram Channel integration: telegram extensions: qa-lab mantis: telegram-visible-proof Mantis should capture Telegram visible proof. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant