Repository navigation
[Bug] 多个子任务结束后主任务返回 HTTP 400 / HTTP 400 after multi-agent reports #422
Replies: 1 comment
|
这个 400 可以定到位:它不是 DSH 本地拒绝,是 DeepSeek 服务端对「请求体结构不合法」的拒绝;而且你贴上来的三个字段正好能把它和另外两类 400 分开。 1. 先看报错串的出处
// packages/llm/llm-deepseek/src/protocols/chat-completions/adapter.ts:346
let message = `DeepSeek API error (HTTP ${response.status})`
// :103-106 —— 400 的归一化
if (status === 400) {
if (isContextWindowExceededError(detail)) return CONTEXT_WINDOW_EXCEEDED_CODE
return 'INVALID_REQUEST'
}所以你看到的 2. 先排除「上下文超长 / 请求过大」
排除掉大小之后,剩下的就是序列结构不合法。 3. 最像的一种:悬空 tool_call主循环是先落盘调用、再落盘结果: // packages/core/agent-loop/src/tool-calls.ts:168 —— 在 startCall 内,先记 tool/call
callSeqs[index] = appendToolCall(session, turn, step, call.block)
// :170
const prepared = await ctx.tools[TOOL_RUNTIME_SCHEDULER].prepare(call.exec)
// :235 —— prepare/dispatch 抛错时直接往外抛,这条 call 就没有 result
throw schedulerFailure.error而补齐悬空调用的修复只在冷恢复时跑: // packages/core/session/src/repair.ts:91-92
// Close calls before their step: providers reject dangling assistant calls,
// and Map insertion order preserves their transcript order.调用点 你这个场景(并行子代理 + 主任务汇总)正好是这类失败最容易发生的位置:子代理批量返回时工具结果多、单步载荷大,任何一次工具执行在 同族已经有比较完整的分析,可以直接看这几条:#1695、#1841、#2499、#3524、#3808(另有 #5911)。这条缺陷独立于触发原因,不必在这里重讲。下面这段( 4. 你自己怎么确证是哪一种拿会话导出(Session Header 的 more-actions →
5. 顺带日志里中文乱码、以及子任务报告汇总这一步的耗时,都是独立现象,建议不要和这个 400 绑成一份因果链——先把历史配平问题定位掉,其余两项另开。 如果这条帮你把范围收敛到了具体那一种,可以把它标为 answer,后面遇到同样报错的人能直接找到这个判据。 |
Uh oh!
There was an error while loading. Please reload this page.
中文
问题
当主任务启动多个子任务(subagents)进行并行检查时,子任务完成并把报告返回给主任务后,主任务无法继续生成最终总结,反复出现:
复现过程
deepseek-official。deepseek-v4-flash。观察到的情况
期望结果
主任务应该能够:
请问这是已知的上下文长度、消息拼接、缓存,或多代理报告汇总问题吗?
English
Issue
When the main task starts multiple subagents for parallel codebase reviews, the main task fails after the subagents finish and send their reports back. The main task cannot generate the final summary and repeatedly returns:
Reproduction steps
deepseek-official.deepseek-v4-flash.Observations
Expected behavior
The main task should either:
Could this be a known issue related to context length, message assembly, caching, or multi-agent report aggregation?
dsh-session-sanitized-89d64ca4.zip
All reactions