错误,怎么解决{"param":null,"type":"invalid_request_error","code":"invalid_request_error","message":"Error from provider (Console Go): Upstream request failed: [invalid_request_error] This model's maximum context length is 1048576 tokens. However, you requested 1048728 tokens (664728 in the messages, 384000 in the completion). Please reduce the length of the messages or completion."} #1930
|
{"param":null,"type":"invalid_request_error","code":"invalid_request_error","message":"Error from provider (Console Go): Upstream request failed: [invalid_request_error] This model's maximum context length is 1048576 tokens. However, you requested 1048728 tokens (664728 in the messages, 384000 in the completion). Please reduce the length of the messages or completion."} |
Replies: 3 comments 2 replies
|
That error is the model context window being exceeded, not a config bug: Quick checks:
Post the provider name and the exact request that failed if you want a deeper look. |
|
这个错误可以直接按预算来读: 所以不是 API key 问题,而是这次请求的“历史输入 + 最大输出预留”超过了模型上下文。建议按这个顺序处理:
还需要区分两个同名配置:模型适配器的 我根据官方 adapter、overflow recovery 和 |
|
是处理/goal 目标的过程中,多轮执行后出现的错误。提示是 运行错误400 ,使用的是opencode go v4f 模型,我已经重开了对话,等会我在回头重新按照你们的方法去试试 |
这个错误可以直接按预算来读:
所以不是 API key 问题,而是这次请求的“历史输入 + 最大输出预留”超过了模型上下文。建议按这个顺序处理:
384000降到更实际的值,例如128000,不要只减 152,应该留出后续消息和工具调用的余量。/compact,先执行一次/compact,成功后只重试原请求一次。还需要区分两个同名配置:模型适配器的
maxTokens是普通回复的输出上限;dsh-compaction-basic里的maxTokens是摘要调用的上限。修改后可以用dsh --profile web --dump-config检查实际生效的 provider/model、contextWindow和maxTokens。我根据官方 adapter、overflow recovery 和
/compact源码整理了完整的英文排查页,包含配置示例与验证清单:https://github.com/sandbaseai/deepseek-harnes…