Framework: mastra (2025-10)
Issue: should not convert files into base64 for LLM providers that support providing documents as URL
Mechanism cluster: M-multimodal-cost-amplification
Notes: paper:bf with MAINTAINER-FILES-OWN-BUG-REPORT pattern + DEAD-CODE-INDICATING-INCOMPLETE-IMPLEMENTATION evidence (NEW). Filed Oct 31 2025 by Member @roaminro himself tagged bug + p:high + trio-tb. CLOSED Nov 13 2025 via PR #9790 by @wardpeet (~13 days filing-to-merge). MAINTAINER-FILES-OWN PATTERN at n=7 in catalog (instances: abhiaiyer91 attempted-day-1-fix-MAST-017, NIK-TIGER-BILL files-PR-CRAI-010, devin-ai-bot CRAI-010+011, claude-bot PYAI-001, antonio-mello-ai LANG-030, ccurme LANG-036, NEW: roaminro MAST-020 first instance of maintainer-files-own-bug-report-with-source-line-trace not just fix-PR). GOLD-STANDARD ARCHITECTURAL-MISTAKE EVIDENCE WITH SOURCE-LINE TRACE: Reporter (Member @roaminro himself) quotable: "The presence of the unused isUrlSupportedByModel flag suggests that the original design may have intended to only download URLs that are NOT natively supported by the provider (e.g., for Anthropic Claude and for OpenAI which supports external URLs). However, this conditional logic was never implemented, resulting in all URLs being downloaded regardless of provider capabilities." Source-line traced to: packages/core/src/agent/message-list/index.ts lines 2737-2748 + 2350-2365 + 234-255 + 259-288; image-utils.ts:186-222; download-assets.ts:56-95; convert-file.ts:28-35 + 48-54. Concrete mechanism: "downloadAssetsFromMessages() finds all URLs in file/image parts and downloads them, regardless of provider support... The function calculates isUrlSupportedByModel (lines 78-84) but never uses this flag to filter which URLs to download. All URLs are downloaded unconditionally at lines 87-95. Downloaded Data Replaces URLs - convertImageFilePart() then replaces the URLs with the downloaded binary data (Uint8Array)." Direct mechanism: HTTP/HTTPS URLs unconditionally converted to base64 data URIs even when target provider supports raw URLs (OpenAI, some Anthropic). NEW PATTERN: dead-code-indicating-incomplete-implementation (unused isUrlSupportedByModel flag is archaeological evidence of original design intent never wired to actual logic). Strongest structural-archaeology evidence in catalog: source-code archaeology reveals incomplete-implementation the way commit-history archaeology reveals regression patterns. FIX-SHIPPED-NOT-RELEASED-CONFUSION at minor scale: @euvl Nov 9 2025 post-merge confusion: "@naaa760 Which version is it fixed in, just is happening for me on latest" -- parallels LANG-021 fix-merged-not-released. PR #9790 by Contributor @nehaaprasad Nov 6 2025 closed Nov 13 by @wardpeet. Sub-mechanism within M-multimodal-cost-amplification: framework-forces-base64-conversion-even-when-LLM-supports-URLs. NEW 4th sub-mechanism for M-multimodal cluster. Adds MASTRA AS 3RD FRAMEWORK to M-multimodal-cost-amplification cluster. Cost angle: base64 conversion incurs (a) ~33% size inflation per MAST-021, (b) double-token-cost when text-string-counted (per LANG-036), (c) defeats prompt-caching since binary data changes representation, (d) additional egress/network cost framework downloads then re-uploads.