Skip to content

The agent that grows with you

refactor(agent/status_output,tool_guardrails): keep force short-circuit and record-presence guard explicit

Teknium3de7e303ba03
diff --git a/agent/status_output.py b/agent/status_output.py
index 8e6ab267cf5..ba04821e94a 100644
--- a/agent/status_output.py
+++ b/agent/status_output.py
@@ -29,8 +29,7 @@ class StatusOutputMixin:
the main response; ``force=True`` bypasses both. ``suppress_status_output`` (``hermes chat -q``) wins."""
if getattr(self, "suppress_status_output", False):
return
- muted = getattr(self, "_mute_post_response", False) or (self._has_stream_consumers() and not self._executing_tools)
- if force or not muted:
+ if force or not (getattr(self, "_mute_post_response", False) or (self._has_stream_consumers() and not self._executing_tools)):
self._safe_print(*args, **kwargs)
def _should_start_quiet_spinner(self) -> bool:
diff --git a/agent/tool_guardrails.py b/agent/tool_guardrails.py
index 08079665b38..f3d49605e03 100644
--- a/agent/tool_guardrails.py
+++ b/agent/tool_guardrails.py
@@ -327,9 +327,9 @@ class ToolCallGuardrailController:
exact_count = 0 if self._progress_since_failure.get(signature) else self._exact_failure_counts.get(signature, 0)
if exact_count >= self.config.exact_failure_block_after:
return self._decide("block", "repeated_exact_failure_block", tool_name, exact_count, signature)
- repeat_count = self._no_progress.get(signature, ("", 0))[1] if self._is_idempotent(tool_name) else 0
- if repeat_count >= self.config.no_progress_block_after:
- return self._decide("block", "idempotent_no_progress_block", tool_name, repeat_count, signature)
+ record = self._no_progress.get(signature) if self._is_idempotent(tool_name) else None
+ if record is not None and record[1] >= self.config.no_progress_block_after:
+ return self._decide("block", "idempotent_no_progress_block", tool_name, record[1], signature)
return allow
def after_call(