Skip to content

AgentZero Autonomy Reliability Issues (Observed/Evidence/Risk) #1088

Description

@peretzrickett

Analyzed target: agent0ai/agent-zero
Refresh baseline: origin/main at commit 8902d3a

possible related issues:
#1011 Agent0 stuck repeat loop after tool hangs (no recovery restart).
#97 Loops creating agents endlessly.
#624 Stuck loop 'Message misformat, no valid tool request'.
#93 Memory tool problems.
#717 Message display issues, code text leaking.
#1033 Backend freezes.

1) No hard stop for monologue/tool loops

  • Observed
    • Agent.monologue() runs an open-ended while True loop and increments loop_data.iteration without a configured max iteration/runtime stop.
    • Repeated malformed tool JSON produces warnings but no automatic loop breaker.
  • Evidence
    • agent.py (loop_data.iteration += 1, tool-processing misformat fallback path).
  • Risk
    • Infinite or very long self-repair loops can consume tokens, time, and budget.

2) Tool args have no size policy

  • Observed
    • Tool request extraction accepts arbitrary JSON from model output.
    • No global policy for oversized tool_args payloads.
  • Evidence
    • python/helpers/extract_tools.py, agent.py tool parse/dispatch path.
  • Risk
    • Large payloads can bloat context, increase parse failures, and degrade reliability.

3) History compression behavior is mostly hardcoded

  • Observed
    • Compression ratios are module constants, not runtime-configurable.
    • Compression is async/background-driven, then awaited only when over limit.
  • Evidence
    • python/helpers/history.py constants (CURRENT_TOPIC_RATIO, HISTORY_TOPIC_RATIO, HISTORY_BULK_RATIO, CURRENT_TOPIC_ATTENTION_COMPRESSION, HISTORY_TOPIC_ATTENTION_COMPRESSION, COMPRESSION_TARGET_RATIO).
    • python/extensions/message_loop_end/_10_organize_history.py
    • python/extensions/message_loop_prompts_before/_90_organize_history_wait.py
  • Risk
    • Fixed compression behavior may not fit different models/context sizes and can produce unstable long-run behavior.

4) Code execution timeouts are fixed constants

  • Observed
    • Code execution timeout values are static constants.
    • Output truncation threshold is also hardcoded.
  • Evidence
    • python/tools/code_execution_tool.py (CODE_EXEC_TIMEOUTS, OUTPUT_TIMEOUTS, truncation path).
  • Risk
    • Long-running tasks may terminate too early; short tasks may still incur inappropriate wait behavior.

5) Subordinate-agent depth/call count is unbounded

  • Observed
    • call_subordinate invokes subordinate.monologue() without depth/call budget enforcement.
  • Evidence
    • python/tools/call_subordinate.py
  • Risk
    • Delegation chains can run away and amplify failure loops.

6) Queue/backpressure controls are missing

  • Observed
    • Queue append path has no explicit item-count/size ceiling.
    • Aggregated send concatenates all queued text.
  • Evidence
    • python/helpers/message_queue.py
  • Risk
    • Queue growth can produce oversized prompt payloads and burst processing load.

7) Memory-load tool lacks guardrails on requested limit

  • Observed
    • memory_load.execute() accepts caller-provided limit without local clamp.
    • Recall extension path is constrained by settings, but ad-hoc memory tool calls are less constrained.
  • Evidence
    • python/tools/memory_load.py
    • python/extensions/message_loop_prompts_after/_50_recall_memories.py (guarded recall path)
  • Risk
    • Excessive memory retrieval can inflate responses and increase latency/failure probability.

8) Timeout coverage is uneven across subsystems

  • Observed
    • MCP init/tool timeout settings exist, but equivalent runtime-budget controls are not consistently present across monologue/subordinate/queue paths.
  • Evidence
    • python/helpers/settings.py includes mcp_client_init_timeout, mcp_client_tool_timeout.
  • Risk
    • Reliability varies by subsystem; long-running behavior becomes inconsistent and harder to reason about.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions