openclaw - 💡(How to fix) Fix Native reply-dispatch path lacks universal pre-send structured-output validation [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#61668Fetched 2026-04-08 02:56:10
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Participants

OpenClaw's native reply-dispatch → outbound deliver path appears able to reach channel dispatch without a universal pre-send structured-output validation gate. Hook-layer protections (message_sending, message_sent) are present, but they are not equivalent to one canonical fail-closed pre-send validation step for structured operator-facing output.

Root Cause

OpenClaw's native reply-dispatch → outbound deliver path appears able to reach channel dispatch without a universal pre-send structured-output validation gate. Hook-layer protections (message_sending, message_sent) are present, but they are not equivalent to one canonical fail-closed pre-send validation step for structured operator-facing output.

Fix Action

Fix / Workaround

Native reply-dispatch path lacks universal pre-send structured-output validation

Summary

OpenClaw's native reply-dispatch → outbound deliver path appears able to reach channel dispatch without a universal pre-send structured-output validation gate. Hook-layer protections (message_sending, message_sent) are present, but they are not equivalent to one canonical fail-closed pre-send validation step for structured operator-facing output.

Why it matters

This creates enforcement inconsistency across outbound paths. Some higher-level integrations can apply their own pre-send validation, but native dispatcher paths (main replies, tool-result sends, cron/followups, ACP/native completions) do not appear to universally traverse a shared pre-send validation seam before channel delivery.

RAW_BUFFERClick to expand / collapse

Native reply-dispatch path lacks universal pre-send structured-output validation

Summary

OpenClaw's native reply-dispatch → outbound deliver path appears able to reach channel dispatch without a universal pre-send structured-output validation gate. Hook-layer protections (message_sending, message_sent) are present, but they are not equivalent to one canonical fail-closed pre-send validation step for structured operator-facing output.

Why it matters

This creates enforcement inconsistency across outbound paths. Some higher-level integrations can apply their own pre-send validation, but native dispatcher paths (main replies, tool-result sends, cron/followups, ACP/native completions) do not appear to universally traverse a shared pre-send validation seam before channel delivery.

Observed paths

Affected / relevant outbound paths include:

  • main session native reply path
  • explicit message(action=send) outbound path
  • cron / operator followup delivery paths
  • ACP / native completion delivery paths
  • reply dispatcher / wrapper-based provider delivery paths

Identified seam

The highest-leverage seam appears to be:

  • source module: src/auto-reply/reply/reply-dispatcher.ts
  • handoff: await options.deliver(normalized, { kind });

This handoff sits upstream of channel-specific adapters and fans into a broad set of operator-facing outbound paths.

Suggested improvement

Add a minimal universal pre-send structured-output validation step at the native reply-dispatch → deliver handoff.

Desired properties:

  • runs before options.deliver(...)
  • applies only to structured operator-facing payloads
  • blocks send on validation failure (fail closed)
  • preserves simple/non-structured replies
  • preserves existing hook behavior (message_sending, message_sent)
  • avoids channel-by-channel patching or delivery redesign

Expected outcome

After this change, structured operator-facing output should either:

  1. pass the shared pre-send validation gate and dispatch normally, or
  2. fail closed before outbound delivery

That would make enforcement behavior consistent across native dispatch paths instead of relying on path-specific integrations or post-send / hook-layer safeguards.

extent analysis

TL;DR

Add a universal pre-send structured-output validation step at the native reply-dispatch → deliver handoff in src/auto-reply/reply/reply-dispatcher.ts to ensure consistent enforcement across outbound paths.

Guidance

  • Identify the specific validation logic required for structured operator-facing payloads and implement it as a separate function or module.
  • Modify the reply-dispatcher.ts file to call this validation function before the options.deliver(...) handoff, ensuring it blocks send on validation failure.
  • Verify that the new validation step preserves simple/non-structured replies and existing hook behavior (message_sending, message_sent).
  • Test the updated code to ensure it correctly handles both valid and invalid structured operator-facing output.

Example

// Example validation function
function validateStructuredOutput(payload: any): boolean {
  // Implement validation logic here
  // Return true if valid, false otherwise
}

// Modified reply-dispatcher.ts
const normalized = ...;
const kind = ...;
if (validateStructuredOutput(normalized)) {
  await options.deliver(normalized, { kind });
} else {
  // Handle validation failure (e.g., log error, notify operator)
}

Notes

The exact implementation of the validation logic will depend on the specific requirements of the structured operator-facing output. It is essential to ensure that the new validation step does not introduce any performance or security issues.

Recommendation

Apply workaround by adding the universal pre-send structured-output validation step as described above, as it will provide consistent enforcement across native dispatch paths without relying on path-specific integrations or post-send/hook-layer safeguards.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING