Skip to content
This repository was archived by the owner on Apr 17, 2026. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/core/src/harness/harness.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1239,7 +1239,7 @@ export class Harness<TState extends HarnessStateSchema = HarnessStateSchema> {
return {
type: 'file' as const,
data: f.data,
mimeType: f.mediaType,
mediaType: f.mediaType,
filename: f.filename,
};
Comment on lines 1239 to 1244
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check if AIV5Adapter and Agent code have been updated to handle mediaType field

echo "=== Checking AIV5Adapter file part handling ==="
rg -n -C5 'part\.mimeType|part\.mediaType' --type=ts -g '**/AIV5Adapter.ts'

echo ""
echo "=== Checking Agent file part handling ==="
rg -n -C5 'part\.mimeType|part\.mediaType' --type=ts -g '**/agent.ts'

echo ""
echo "=== Checking FilePartType definition ==="
rg -n -C3 'FilePartType' --type=ts -g '**/step-schema.ts'

echo ""
echo "=== Searching for mediaType field usage in message adapters ==="
rg -n 'mediaType' --type=ts -g '**/adapters/**'

Repository: superset-sh/mastra

Length of output: 7472


Field name mismatch between harness output and downstream consumers will result in undefined MIME types.

The change from mimeType to mediaType at line 1242 creates an inconsistency with code that consumes these file parts. AIV5Adapter (lines 205-206, 220) and Agent (line 1713) explicitly read .mimeType from the file parts passed through sendMessage(). Additionally, the FilePartType definition in step-schema.ts still uses mimeType as the field name. When harness sends mediaType, these downstream consumers will receive undefined for the MIME type, breaking file type detection and categorization in the agent.

All consumers of input file parts must be updated to read mediaType instead of mimeType, and the FilePartType type definition must be updated to match.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/core/src/harness/harness.ts` around lines 1239 - 1244, The harness
is emitting file parts with mediaType but downstream code (AIV5Adapter, Agent)
and the FilePartType type in step-schema.ts still expect mimeType, causing
undefined MIME types; update all consumers (search for AIV5Adapter methods at
lines referencing .mimeType, Agent code that reads .mimeType, and any uses
within sendMessage) to read .mediaType instead, and update the FilePartType
definition in step-schema.ts to rename mimeType to mediaType (or add mediaType
alongside mimeType for backward compatibility), ensuring all references and type
checks use the new field name consistently.

});
Expand Down