Skip to content

A0 CLI session corruption with Agent Zero #1681

@StirlingGoetz

Description

@StirlingGoetz

When attempting to use both Agent Zero v1.18 and A0 CLI v1.12 (on Windows) to accomplish the following with Kimi K2.6 driving both. I know y'all are looking for feedback. This was the mission of my prompt:

Systematically optimize LM Studio load parameters and model inference parameters for the Qwen3.6-27B model (loaded as qwen36-test) to achieve the highest possible score on a strict agentic coding benchmark. Test across multiple quantization levels (Q4_0, Q4_K_S, Q4_K_M, Q5_K_M, etc.) and context sizes to find the best achievable configuration for a 24GB VRAM budget (RTX 3090).

Technical issues (assuming software bug) seen which prevented success:

  • A0 CLI session fractures - I kept seeing session or communication corruption between the two resulting in garbled text in the Windows Terminal PowerShell (latest) terminal. I tried uninstalling/reinstalling the A0 CLI, cache clearing, etc. But couldn't make it work.
  • Agent Zero complaining that Code-exec was not enabled in the terminal when it actually was enabled.

Key points for the developers (from Agent Zero, so some of these could be incorrect):

  • Root cause: A0 CLI v1.12 is the latest release but Agent Zero Docker v1.18 is 6 versions ahead — protocol mismatch
  • Terminal corruption: Server sends UTF-8/markdown-rich payloads; CLI v1.12 misinterprets as raw ANSI → raw binary dumped to terminal
  • AsyncIO bug: RuntimeWarning: coroutine 'AgentZeroCLI._dispatch_command' was never awaited — unawaited coroutine leaks
  • 30-second timeout: code_execution_remote hard-capped at 30s; long host operations orphan processes and block subsequent commands
  • VT mode pollution: Multi-line scripts put terminal into raw VT mode; on disconnect it's not restored to cooked mode
  • Reproduction: Any multi-line code_execution_remote >30s or with rich Unicode output triggers corruption + disconnect
  • Verified fixes failed: a0 update, uv cache clean + reinstall, UTF-8 encoding, Windows Terminal, direct LAN — all still get v1.12
  • Requested fix: Publish A0 CLI v1.18 (or compatible) matching Docker protocol
  • Secondary requests: Extend timeout, auto-kill orphans, restore cooked mode on disconnect, version mismatch warning at handshake

A0 CLI v1.12 ↔ Agent Zero Docker v1.18 — Protocol Mismatch Bug Report

Environment

  • Host: Windows 11, PowerShell 7.6.2, RTX 3090
  • Agent Zero: Docker agent0ai/agent-zero v1.18 (2026-05-26)
  • A0 CLI: v1.12 (latest available via uv tool install / a0 update)
  • Connection: Direct virtual networking (http://192.168.50.96:50001), no Flare Tunnel
  • _a0_connector: Present in container at /a0/plugins/_a0_connector/

Core Issue: 6-Version Protocol Gap

Component Version Status
Agent Zero Docker v1.18 Latest
A0 CLI v1.12 Latest available (git HEAD = v1.12)
Gap 6 releases CLI has no v1.13–v1.18 release

Result: Docker sends wire-format data CLI v1.12 cannot parse → terminal corruption + disconnects.


Symptom 1: Terminal Corruption (Raw ANSI Dump)

CLI prints raw binary/ANSI escape sequences instead of parsing server messages:

Main other/syn:large:vision Utility other/syn:small:vision Max Power
I[555;82;1M[555;81;1M[555;80;1M...
ParserError: Line 1 argument: 3

Root cause: Server v1.18 sends UTF-8/markdown-rich payloads; CLI v1.12 misinterprets them as raw terminal input.


Symptom 2: Python AsyncIO Bug

RuntimeWarning: coroutine 'AgentZeroCLI._dispatch_command' was never awaited

Impact: Unawaited coroutine leaks; likely contributes to connection state desync.


Symptom 3: Remote Execution Session Instability

  • 30-second hard timeout on code_execution_remote terminal sessions
  • Long-running host commands (>30s) return "Returning control to agent..." but process continues orphaned
  • Subsequent commands fail with "Terminal session 0 might be still running" until manual reset
  • Old python.exe processes accumulate, blocking new terminal sessions

Impact: Cannot run benchmarks (~100–180s GPU inference) or file operations reliably.


Symptom 4: VT Mode Pollution

Multi-line PowerShell/Python scripts sent via code_execution_remote put the terminal into raw VT input mode. On disconnect, the terminal is not restored to "cooked" mode, causing all subsequent data to render as corrupted ANSI sequences.

Workaround: User must run [Console]::ResetColor(); Clear-Host or Write-Host "$([char]27)c" to recover.


Reproduction Steps

  1. docker run -d -p 50001:80 --name agent-zero agent0ai/agent-zero:latest (v1.18)
  2. uv tool install --upgrade git+https://github.com/agent0ai/a0-connector → installs v1.12
  3. a0 → connect to http://192.168.50.96:50001
  4. Press F3 (R/W), F4 (Remote Exec)
  5. Send any multi-line code_execution_remote command >30s or with rich Unicode output
  6. Terminal corrupts; CLI disconnects; remote exec unavailable until restart

Verified Fixes Attempted (Failed)

Fix Result
a0 update Reinstalls v1.12 (same version)
uv cache clean + force reinstall Same v1.12
[Console]::OutputEncoding = UTF8 Helps rendering but not protocol parsing
Windows Terminal (vs legacy PS) Same corruption
Direct LAN connection (no tunnel) Same corruption

Requested Fix

Publish A0 CLI v1.18 (or compatible release) that matches the Docker image protocol. The git repo HEAD is still tagged v1.12 — no newer CLI exists.

Alternative: Document that Docker v1.18 requires CLI ≥ v1.18 and provide downgrade path:

docker pull agent0ai/agent-zero:v1.12

Secondary Requests

  1. Extend code_execution_remote timeout beyond 30s for long host operations
  2. Auto-kill orphaned processes on session reset
  3. Restore terminal to cooked mode on disconnect to prevent VT pollution
  4. Surface version mismatch warning in a0 connection handshake

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions