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
Description
In
getReplyFromConfig(reply pipeline),applyMediaUnderstandingIfNeededis called without a try/catch wrapper. While the internal layers have their own error handling, an unexpected error (e.g., fromcache.cleanup()in the finally block, or a bug infinalizeInboundContext) could crash the entire reply pipeline.Current Behavior
If
applyMediaUnderstandingIfNeededthrows an unhandled error, the entiregetReplyFromConfigcall fails and the user gets no response at all — not even a text-only response ignoring the media.Suggested Fix
Wrap
applyMediaUnderstandingIfNeededin try/catch and fall back to processing the message without media understanding. A degraded response (text-only, no transcription) is better than no response.Environment