Skip to content

fix(channels): surface Discord voice failures and preserve Telegram controls - #125152

Merged
steipete merged 3 commits into
mainfrom
steipete/discord-voice-and-telegram-button-drops-206165
Aug 17, 2026
Merged

steipete merged 3 commits into
mainfrom
steipete/discord-voice-and-telegram-button-drops-206165

Conversation

@steipete

@steipete steipete commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes two channel adapter paths that could silently discard the real outcome of a user-visible action. Discord voice delivery could fall back to text or an already-delivered transcript while losing the original voice error, and Telegram rich streamed replies could finalize without Web App buttons or any readable trace of controls Telegram could not encode.

Why This Change Was Made

Discord now records absorbed non-ambiguous voice failures at the catch boundary, mirroring the existing webhook fallback visibility rule. Telegram derives Web App eligibility from the target chat, shares one dropped-control text renderer between message actions and reply finalization, and carries one canonical buffered payload so the visible fallback cannot diverge from the finalized text.

ClawSweeper identified the optional raw-slash callback cleanup as shipped compatibility risk, so that change was removed. Existing value-only slash callbacks retain their legacy behavior; this PR now changes only Discord failure visibility and Telegram streamed-control preservation/degradation.

The PR also repairs a pre-existing main CI ratchet regression: compile-time version-define removal lowered the distinct OPENCLAW_* budget even though the supported runtime OPENCLAW_VERSION override remained. The baseline now matches the actual 502-name surface and the one-time correction is covered alongside the existing owner-approved growth case.

User Impact

Operators can diagnose Discord voice degradation even when text still reaches the user. Telegram DM Web App buttons survive streamed finalization, and unsupported or oversized controls appear as readable fallback text instead of disappearing. Existing Telegram slash-looking callback values remain compatible.

Evidence

  • Regression-first proof: the new assertions failed on the pre-fix baseline because Discord emitted no warning and Telegram omitted the Web App button and dropped-control fallback.
  • Focused tests: node scripts/run-vitest.mjs extensions/discord/src/outbound-adapter.test.ts extensions/telegram/src/bot-message-dispatch.draft-finalization.test.ts extensions/telegram/src/bot.create-telegram-bot.test.ts extensions/telegram/src/action-runtime.test.ts extensions/telegram/src/button-types.test.ts — 351 tests passed locally and again on Blacksmith Testbox.
  • CI-ratchet tests: node scripts/run-vitest.mjs test/scripts/check-env-var-count.test.ts — 12 tests passed; the real counter reports OPENCLAW_* count 502/502.
  • Local formatting/whitespace: changed-file oxfmt --check and git diff --check passed.
  • Original Blacksmith Testbox tbx_01m079h466bhx886bydwjgjg4b: changed extension gates passed, including typecheck, lint, plugin boundaries, dead exports, and import cycles.
  • Mock gateway/channel proof on that Testbox: channel-message-flows with providerMode=mock-openai and channelDriver=qa-channel passed 1/1. Verdict: {"total":1,"passed":1,"failed":0,"skipped":0}.
  • Final focused Testbox tbx_01m07d17jcde9kz6j999kcejk6 / run 32010060843: 351/351 channel tests passed.
  • Final changed-gate Testbox tbx_01m07dm120rqqqejfqghy4zjsg / run 32010870166: all selected ratchets, formatting, boundaries, dead exports, production/test/script types, extension/scripts lint, database-first, and import-cycle checks passed.
  • Autoreview: original channel patch clean at 0.98; compatibility revert and CI-ratchet correction both clean at 0.99 with no accepted/actionable findings.

AI-assisted: yes.

@clawsweeper

clawsweeper Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added channel: discord Channel integration: discord channel: telegram Channel integration: telegram labels Aug 17, 2026
@steipete steipete self-assigned this Aug 17, 2026
@openclaw-barnacle openclaw-barnacle Bot added size: M maintainer Maintainer-authored PR labels Aug 17, 2026
@steipete
steipete marked this pull request as ready for review August 17, 2026 07:43
@clawsweeper clawsweeper Bot added mantis: telegram-visible-proof Mantis should capture Telegram visible proof. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. 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 Aug 17, 2026
@clawsweeper

clawsweeper Bot commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 17, 2026, 4:54 AM ET / 08:54 UTC.

ClawSweeper review

What this changes

This PR logs degraded Discord voice sends, preserves or visibly degrades Telegram controls during streamed finalization, and corrects the environment-variable count ratchet.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 4 items remain

