feat(engine): finalize after tool iteration limit

This commit is contained in:
2026-05-22 11:37:02 +08:00
parent b808f5cbc2
commit c53e221117
2 changed files with 55 additions and 3 deletions

View File

@ -608,6 +608,12 @@ def test_agent_loop_records_max_tool_iterations_as_failed_skill_effect(tmp_path:
provider_name="stub",
model="stub-model",
),
LLMResponse(
content="Based on the available tool result, the container likely failed during startup.",
finish_reason="stop",
provider_name="stub",
model="stub-model",
),
]
),
)
@ -621,7 +627,9 @@ def test_agent_loop_records_max_tool_iterations_as_failed_skill_effect(tmp_path:
)
loaded = loop.boot()
assert result.finish_reason == "max_tool_iterations"
assert result.finish_reason == "max_tool_iterations_finalized"
assert "Based on the available tool result" in result.output_text
assert "Tool loop stopped" not in result.output_text
effect_records = loaded.run_memory_store.list_skill_effects("docker-debug", version="v0007")
assert effect_records[-1].run_id == result.run_id
assert effect_records[-1].success is False