mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-05-01 07:15:52 +00:00
fix(dream): allow LLM to retry on tool errors instead of failing immediately
Dream Phase 2 uses fail_on_tool_error=True, which terminates the entire run on the first tool error (e.g. old_text not found in edit_file). Normal agent runs default to False so the LLM can self-correct and retry. Dream should behave the same way.
This commit is contained in:
parent
5479a44691
commit
7d2c62716c
@ -627,7 +627,7 @@ class Dream:
|
|||||||
model=self.model,
|
model=self.model,
|
||||||
max_iterations=self.max_iterations,
|
max_iterations=self.max_iterations,
|
||||||
max_tool_result_chars=self.max_tool_result_chars,
|
max_tool_result_chars=self.max_tool_result_chars,
|
||||||
fail_on_tool_error=True,
|
fail_on_tool_error=False,
|
||||||
))
|
))
|
||||||
logger.debug(
|
logger.debug(
|
||||||
"Dream Phase 2 complete: stop_reason={}, tool_events={}",
|
"Dream Phase 2 complete: stop_reason={}, tool_events={}",
|
||||||
|
|||||||
@ -72,7 +72,7 @@ class TestDreamRun:
|
|||||||
mock_runner.run.assert_called_once()
|
mock_runner.run.assert_called_once()
|
||||||
spec = mock_runner.run.call_args[0][0]
|
spec = mock_runner.run.call_args[0][0]
|
||||||
assert spec.max_iterations == 10
|
assert spec.max_iterations == 10
|
||||||
assert spec.fail_on_tool_error is True
|
assert spec.fail_on_tool_error is False
|
||||||
|
|
||||||
async def test_advances_dream_cursor(self, dream, mock_provider, mock_runner, store):
|
async def test_advances_dream_cursor(self, dream, mock_provider, mock_runner, store):
|
||||||
"""Dream should advance the cursor after processing."""
|
"""Dream should advance the cursor after processing."""
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user