Skip to content

Uncaught exception in media understanding could crash entire reply pipeline #60423

Description

@KurtVogel

Description

In getReplyFromConfig (reply pipeline), applyMediaUnderstandingIfNeeded is called without a try/catch wrapper. While the internal layers have their own error handling, an unexpected error (e.g., from cache.cleanup() in the finally block, or a bug in finalizeInboundContext) could crash the entire reply pipeline.

Current Behavior

If applyMediaUnderstandingIfNeeded throws an unhandled error, the entire getReplyFromConfig call fails and the user gets no response at all — not even a text-only response ignoring the media.

Suggested Fix

Wrap applyMediaUnderstandingIfNeeded in try/catch and fall back to processing the message without media understanding. A degraded response (text-only, no transcription) is better than no response.

try {
  await applyMediaUnderstandingIfNeeded({ ctx, cfg, agentDir, activeModel });
} catch (err) {
  logger.warn('Media understanding failed, continuing without it', err);
}

Environment

  • OpenClaw 2026.4.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions