Skip to content

[Bug]: Consecutive tool failure warning triggers unnecessarily for sandbox_read_file #36

@louisdevzz

Description

@louisdevzz

Summary

Tool failure escalation warning triggers after 3 consecutive failures, but the error message is truncated and unclear, making it difficult for users to understand what went wrong.

Affected component

tooling/ci

Severity

S2 - degraded behavior

Current behavior

When a tool fails 3 consecutive times, ZeroBuild logs a warning and sends a truncated message to the user:

2026-03-05T07:27:54.948519Z  WARN zerobuild::agent::loop_: Tool failed 3 consecutive times — escalating to user tool=sandbox_read_file failures=3
  🤖 Reply (373956ms): Tool 'sandbox_read_file' failed 3 consecutive times. I'm having trouble with thi...

The message is cut off ("I'm having trouble with thi...") and does not provide actionable information about:

  • Why the tool failed
  • What the error was
  • How to fix it

Expected behavior

  1. The escalation message should be complete (not truncated)
  2. Should include the actual error reason from the last failure
  3. Should provide context about which file/operation failed
  4. Should suggest next steps or alternative approaches

Steps to reproduce

  1. Start a ZeroBuild session
  2. Trigger sandbox_read_file on a non-existent or inaccessible file 3 times
  3. Observe the truncated escalation message

Impact

Affected users: All users encountering tool failures
Frequency: Whenever a tool fails 3+ times
Consequence: Users cannot understand why the tool failed or how to fix it; debugging is difficult

Logs / stack traces

2026-03-05T07:27:54.948519Z  WARN zerobuild::agent::loop_: Tool failed 3 consecutive times — escalating to user tool=sandbox_read_file failures=3
  🤖 Reply (373956ms): Tool 'sandbox_read_file' failed 3 consecutive times. I'm having trouble with thi...

ZeroBuild version

Latest main branch (2026-03-05)

Rust version

rustc 1.93.0

Operating system

macOS 15

Regression?

Unknown

Pre-flight checks

  • I reproduced this on the latest main branch or latest release.
  • I redacted secrets/tokens from logs.
  • I removed personal identifiers and replaced identity-specific data with neutral placeholders.

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions