You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently tool output size is entirely the user's responsibility. If a tool returns 50k lines of build logs, the full output gets injected into the agent's context, often causing context blowup. Users must manually truncate in their tool's execute function.
Industry comparison: Anthropic's context editing strips consumed tool results automatically. Most production agent systems have framework-level output management.
Proposal
Add a framework-level mechanism to control tool output size. Options to explore:
maxToolOutputTokens on AgentConfig or ToolExecutor — auto-truncate any tool result exceeding the limit (keep head + tail, or just tail for logs)
Per-tool maxOutputTokens on ToolDefinition — different tools have different expected output sizes
Post-consumption compression — after the agent has seen and acted on a tool result, replace it with a short summary in subsequent turns (similar to Anthropic's clear_tool_uses)
These are not mutually exclusive. Option 1 is the simplest starting point.
Source
Competitive analysis: Anthropic context editing (clear_tool_uses_20250919), Manus context engineering blog post
Problem
Currently tool output size is entirely the user's responsibility. If a tool returns 50k lines of build logs, the full output gets injected into the agent's context, often causing context blowup. Users must manually truncate in their tool's
executefunction.Industry comparison: Anthropic's context editing strips consumed tool results automatically. Most production agent systems have framework-level output management.
Proposal
Add a framework-level mechanism to control tool output size. Options to explore:
maxToolOutputTokenson AgentConfig or ToolExecutor — auto-truncate any tool result exceeding the limit (keep head + tail, or just tail for logs)maxOutputTokenson ToolDefinition — different tools have different expected output sizesclear_tool_uses)These are not mutually exclusive. Option 1 is the simplest starting point.
Source
clear_tool_uses_20250919), Manus context engineering blog post