feat(middleware): propagate multimodal media through ChannelBridge and auto-reply#420
Merged
alexey-pelykh merged 1 commit intomainfrom Mar 8, 2026
Merged
Conversation
…d DeliveryAdapter (#387) Wire inbound media (channel → agent) and outbound media (agent → channel) through the middleware pipeline: - Add media-resolver module to download remote URLs and detect MIME types for local files, producing MediaAttachment[] for CLI runtimes - Handle AgentMediaEvent in DeliveryAdapter with text buffer flush to preserve interleaving order, and deduplicate against AgentRunResult.media - Integrate media resolution into ChannelBridge.handle() between hook processing and runtime execution Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
media-resolvermodule to download remote media URLs and detect MIME types for local files, producingMediaAttachment[]for CLI runtimesAgentMediaEventinDeliveryAdapter— flushes text buffer before media to preserve interleaving order, deduplicates streaming events againstAgentRunResult.mediaChannelBridge.handle()between hook processing andruntime.execute(), passing resolved attachments as themediaparameterCloses #387
Test plan
media-resolver(remote download, local paths, error handling, mixed URLs)DeliveryAdaptermedia handling (filePath/sourceUrl, deduplication, interleaving, callbacks)ChannelBridgemedia forwarding (inbound resolution, outbound delivery, edge cases)🤖 Generated with Claude Code