Storm 6fd819f0a7
fix(sandbox): surface missing-file AIO reads as actionable errors (#6834)
* fix(sandbox): surface missing-file AIO reads as actionable errors

When read_file targets a nonexistent file, the AIO server returns an error
envelope with data: {}, which the agent-sandbox SDK cannot parse into its
required FileReadResult fields. The resulting pydantic ValidationError text
became the model-visible tool result ("Error: 2 validation errors for
ResponseFileReadResult ..."), so the agent could not tell the file simply
does not exist and kept retrying or "fixing" nonexistent problems.

Catch ValidationError in AioSandbox.read_file and return an explicit
"Error: file not found or unreadable: <path>" instead. The branch is logged
at debug level: a missing file is an expected outcome, since
ReadBeforeWriteMiddleware probes every new-file write before allowing it, and
the previous error-level logging produced noisy gateway logs on that benign
path. Other exceptions keep the error log and the generic error string.

Fixes bytedance/deer-flow#6833

* docs(aio): align regression test reference style

---------

Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
2026-10-14 08:58:52 +08:00
..