Keep open. The patch is a coherent owner-boundary repair with no blocking code finding, but Telegram streaming policy requires real Telegram proof and exact-head CI is still incomplete.

Priority: P1
Reviewed head: 7654ce765919eb2631f0bf6c39f6088c89c48737

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) PR readiness rating was derived from proof quality, review findings, security review, and reviewer confidence.
Proof confidence 🌊 off-meta tidepool Not applicable: Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Real behavior proof is not required for maintainer- or bot-authored pull requests.
Evidence reviewed 6 items Discord failure boundary: Current main catches a non-ambiguous voice failure and can return an unknown result without recording it; the PR logs that absorbed failure at the same owner boundary.
Telegram canonical final payload: The PR resolves controls before both normal and buffered final delivery, retaining the effective payload rather than separately buffering text and buttons.
Sibling delivery invariant: The non-streaming Telegram funnel already derives Web App eligibility from the target chat type, matching the PR's streamed-path decision.
Findings None None.
Security None None.

How this fits together

Discord and Telegram plugins turn agent reply payloads into channel-specific sends. The changed paths handle voice fallback observability and streamed Telegram finalization before users and operators see the resulting message.

flowchart LR
  A[Agent reply payload] --> B[Discord outbound delivery]
  A --> C[Telegram streamed finalization]
  B --> D[Voice send or text fallback]
  C --> E[Control encoding decision]
  D --> F[Operator warning or delivered message]
  E --> G[Telegram button or readable fallback]
Loading

Before merge

  • Resolve merge risk (P1) - Telegram streamed delivery has mock and unit coverage but no real Telegram proof, which the scoped policy requires before landing.
  • Resolve merge risk (P2) - The bug-fix leaves a runtime/tooling net increase of 9 lines; the shared fallback renderer removes duplicate action-runtime code, but the residual growth should be accepted deliberately.
  • Resolve merge risk (P1) - The environment-count change adds a one-time CI ratchet exception and should land only with the stated 502-name source count and exact-head checks confirmed.
  • Complete next step (P2) - Require real Telegram behavior proof and green exact-head checks; this active maintainer-owned PR has no mechanical repair to dispatch.
Agent review details

Security

None.

PR surface

Source +8, Tests +149, Other +1. Total +158 across 11 files.

View PR surface stats
Area Files Added Removed Net
Source 6 66 58 +8
Tests 3 158 9 +149
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 4 3 +1
Total 11 228 70 +158

Review metrics

Metric Value Why it matters
Production versus test delta runtime/tooling +70/-61 (net +9); tests +158/-9 (net +149) The shared fallback renderer replaces duplicate action-runtime logic while adding streamed-delivery coverage.
Environment-count ratchet 1 additional approved transition: 501 to 502 The CI guard now permits the correction for the retained runtime OPENCLAW_VERSION override alongside the existing 502-to-503 exception.

Mantis proof suggestion

Telegram Desktop can directly demonstrate both preserved Web App buttons and readable degradation in the final streamed message. A maintainer can ask Mantis to capture proof by posting this exact PR comment:

@openclaw-mantis telegram desktop proof: verify a streamed DM final keeps its Web App button and renders an unencodable control as readable fallback text.

Merge-risk options

Maintainer options:

  1. Add real Telegram streaming proof (recommended)
    Capture a redacted Telegram Desktop or bot-to-bot run showing a streamed DM Web App button and readable fallback for an unencodable control before merge.
  2. Accept mock-only channel evidence
    A maintainer may explicitly accept the remaining Telegram delivery risk after reviewing the focused tests and qa-channel harness result.

Technical review

Best possible solution:

Keep one shared Telegram dropped-control renderer and the full buffered payload path, then add redacted real Telegram proof and merge only after exact-head checks are green.

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

Yes, source-reproducible: current main absorbs a Discord voice failure without a warning and its streamed Telegram resolver lacks the direct-chat Web App and dropped-control handling added here. The review did not execute the regression tests because this is read-only triage.

Is this the best way to solve the issue?

Yes. The patch reuses the existing Telegram target classification and moves the fallback text renderer to the shared button owner, avoiding a parallel streamed-finalization path.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add merge-risk: 🚨 message-delivery: The changed paths determine whether streamed controls and voice-send failures are visibly represented to users or operators.
  • add merge-risk: 🚨 automation: The PR changes the CI environment-name ratchet and its permitted growth transitions.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🌊 off-meta tidepool and patch quality is 🦞 diamond lobster.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.

