Skip to content

Bug: Custom data parts break subsequent messages with Gemini #12363

@daneatmastra

Description

@daneatmastra

This issue was created from Discord post 1465700804320170072:

Open in Discord

Issue:

After using writer.custom() in a tool, I cannot send new messages. Getting this error:
Unable to submit request because it must include at least one parts field, which describes the prompt input. Learn more: https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/gemini

Reproduction:

execute: async (inputData, { writer }) => {
  await writer?.custom({
    type: "data-chart",
    data: inputData,
  });
  
  return { success: true };
}

After the tool executes and returns custom data parts, the next user message fails with the Gemini error above.

Metadata

Metadata

Assignees

Labels

AgentsIssues regarding Mastra's Agent primitiveToolsIssues with user made tools for Agent tool callingbugSomething isn't workingdiscordFor issues created from Discord discussions.effort:mediumimpact:hightrio-tb

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions