mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-30 03:00:41 -04:00
perf(copilot): reduce tool output truncation from 500K to 100K chars
500K chars (~125K tokens) per tool result was too generous — a few large tool outputs could push context past 200K+ tokens. 100K chars (~25K tokens) keeps individual results reasonable. The SDK writes oversized results to tool-results/ files and returns a reference.
This commit is contained in:
@@ -63,8 +63,10 @@ if TYPE_CHECKING:
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
# Max MCP response size in chars — keeps tool output under the SDK's 10 MB JSON buffer.
|
||||
_MCP_MAX_CHARS = 500_000
|
||||
# Max MCP response size in chars. Lower = smaller context = cheaper.
|
||||
# 100K chars ≈ 25K tokens. The SDK writes oversized results to
|
||||
# tool-results/ files and returns a file reference instead.
|
||||
_MCP_MAX_CHARS = 100_000
|
||||
|
||||
# MCP server naming - the SDK prefixes tool names as "mcp__{server_name}__{tool}"
|
||||
MCP_SERVER_NAME = "copilot"
|
||||
|
||||
Reference in New Issue
Block a user