Label justifications:

  • P1: The PR repairs silent or lost outcomes in active Discord and Telegram delivery flows.
  • merge-risk: 🚨 compatibility: Telegram control encoding and finalization can alter existing button and callback behavior.
  • merge-risk: 🚨 message-delivery: The changed paths determine whether streamed controls and voice-send failures are visibly represented to users or operators.
  • merge-risk: 🚨 automation: The PR changes the CI environment-name ratchet and its permitted growth transitions.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🌊 off-meta tidepool and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Real behavior proof is not required for maintainer- or bot-authored pull requests.
  • mantis: telegram-visible-proof: Mantis should capture Telegram visible proof. The streamed final message’s Web App button and readable control fallback are directly visible in Telegram Desktop.

Evidence

What I checked:

Likely related people:

  • steipete: Current main history includes the Web App button feature and the recent environment-count baseline work. (role: recent area contributor; confidence: high; commits: 5f8e1dd39968, a3578c77909b; files: extensions/telegram/src/button-types.ts, config/env-var-count-budget.txt, scripts/check-env-var-count.mts)
  • Guoji-XYDT: Authored the prior Telegram degraded-inline-control repair in this control-rendering area. (role: introduced degraded-control behavior; confidence: medium; commits: 47bd1bb19412; files: extensions/telegram/src/button-types.ts, extensions/telegram/src/action-runtime.ts)
  • danhayman: Authored the earlier Discord text-fallback repair that this logging change extends. (role: introduced voice fallback behavior; confidence: medium; commits: f4908e60fdcd; files: extensions/discord/src/outbound-payload.ts)
  • Ayaan Zaidi: Authored the Telegram dispatch refactor containing the buffered-finalization boundary. (role: dispatch refactor contributor; confidence: medium; commits: e31a6e29fff7; files: extensions/telegram/src/bot-message-dispatch-reply.ts, extensions/telegram/src/reasoning-lane-coordinator.ts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • 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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-08-17T07:51:58.043Z sha 4d84ca3 :: needs maintainer review before merge. :: none

@steipete
steipete force-pushed the steipete/discord-voice-and-telegram-button-drops-206165 branch from 4d84ca3 to 7654ce7 Compare August 17, 2026 08:46
@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Aug 17, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Land-ready proof for exact head 7654ce765919eb2631f0bf6c39f6088c89c48737.

Local proof:

  • node scripts/run-vitest.mjs extensions/discord/src/outbound-adapter.test.ts extensions/telegram/src/bot-message-dispatch.draft-finalization.test.ts extensions/telegram/src/bot.create-telegram-bot.test.ts extensions/telegram/src/action-runtime.test.ts extensions/telegram/src/button-types.test.ts — 351/351 passed after the compatibility cleanup was removed.
  • node scripts/run-vitest.mjs test/scripts/check-env-var-count.test.ts — 12/12 passed.
  • node --import tsx scripts/check-env-var-count.mts --base origin/main — OPENCLAW_* count 502/502.
  • Changed-file oxfmt --check and git diff --check passed.

Remote proof:

ClawSweeper handling:

  • Applied the concrete compatibility move: removed only the raw-slash callback-router cleanup and its changed test. Shipped value-only slash callbacks retain their legacy behavior.
  • Completed the exact-head-CI rank-up move.
  • Skipped the optional credentialed Telegram Desktop proof. Credentialed live Discord/Telegram sends were not run; the repo-approved mock gateway/channel flow plus failing-before/passing-after owner-boundary regressions are the evidence.

Final surface: channel production +66/-58 (net +8); CI/tooling +4/-3 (net +1); tests +158/-9 (net +149); total +228/-70 across 11 files. CHANGELOG.md is unchanged.

@clawsweeper clawsweeper Bot added merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Aug 17, 2026
@steipete
steipete merged commit e3d553b into main Aug 17, 2026
199 checks passed
@steipete
steipete deleted the steipete/discord-voice-and-telegram-button-drops-206165 branch August 17, 2026 08:56
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 18, 2026
…ontrols (openclaw#125152)

* fix(channels): surface degraded Discord and Telegram sends

* fix(telegram): preserve legacy slash callbacks

* fix(ci): correct env-var count after version define removal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: discord Channel integration: discord channel: telegram Channel integration: telegram maintainer Maintainer-authored PR mantis: telegram-visible-proof Mantis should capture Telegram visible proof. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. 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. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. scripts Repository scripts 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