-
Notifications
You must be signed in to change notification settings - Fork 2.5k
[Bug] 工具输出未截断导致 Context Token 溢出,Session 无法继续 #4049
Copy link
Copy link
Open
Labels
category/toolsTool integration and executionTool integration and executionpriority/P2Medium - Moderately impactful, noticeable problemMedium - Moderately impactful, noticeable problemscope/session-managementSession state and persistenceSession state and persistencescope/token-managementToken handling and limitsToken handling and limitstype/bugSomething isn't working as expectedSomething isn't working as expected
Metadata
Metadata
Assignees
Labels
category/toolsTool integration and executionTool integration and executionpriority/P2Medium - Moderately impactful, noticeable problemMedium - Moderately impactful, noticeable problemscope/session-managementSession state and persistenceSession state and persistencescope/token-managementToken handling and limitsToken handling and limitstype/bugSomething isn't working as expectedSomething isn't working as expected
Type
Fields
Give feedbackNo fields configured for issues without a type.
问题描述
当工具(如
run_shell_command)输出大量数据时,这些数据直接进入对话上下文,可能导致 token 超出模型限制,导致整个 Session 无法继续执行。复现步骤
400 InternalError.Algo.InvalidParameter: Range of input length should be [1, 202745]错误日志
预期行为
工具层应该:
实际行为
工具输出直接进入上下文,没有任何截断或摘要处理,导致 token 溢出。
影响范围
建议改进
run_shell_command添加输出长度限制参数[180k/202k])/compact命令压缩历史对话补充信息