mirror of
https://github.com/hanzoai/python-sdk.git
synced 2026-10-23 20:23:00 +00:00
Fix read tool token limit - reduce to 20k for MCP overhead
- Reduced max_tokens from 25000 → 20000 - Prevents 'response exceeds maximum allowed tokens' errors - Leaves buffer for MCP protocol overhead Fixes: read tool returning 27444 tokens (exceeds 25000 limit)
This commit is contained in:
@@ -212,9 +212,10 @@ Usage:
|
||||
await tool_ctx.info(f"Successfully read file: {file_path}")
|
||||
|
||||
# Apply token limit to prevent excessive output
|
||||
# Reduce to 20000 to leave buffer for MCP overhead
|
||||
return truncate_response(
|
||||
result,
|
||||
max_tokens=25000,
|
||||
max_tokens=20000,
|
||||
truncation_message="\n\n[File content truncated due to token limit. Use offset/limit parameters to read specific sections.]",
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user