Affected Component
Backend (Python/FastAPI)
Description
在「模型自动(Auto)」模式下,当模型返回空响应(既无文本也无 tool call)且本轮已产生过可观测输出/已执行过工具时,runner 会进入「空响应重试耗尽」错误分支。该分支构造 FailoverDecision 时多传了一个位置参数,而 FailoverDecision 是只有 2 个字段的 frozen dataclass,直接抛出 TypeError:
FailoverDecision.__init__() takes 3 positional arguments but 4 were given
该 TypeError 随后被 runner 外层兜底 except 捕获并按「不可重试错误」处理,原始 Python 异常文本被直接作为该轮对话的错误信息返回给用户,同时 Auto 模式的模型故障转移(failover)完全失效(无法切换到备选模型)。
Steps to Reproduce
- 将会话切换为「模型自动(Auto)」模式(
model_auto=true,category=user),确保存在可用的默认 LLM 与多个候选模型。
- 使用一个可能返回空响应的模型(本例
deepseek-v4.1-flash),在一个「已经执行过工具/已产生过可观测输出」的回合中让模型返回空响应(无文本、无 tool call)。
- 任务提交后即复现。
最小等价复现(单测路径):构造 SessionRunner(..., defer_step_errors=True, failover_available=True),令 _call_llm 返回 StepResult(action="stop", content="") 且 runner._attempt_state.observable_output_started = True,调用 _process_step。
defer_step_errors=True 仅在 Auto 模式出现,见 flocks/session/session_loop.py:
runner = SessionRunner(
...
defer_step_errors=ctx.auto_failover, # session_loop.py:1201
failover_available=(
ctx.auto_failover
and ctx.candidate_index + 1 < len(ctx.model_candidates)
),
)
Logs / Error Messages
Flocks Version
v2026.9.14
Operating System
Windows
Installation Method
uv / pip install
Additional Context
No response
Affected Component
Backend (Python/FastAPI)
Description
在「模型自动(Auto)」模式下,当模型返回空响应(既无文本也无 tool call)且本轮已产生过可观测输出/已执行过工具时,runner 会进入「空响应重试耗尽」错误分支。该分支构造
FailoverDecision时多传了一个位置参数,而FailoverDecision是只有 2 个字段的 frozen dataclass,直接抛出TypeError:该
TypeError随后被 runner 外层兜底except捕获并按「不可重试错误」处理,原始 Python 异常文本被直接作为该轮对话的错误信息返回给用户,同时 Auto 模式的模型故障转移(failover)完全失效(无法切换到备选模型)。Steps to Reproduce
model_auto=true,category=user),确保存在可用的默认 LLM 与多个候选模型。deepseek-v4.1-flash),在一个「已经执行过工具/已产生过可观测输出」的回合中让模型返回空响应(无文本、无 tool call)。最小等价复现(单测路径):构造
SessionRunner(..., defer_step_errors=True, failover_available=True),令_call_llm返回StepResult(action="stop", content="")且runner._attempt_state.observable_output_started = True,调用_process_step。defer_step_errors=True仅在 Auto 模式出现,见flocks/session/session_loop.py:Logs / Error Messages
Flocks Version
v2026.9.14
Operating System
Windows
Installation Method
uv / pip install
Additional Context
No response