refactor(agent): remove loop iteration state (#5549)

* refactor(agent): remove loop iteration state

* docs(my): remove stale iteration guidance
This commit is contained in:
chengyongru authored and GitHub committed 2026-08-26 15:57:47 +08:00
1 parent 4f6c0aedfa
commit 9d34fc5af2
10 files changed
+22 -81

No files matched your search

-6
View File
@@ -201,10 +201,6 @@ class AgentLoop:
5. Sends responses back
"""
@property
def current_iteration(self) -> int:
return self._current_iteration
@property
def tool_names(self) -> list[str]:
return self.tools.tool_names
@@ -464,7 +460,6 @@ class AgentLoop:
if model_preset:
self.set_model_preset(model_preset, publish_update=False)
self._register_default_tools(provider_snapshot_loader=provider_snapshot_loader)
self._current_iteration: int = 0
self.commands = CommandRouter()
register_builtin_commands(self.commands)
@@ -1172,7 +1167,6 @@ class AgentLoop:
session_key=active_session_key,
workspace=effective_scope.project_path,
tool_hint_max_length=self.tool_hint_max_length,
on_iteration=lambda iteration: setattr(self, "_current_iteration", iteration),
registered_hook_factories=self._hook_factories,
turn_hook_factories=list(hook_factories or []),
registered_hooks=self._extra_hooks,