Skip to content

fix(messages): preserve inbound audio for message-tool TTS#87749

Merged
steipete merged 2 commits into
openclaw:mainfrom
ai-hpc:fix/message-tool-inbound-tts
Jun 2, 2026
Merged

fix(messages): preserve inbound audio for message-tool TTS#87749
steipete merged 2 commits into
openclaw:mainfrom
ai-hpc:fix/message-tool-inbound-tts

Conversation

@ai-hpc

@ai-hpc ai-hpc commented May 28, 2026

Copy link
Copy Markdown
Member

Summary

  • Carry the current inbound-audio fact into embedded OpenClaw message-tool sends.
  • Reuse the shared inbound audio detector for normal final replies and message-tool TTS routing.
  • Add focused regressions for embedded context propagation, message tool forwarding, and outbound TTS call shape.

Fixes #87708.

Verification

  • OPENCLAW_HEAVY_CHECK_LOCK_SCOPE=worktree pnpm test src/infra/outbound/message-action-runner.core-send.test.ts src/agents/tools/message-tool.test.ts src/auto-reply/reply/agent-runner-utils.test.ts
  • node scripts/run-vitest.mjs run --config test/vitest/vitest.auto-reply.config.ts src/auto-reply/reply/dispatch-from-config.reply-dispatch.test.ts --reporter=verbose
  • pnpm format:check src/auto-reply/reply/inbound-media.ts src/auto-reply/reply/dispatch-from-config.ts src/auto-reply/reply/agent-runner-utils.ts src/auto-reply/reply/agent-runner-utils.test.ts src/agents/command/types.ts src/agents/command/attempt-execution.ts src/agents/embedded-agent-runner/run/params.ts src/agents/embedded-agent-runner/run.ts src/agents/embedded-agent-runner/run/attempt.ts src/agents/agent-tools.ts src/agents/openclaw-tools.ts src/agents/tools/message-tool.ts src/agents/tools/message-tool.test.ts src/infra/outbound/message-action-runner.ts src/infra/outbound/message-action-runner.core-send.test.ts
  • git diff --check

Real behavior proof

behavior: message-tool sends from an inbound audio turn preserve the inbound audio context before the message-action TTS helper decides whether messages.tts.auto: "inbound" should synthesize audio.

environment: local OpenClaw source checkout on Node 22 with the focused message-tool, outbound runner, embedded context, and reply-dispatch tests.

steps: ran the focused regression suite covering embedded context construction, message tool forwarding, outbound message-action TTS invocation, and the existing reply-dispatch TTS path after moving the inbound-audio detector into the shared helper.

evidence: the focused regression command passed 3 Vitest shards, the dispatch smoke command passed 1 Vitest shard, formatter passed on all touched files, and git diff --check passed.

observedResult: embedded runs now compute currentInboundAudio from the same inbound context used by normal final replies, the message tool forwards it as inboundAudio, and the message-action TTS helper receives inboundAudio: true for source audio turns.

notTested: full live Telegram voice-message plus Microsoft TTS E2E was not run locally. The focused proof covers the source-level runtime path where the inbound-audio fact was dropped before synthesis.

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: S labels May 28, 2026
@clawsweeper

clawsweeper Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed May 29, 2026, 1:09 AM ET / 05:09 UTC.

Summary
Review failed before ClawSweeper could summarize the requested change.

PR surface: Source +18, Tests +96. Total +114 across 15 files.

Reproducibility: unclear. The review failed before ClawSweeper could establish a reproduction path.

Review metrics: none identified.

Merge readiness
Overall: 🌊 off-meta tidepool
Proof: 🌊 off-meta tidepool
Patch quality: 🌊 off-meta tidepool
Result: rating does not apply to this item.

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

Risk before merge

  • [P1] No close action taken because the review did not complete.

Maintainer options:

  1. Decide the mitigation before merge
    Retry the Codex review after fixing the execution failure.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • Review did not complete, so no work-lane recommendation was made.
Review details

Best possible solution:

Retry the Codex review after fixing the execution failure.

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

Unclear. The review failed before ClawSweeper could establish a reproduction path.

Is this the best way to solve the issue?

Unclear. Retry the review first so ClawSweeper can evaluate the actual issue and fix direction.

AGENTS.md: unclear because the file could not be read completely.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 0e86ca135225.

Label changes

Label changes:

  • remove P2: Current review triage priority is none.

Label justifications:

  • rating: 🌊 off-meta tidepool: Overall readiness is 🌊 off-meta tidepool; proof is 🌊 off-meta tidepool and patch quality is 🌊 off-meta tidepool.
Evidence reviewed

PR surface:

Source +18, Tests +96. Total +114 across 15 files.

View PR surface stats
Area Files Added Removed Net
Source 12 58 40 +18
Tests 3 96 0 +96
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 15 154 40 +114

What I checked:

  • failure reason: codex execution failed.
  • codex failure detail: Codex review failed for this PR with exit 1.
  • codex stdout: Per-item Codex failure; continuing with the rest of the shard.

Likely related people:

  • unknown: Codex failed before it could trace repository history. (role: review did not complete; confidence: low)
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: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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. labels May 28, 2026
@clawsweeper clawsweeper Bot added rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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. labels May 29, 2026
@steipete steipete self-assigned this Jun 2, 2026
@steipete
steipete force-pushed the fix/message-tool-inbound-tts branch from 726db72 to 738fb0a Compare June 2, 2026 10:40
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: M and removed size: S labels Jun 2, 2026
@steipete

steipete commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Land-ready after maintainer rebase/fixup.

What changed:

  • Preserved inbound-audio context across embedded reply runs, CLI MCP loopback, queued follow-up collection/runner, and message-tool resolution.
  • Added loopback propagation for OPENCLAW_MCP_CURRENT_INBOUND_AUDIO / x-openclaw-current-inbound-audio and queued currentInboundAudio metadata.

Proof:

  • Autoreview clean: .agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main ... reported no accepted/actionable findings, overall: patch is correct (0.82).
  • pnpm format:check src/auto-reply/reply/get-reply-run.ts src/auto-reply/reply/get-reply-run.media-only.test.ts passed.
  • node scripts/run-vitest.mjs src/auto-reply/reply/get-reply-run.media-only.test.ts src/auto-reply/reply/followup-runner.test.ts src/auto-reply/reply/queue.collect.test.ts src/infra/outbound/message-action-runner.core-send.test.ts src/agents/tools/message-tool.test.ts src/agents/cli-runner/prepare.test.ts src/gateway/mcp-http.test.ts --reporter=verbose passed.
  • node scripts/run-vitest.mjs src/agents/cli-runner/prepare.test.ts src/gateway/mcp-http.test.ts src/infra/outbound/message-action-runner.core-send.test.ts src/agents/tools/message-tool.test.ts src/auto-reply/reply/agent-runner-utils.test.ts src/auto-reply/reply/dispatch-from-config.reply-dispatch.test.ts src/auto-reply/reply/followup-runner.test.ts src/auto-reply/reply/queue.collect.test.ts --reporter=verbose passed.
  • git diff --check origin/main...HEAD && git diff --check passed.
  • CI run https://github.com/openclaw/openclaw/actions/runs/26814469816 passed.
  • Real behavior proof run https://github.com/openclaw/openclaw/actions/runs/26814478977 passed.

Known proof gap: no live Telegram audio roundtrip was run for this maintainer fixup; coverage is focused local tests plus CI/real-behavior-proof workflow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling gateway Gateway runtime P2 Normal backlog priority with limited blast radius. rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: message-tool Telegram replies skip auto=inbound TTS because inboundAudio is not passed

3 participants