fix(extensions): synthesize mediaLocalRoots propagation across sendMedia adapters#33799
fix(extensions): synthesize mediaLocalRoots propagation across sendMedia adapters#33799Takhoffman merged 8 commits intomainfrom
Conversation
Greptile SummaryThis PR synthesizes Key changes:
Confidence Score: 4/5
Last reviewed commit: 621ed20 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 621ed20b9a
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
Addressed the review findings in commit 725dc05:
Re-ran:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3921440f3a
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| maxBytes: maxBytes ?? (account.config.mediaMaxMb ?? 20) * 1024 * 1024, | ||
| }); | ||
| const effectiveMaxBytes = maxBytes ?? (account.config.mediaMaxMb ?? 20) * 1024 * 1024; | ||
| const loaded = /^https?:\/\//i.test(mediaUrl) |
There was a problem hiding this comment.
Trim mediaUrl before checking HTTP scheme
googlechatPlugin.outbound.sendMedia now branches on /^https?:\/\// using the raw mediaUrl, but the previous code path always sent the URL to fetchRemoteMedia, whose URL parsing tolerates surrounding whitespace. This means inputs like " https://example.com/image.png " are now misclassified as local paths and sent to loadWebMedia, which fails with local-path allowlist errors instead of downloading the remote media. Normalizing/trimming the URL before the scheme check preserves the prior remote behavior for whitespace-padded URLs.
Useful? React with 👍 / 👎.
3921440 to
9d1a46e
Compare
Summary
This PR synthesizes overlapping fixes to restore deterministic
mediaLocalRootspropagation through extensionsendMediaadapters, so local media paths resolve from configured roots instead of silently dropping roots at extension boundaries.Synthesis Scope
What changed
sendMedianow uses local-capable media loading and passes roots tolocalRoots.mediaLocalRootsthrough outboundsendMedia.mediaLocalRootsthrough helper + outboundsendMediapath.mediaLocalRootsthrough helper + outboundsendMediapath.mediaLocalRootsthrough outboundsendMedia.Invariant
Verification
pnpm install --frozen-lockfilepnpm buildpnpm checkpnpm test:macminipnpm test extensions/googlechat/src/channel.outbound.test.ts extensions/slack/src/channel.test.ts extensions/imessage/src/channel.outbound.test.ts extensions/signal/src/channel.test.ts extensions/whatsapp/src/channel.test.tsNotes
This synthesis supersedes the extension-level root propagation deltas from #33581, #33545, #33540, #33536, and #33528.