Skip to content

fix(telegram): deliver durable reasoning when enabled#97875

Merged
fuller-stack-dev merged 4 commits into
mainfrom
codex/reasoning-lane-capability
Jun 30, 2026
Merged

fix(telegram): deliver durable reasoning when enabled#97875
fuller-stack-dev merged 4 commits into
mainfrom
codex/reasoning-lane-capability

Conversation

@fuller-stack-dev

Copy link
Copy Markdown
Member

Related: #94937
Related: #95051
Related: #96106

What Problem This Solves

Fixes an issue where Telegram users with reasoning enabled could lose durable reasoning replies when an agent emitted them as reasoning block or final payloads. The shared reply dispatcher suppressed those payloads before Telegram's reasoning lane could render them.

Why This Change Was Made

This adds an explicit shared reasoningPayloadsEnabled opt-in for channels that own a separate reasoning lane. Telegram enables that opt-in only when its resolved reasoning level is not off; generic channels keep the historical suppression, and shared TTS no longer synthesizes reasoning payloads.

User Impact

Telegram can show durable reasoning in the reasoning lane when users have reasoning enabled, without exposing hidden reasoning when the lane is off. Other channels keep their previous behavior unless they deliberately opt into the shared reasoning payload path.

Evidence

  • node scripts/run-vitest.mjs src/auto-reply/reply/dispatch-from-config.test.ts extensions/telegram/src/bot-message-dispatch.test.ts
  • git diff --check
  • .agents/skills/autoreview/scripts/autoreview --mode local --base upstream/main -> clean: no accepted/actionable findings reported

AI-assisted with Codex.

@clawsweeper

clawsweeper Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed June 29, 2026, 8:30 PM ET / 00:30 UTC.

Summary
The PR adds a reasoningPayloadsEnabled reply option, enables it from Telegram when a durable or separate reasoning lane is active, preserves reasoning through Telegram normalization, skips TTS for reasoning payloads, and adds regression tests.

PR surface: Source +21, Tests +194. Total +215 across 5 files.

Reproducibility: yes. from source inspection: current main suppresses isReasoning block and final payloads before Telegram durable delivery, while the linked issue reports exactly that /reasoning on drops persisted thinking. I did not run a live /reasoning on reproduction in this read-only pass.

Review metrics: 1 noteworthy metric.

  • Reply Option Surface: 1 added. reasoningPayloadsEnabled is exported through GetReplyOptions, so maintainers should notice the new plugin-facing dispatch opt-in before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #94937
Summary: This PR is a candidate fix for the canonical Telegram /reasoning on durable reasoning message-loss issue, with several older overlapping PRs still open.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🌊 off-meta tidepool
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P2] Decide whether to require focused /reasoning on Telegram proof before merge.

Mantis proof suggestion
A focused live Telegram run would prove the exact /reasoning on durable reasoning path rather than only generic smoke scenarios. A maintainer can ask Mantis to capture proof by posting this exact PR comment:

@openclaw-mantis telegram live: verify `/reasoning on` with a reasoning model delivers durable thinking in Telegram and `/reasoning off` suppresses it.

Risk before merge

  • [P1] reasoningPayloadsEnabled is an additive exported reply option, so maintainers should accept it as the channel-owned durable reasoning contract rather than letting it become an accidental plugin-facing seam.
  • [P1] The diff changes when reasoning payloads are suppressed or delivered through shared dispatch and Telegram normalization, so a mistake could hide or expose Telegram reasoning messages.
  • [P1] The available Mantis artifact proves generic Telegram live scenarios, not the exact /reasoning on durable reasoning path changed by this PR.

Maintainer options:

  1. Accept the channel-owned reply option
    Maintainers can treat reasoningPayloadsEnabled as the explicit dispatch contract for channels with separate reasoning lanes and land the patch with the current regression tests.
  2. Request exact Telegram reasoning proof
    Before merge, ask Mantis or a maintainer live run to show /reasoning on delivering durable thinking and /reasoning off suppressing it.
  3. Pause for a different contract
    If maintainers do not want a new exported reply option, pause this PR and redesign the opt-in as a narrower internal channel capability before landing any sibling fix.

Next step before merge

  • [P2] The remaining action is maintainer review of the additive reply-option seam and desired Telegram proof depth, not a narrow automated repair.

Security
Cleared: The diff changes TypeScript reply-dispatch logic and tests only; it does not alter dependencies, workflows, secrets handling, install scripts, package metadata, or other supply-chain surfaces.

Review details

Best possible solution:

Land this as the canonical Telegram durable-reasoning fix after maintainers accept the explicit reply-option opt-in and decide whether the existing generic live Telegram proof is enough or a focused /reasoning on proof is required.

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

Yes from source inspection: current main suppresses isReasoning block and final payloads before Telegram durable delivery, while the linked issue reports exactly that /reasoning on drops persisted thinking. I did not run a live /reasoning on reproduction in this read-only pass.

Is this the best way to solve the issue?

Yes, this appears to be the best bounded fix shape: it uses a channel-owned opt-in instead of a Telegram-name allowlist, preserves generic-channel suppression, strips the marker only before outbound normalization, and avoids synthesizing reasoning into TTS. The safer alternative is only needed if maintainers reject the new exported reply option and want a different internal capability contract.

AGENTS.md: found and applied where relevant.

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

Label changes

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P2: The PR targets a bounded Telegram reasoning message-delivery bug with limited blast radius and no crash, security, or whole-runtime outage signal.
  • merge-risk: 🚨 compatibility: The diff adds a new exported GetReplyOptions field that channel/plugin dispatch callers could observe or depend on.
  • merge-risk: 🚨 message-delivery: The diff changes shared dispatch and Telegram normalization behavior for reasoning payload delivery and suppression.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The external-contributor proof gate does not apply because this is a maintainer-team PR; separately, the inspected Mantis artifact is useful generic Telegram smoke proof but not exact durable-reasoning proof.
  • mantis: telegram-visible-proof: Mantis should capture Telegram visible proof. The PR changes visible Telegram reasoning delivery and can be demonstrated with a short Telegram proof.
Evidence reviewed

PR surface:

Source +21, Tests +194. Total +215 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 3 52 31 +21
Tests 2 194 0 +194
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 246 31 +215

What I checked:

Likely related people:

  • vincentkoc: Recent main history touches reply option contracts, Telegram reasoning preview gates, and Telegram dispatch seams, and this handle also owns an overlapping maintainer-labeled candidate PR for the same durable reasoning issue. (role: recent central dispatch and Telegram reasoning contributor; confidence: high; commits: 337fa8c956e9, 4954d025e21e, 5369ea53bee3; files: src/auto-reply/reply/dispatch-from-config.ts, src/auto-reply/get-reply-options.types.ts, extensions/telegram/src/bot-message-dispatch.ts)
  • Peter Steinberger: Shortlog and recent commits show the largest contribution volume across the shared reply dispatch, Telegram dispatch, and outbound paths, including shared suppression and routed reply refactors. (role: dominant adjacent owner; confidence: high; commits: 5c6b2cbc8eb5, d46d0d070a9c, aac84372abd5; files: src/auto-reply/reply/dispatch-from-config.ts, extensions/telegram/src/bot-message-dispatch.ts, src/infra/outbound/payloads.ts)
  • obviyus: Recent Telegram dispatch commits by Ayaan Zaidi touch visible Telegram delivery and dispatcher seams adjacent to the reasoning lane behavior. (role: recent Telegram dispatcher contributor; confidence: medium; commits: dc3b10285db8, 5aad79571ee6, b85d97f22ccc; files: extensions/telegram/src/bot-message-dispatch.ts)
  • joshavant: The shared outbound payload normalization plan that suppresses marked reasoning payloads appears to originate in this author’s current-main commit. (role: outbound planner owner; confidence: medium; commits: c4764095f859; files: src/infra/outbound/payloads.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. mantis: telegram-visible-proof Mantis should capture Telegram visible proof. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. labels Jun 29, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jun 29, 2026
@openclaw-mantis

Copy link
Copy Markdown
Contributor

Mantis Telegram Live QA

Summary: Mantis ran the Telegram live QA lane with Convex-leased credentials, rendered a redacted transcript in a Crabbox desktop browser, and captured screenshot/video evidence for PR review.

Telegram live transcript

Rendered Telegram live transcript in a Crabbox desktop browser

Telegram motion preview

Animated Telegram live transcript capture

Motion-trimmed clips:

Full videos:

Raw QA files: https://artifacts.openclaw.ai/mantis/telegram-live/pr-97875/run-28388139095-1/index.json

@fuller-stack-dev fuller-stack-dev self-assigned this Jun 29, 2026
@fuller-stack-dev
fuller-stack-dev force-pushed the codex/reasoning-lane-capability branch from c2399f6 to f62e70e Compare June 30, 2026 00:08
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. label Jun 30, 2026
@fuller-stack-dev
fuller-stack-dev force-pushed the codex/reasoning-lane-capability branch from f62e70e to d3befea Compare June 30, 2026 00:19
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jun 30, 2026
@clawsweeper clawsweeper Bot added the status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. label Jun 30, 2026
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Land-ready maintainer proof for head d3befea689bf6cea460e69da4366b69eff064864.

What changed after review:

  • Kept shared reasoning payload suppression as the default.
  • Let Telegram opt into durable reasoning payloads only when it has a deliverable reasoning lane: persistent /reasoning on or a separate reasoning draft stream.
  • Preserved progress-stream behavior so inline thinking previews do not cause reasoning-only finals to be counted as delivered when Telegram will drop them.
  • Added Telegram regression coverage for separate reasoning stream delivery, persistent durable delivery, progress-mode suppression, and marker stripping before durable delivery.

Local proof:

  • node scripts/run-vitest.mjs src/auto-reply/reply/dispatch-from-config.test.ts extensions/telegram/src/bot-message-dispatch.test.ts
  • git diff --check upstream/main...HEAD
  • .agents/skills/autoreview/scripts/autoreview --mode branch --base upstream/main --stream-engine-output -> clean, no accepted/actionable findings
  • .agents/skills/autoreview/scripts/autoreview --mode local --stream-engine-output for the final test assertion adjustment -> clean

CI / remote proof:

  • CI run 28411526182 is green for this head, including QA Smoke CI, check-test-types, check-lint, compact shards, build, shrinkwrap, and boundary checks.
  • Latest Real behavior proof run 28411676681 passed for this head.
  • CodeQL / Critical Quality selected channel and agent shards passed or skipped by selection as expected.

Known caveat:

  • I did not rerun a manual Rosita chat after the final test-only assertion fix; earlier Rosita/Mantis work covered the visible Telegram stream path, and this exact head has unit coverage plus CI proof for the durable routing path.

@fuller-stack-dev
fuller-stack-dev merged commit 455f813 into main Jun 30, 2026
115 of 119 checks passed
@fuller-stack-dev
fuller-stack-dev deleted the codex/reasoning-lane-capability branch June 30, 2026 00:31
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Jun 30, 2026
Marvinthebored pushed a commit to Marvinthebored/openclaw that referenced this pull request Jun 30, 2026
… payloads

Mirror json's reasoningPayloadsEnabled seam (openclaw#97875) for the 💬 commentary
lane: add GetReplyOptions.commentaryPayloadsEnabled and an isCommentary payload
tag next to isReasoning across the payload types; default-suppress isCommentary
in dispatch-from-config (block stream + final loops) unless the channel opts in;
exclude commentary from TTS exactly like reasoning; thread the tag through the
block-reply coalescer, reply-delivery direct-lane, and realtime consult so it
cannot be dropped mid-pipeline. Discord opts in when its commentary lane is
active. No durable producer is wired yet (preserves the obviyus-approved 3-part
Anthropic withhold invariant; handlers.messages.ts unchanged).

Also regenerates docs/.generated/config-baseline.sha256 and bumps the plugin-SDK
surface budgets to actual post-openclaw#97875-rebase values.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jun 30, 2026
Preserve shared reasoning suppression by default while letting Telegram opt into durable reasoning payloads only when it has a deliverable reasoning lane. Covers persistent /reasoning on, separate reasoning stream lanes, and progress-stream suppression.\n\nVerification:\n- node scripts/run-vitest.mjs src/auto-reply/reply/dispatch-from-config.test.ts extensions/telegram/src/bot-message-dispatch.test.ts\n- git diff --check upstream/main...HEAD\n- .agents/skills/autoreview/scripts/autoreview --mode branch --base upstream/main --stream-engine-output\n- CI run 28411526182 green, including QA Smoke CI and check-test-types\n- Real behavior proof run 28411676681 passed\n\nPR: openclaw#97875
obviyus pushed a commit to Marvinthebored/openclaw that referenced this pull request Jun 30, 2026
… payloads

Mirror json's reasoningPayloadsEnabled seam (openclaw#97875) for the 💬 commentary
lane: add GetReplyOptions.commentaryPayloadsEnabled and an isCommentary payload
tag next to isReasoning across the payload types; default-suppress isCommentary
in dispatch-from-config (block stream + final loops) unless the channel opts in;
exclude commentary from TTS exactly like reasoning; thread the tag through the
block-reply coalescer, reply-delivery direct-lane, and realtime consult so it
cannot be dropped mid-pipeline. Discord opts in when its commentary lane is
active. No durable producer is wired yet (preserves the obviyus-approved 3-part
Anthropic withhold invariant; handlers.messages.ts unchanged).

Also regenerates docs/.generated/config-baseline.sha256 and bumps the plugin-SDK
surface budgets to actual post-openclaw#97875-rebase values.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
QiuYuang pushed a commit to QiuYuang/openclaw that referenced this pull request Jul 1, 2026
Preserve shared reasoning suppression by default while letting Telegram opt into durable reasoning payloads only when it has a deliverable reasoning lane. Covers persistent /reasoning on, separate reasoning stream lanes, and progress-stream suppression.\n\nVerification:\n- node scripts/run-vitest.mjs src/auto-reply/reply/dispatch-from-config.test.ts extensions/telegram/src/bot-message-dispatch.test.ts\n- git diff --check upstream/main...HEAD\n- .agents/skills/autoreview/scripts/autoreview --mode branch --base upstream/main --stream-engine-output\n- CI run 28411526182 green, including QA Smoke CI and check-test-types\n- Real behavior proof run 28411676681 passed\n\nPR: openclaw#97875
chenyangjun-xy pushed a commit to chenyangjun-xy/openclaw that referenced this pull request Jul 1, 2026
Preserve shared reasoning suppression by default while letting Telegram opt into durable reasoning payloads only when it has a deliverable reasoning lane. Covers persistent /reasoning on, separate reasoning stream lanes, and progress-stream suppression.\n\nVerification:\n- node scripts/run-vitest.mjs src/auto-reply/reply/dispatch-from-config.test.ts extensions/telegram/src/bot-message-dispatch.test.ts\n- git diff --check upstream/main...HEAD\n- .agents/skills/autoreview/scripts/autoreview --mode branch --base upstream/main --stream-engine-output\n- CI run 28411526182 green, including QA Smoke CI and check-test-types\n- Real behavior proof run 28411676681 passed\n\nPR: openclaw#97875
chenyangjun-xy pushed a commit to chenyangjun-xy/openclaw that referenced this pull request Jul 3, 2026
Preserve shared reasoning suppression by default while letting Telegram opt into durable reasoning payloads only when it has a deliverable reasoning lane. Covers persistent /reasoning on, separate reasoning stream lanes, and progress-stream suppression.\n\nVerification:\n- node scripts/run-vitest.mjs src/auto-reply/reply/dispatch-from-config.test.ts extensions/telegram/src/bot-message-dispatch.test.ts\n- git diff --check upstream/main...HEAD\n- .agents/skills/autoreview/scripts/autoreview --mode branch --base upstream/main --stream-engine-output\n- CI run 28411526182 green, including QA Smoke CI and check-test-types\n- Real behavior proof run 28411676681 passed\n\nPR: openclaw#97875
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: telegram Channel integration: telegram maintainer Maintainer-authored PR 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: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant