refactor(dispatch): gate reasoning delivery on a channel capability (follow-up to #95051)#95380
Conversation
…bility Replace the hardcoded `deliveryChannel !== "telegram"` reasoning-suppression check with a `reasoningPayloads` channel capability, resolved via the existing process-stable channel registry (mirrors resolveChannelTtsVoiceDelivery). New reasoning-lane channels opt in by declaring the capability instead of being named in core dispatch. Telegram declares it; generic channels (WhatsApp/web) stay suppressed. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
Codex review: found issues before merge. Reviewed June 21, 2026, 1:43 PM ET / 17:43 UTC. Summary PR surface: Source +31, Tests +57. Total +88 across 6 files. Reproducibility: yes. The linked Telegram bug is source-reproducible because current main suppresses Review metrics: 1 noteworthy metric.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Fold the capability gate into #95051 only after the capability contract is documented or explicitly maintainer-approved and Telegram proof is retained on the final branch. Do we have a high-confidence way to reproduce the issue? Yes. The linked Telegram bug is source-reproducible because current main suppresses Is this the best way to solve the issue? No, not yet as a merge-ready PR. The capability gate is a cleaner owner boundary than a hardcoded Telegram check, but the public plugin API contract needs maintainer approval or documentation before this is the best final shape. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against eea777c9fc9c. Label changesLabel justifications:
Evidence reviewedPR surface: Source +31, Tests +57. Total +88 across 6 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
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
|
|
Live Telegram proof that this capability-gate refactor is behaviour-preserving. This PR replaces the hardcoded Captured on prod, deepseek These are the same stills posted on the base PR (#95051, issuecomment-4759234640) — output is identical with the capability gate in place. cc @Peetiegonzalez |
|
Closing — superseded by #97875, which lands the canonical |


Small follow-up on top of this PR's branch (
qa-sre-telegram-reasoning-delivery-20260619) — feel free to squash/cherry-pick into #95051 or ignore.Summary
#95051 gates reasoning-payload suppression on
deliveryChannel !== "telegram". This swaps that hardcoded channel name for a declaredreasoningPayloadschannel capability, mirroring the existingresolveChannelTtsVoiceDeliveryprecedent (getChannelPlugin(id)?.capabilities.tts?.voice). Channels with a reasoning lane opt in by declaring the capability instead of being named in core dispatch, so the next reasoning-capable channel (Slack, Matrix, …) needs no core edit.ChannelCapabilitiesgainsreasoningPayloads?: boolean(next toblockStreaming).channelSupportsReasoningPayloads()resolver — usesgetLoadedChannelPlugin(loaded-only, no bundled cold-load) since it runs on every dispatch; fails closed for unloaded/unknown channels.reasoningPayloads: true; the suppression gate becomes!channelSupportsReasoningPayloads(deliveryChannel).Behaviour-preserving: Telegram still delivers durable reasoning, generic channels (WhatsApp/web) still suppress — the existing dispatch tests assert both, unchanged.
Verification
node scripts/run-tsgo.mjs -p tsconfig.core.json→ 0vitest run dispatch-from-config.test.ts -t "isReasoning"+ the newreasoning-capabilities.test.ts→ green (telegram delivers via capability; generic suppressed)getLoadedChannelPluginchoice avoids a hot-path cold-load).AI assistance
Prepared with AI assistance (Claude). Behaviour verified locally on OpenClaw 2026.6.9-beta.1.
cc @Peetiegonzalez