Skip to content

feat(middleware): propagate multimodal media through ChannelBridge and auto-reply#420

Merged
alexey-pelykh merged 1 commit intomainfrom
feat/middleware-media-propagation
Mar 8, 2026
Merged

feat(middleware): propagate multimodal media through ChannelBridge and auto-reply#420
alexey-pelykh merged 1 commit intomainfrom
feat/middleware-media-propagation

Conversation

@alexey-pelykh
Copy link
Copy Markdown

Summary

  • Add media-resolver module to download remote media URLs and detect MIME types for local files, producing MediaAttachment[] for CLI runtimes
  • Handle AgentMediaEvent in DeliveryAdapter — flushes text buffer before media to preserve interleaving order, deduplicates streaming events against AgentRunResult.media
  • Integrate media resolution into ChannelBridge.handle() between hook processing and runtime.execute(), passing resolved attachments as the media parameter

Closes #387

Test plan

  • 11 unit tests for media-resolver (remote download, local paths, error handling, mixed URLs)
  • 8 unit tests for DeliveryAdapter media handling (filePath/sourceUrl, deduplication, interleaving, callbacks)
  • 7 unit tests for ChannelBridge media forwarding (inbound resolution, outbound delivery, edge cases)
  • All 7948 existing tests pass
  • TypeScript strict mode — no errors
  • oxlint + oxfmt clean

🤖 Generated with Claude Code

…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>
@alexey-pelykh alexey-pelykh enabled auto-merge (squash) March 8, 2026 07:28
@alexey-pelykh alexey-pelykh merged commit 243a02b into main Mar 8, 2026
5 checks passed
@alexey-pelykh alexey-pelykh deleted the feat/middleware-media-propagation branch March 8, 2026 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(middleware): propagate multimodal media through ChannelBridge and auto-reply

1 participant