[GH-ISSUE #277] Large tool results not checked for content length if using non-string content blocks #242

Closed
opened 2026-06-05 17:21:13 -04:00 by yindo · 0 comments
Owner

Originally created by @bracesproul on GitHub (Mar 5, 2026).
Original GitHub issue: https://github.com/langchain-ai/deepagentsjs/issues/277

the logic which checks the size of the tool result only considers content blocks which are strings, not multi-type content blocks

this means if you have a complex content block with a text field that contains 1 billion characters, it'll get sent right back to the agent

i think the fix here is to join all content blocks with type text, and check the lengths of those

libs/deepagents/src/middleware/fs.ts L857

Originally created by @bracesproul on GitHub (Mar 5, 2026). Original GitHub issue: https://github.com/langchain-ai/deepagentsjs/issues/277 the logic which checks the size of the tool result only considers `content` blocks which are strings, not multi-type content blocks this means if you have a complex content block with a `text` field that contains 1 billion characters, it'll get sent right back to the agent i think the fix here is to join all content blocks with type `text`, and check the lengths of those `libs/deepagents/src/middleware/fs.ts` `L857`
yindo closed this issue 2026-06-05 17:21:13 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/deepagentsjs#242