Skip to content

Agent Zero AI framework

Raise unusable response limit to five

Alessandro5ff106a2d489
diff --git a/helpers/settings.py b/helpers/settings.py
index fcd66eef6..ac6ba0151 100644
--- a/helpers/settings.py
+++ b/helpers/settings.py
@@ -527,7 +527,7 @@ def get_default_settings() -> Settings:
agent_profile=get_default_value("agent_profile", "agent0"),
agent_knowledge_subdir=get_default_value("agent_knowledge_subdir", "custom"),
max_consecutive_unusable_responses=get_default_value(
- "max_consecutive_unusable_responses", 2
+ "max_consecutive_unusable_responses", 5
),
timezone=_normalize_timezone_setting(get_default_value("timezone", TIMEZONE_AUTO)),
time_format=_normalize_time_format(get_default_value("time_format", TIME_FORMAT_12H)),
diff --git a/helpers/settings.py.dox.md b/helpers/settings.py.dox.md
index d4bdb974c..e34c06372 100644
--- a/helpers/settings.py.dox.md
+++ b/helpers/settings.py.dox.md
@@ -65,7 +65,7 @@
- Important called helpers/classes observed in the source: `TypeVar`, `files.get_abs_path`, `dotenv.get_dotenv_value`, `opts.insert`, `str.strip`, `_is_valid_timezone`, `str.strip.lower`, `_normalize_timezone_setting`, `SettingsOutput`, `get_default_settings`, `_ensure_option_present`, `_resolve_runtime_timezone`, `get_default_secrets_manager`, `get_settings`, `normalize_settings`, `_load_sensitive_settings`, `settings.copy`, `_write_settings_file`, `reload_settings`, `set_settings`, `initialize_agent`.
- Applying settings refreshes active context configs while preserving each subordinate agent's own profile.
- Applying settings starts a deferred `MCPConfig.update(...)` with the current `mcp_servers` string when global MCP server settings change.
-- `max_consecutive_unusable_responses` defaults to `2` and controls the cost circuit breaker for malformed or repeated main-model outputs.
+- `max_consecutive_unusable_responses` defaults to `5` and controls the cost circuit breaker for malformed or repeated main-model outputs.
- `ui_control_visibility` stores validated mobile and desktop visibility flags for the project selector, clock, connection status, and right canvas rail; missing or malformed values fall back per device.
- Keep request/response, tool, or helper semantics documented here at the same time as source changes.
diff --git a/tests/test_unusable_response_loop.py b/tests/test_unusable_response_loop.py
index 0db2a97ca..c170f9d9b 100644
--- a/tests/test_unusable_response_loop.py
+++ b/tests/test_unusable_response_loop.py
@@ -85,7 +85,7 @@ def test_nonconsecutive_failure_starts_a_new_recovery_window(monkeypatch):
def test_general_settings_expose_the_default_failure_limit():
settings = get_default_settings()
- assert settings["max_consecutive_unusable_responses"] == 2
+ assert settings["max_consecutive_unusable_responses"] == 5
settings["max_consecutive_unusable_responses"] = 0
assert normalize_settings(settings)["max_consecutive_unusable_responses"] == 1
diff --git a/webui/components/settings/agent/agent.html b/webui/components/settings/agent/agent.html
index 9f8978a6f..b8ecdd5f1 100644
--- a/webui/components/settings/agent/agent.html
+++ b/webui/components/settings/agent/agent.html
@@ -71,7 +71,7 @@
<div class="field-label">
<div class="field-title">Consecutive unusable response limit</div>
<div class="field-description">
- Stop after this many malformed or repeated model responses. The default allows one corrective retry.
+ Stop after this many malformed or repeated model responses. The default is 5.
</div>
</div>
<div class="field-control">