From d64ff53672c916fe3990ca3a95df1cda905012da Mon Sep 17 00:00:00 2001 From: Nishitha M <32355027+imnishitha@users.noreply.github.com> Date: Mon, 6 Jul 2026 16:06:53 +0000 Subject: [PATCH 1/2] docs: note write_file overwrite behavior for deepagents>=0.7.0a2 Co-authored-by: open-swe[bot] --- src/oss/deepagents/overview.mdx | 8 +++++++- src/oss/deepagents/tools.mdx | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/oss/deepagents/overview.mdx b/src/oss/deepagents/overview.mdx index 8a0a4f8832..5a2825769e 100644 --- a/src/oss/deepagents/overview.mdx +++ b/src/oss/deepagents/overview.mdx @@ -290,12 +290,18 @@ The backends support the following file system operations: | ---- | ----------- | | `ls` | List files in a directory with metadata (size, modified time) | | `read_file` | Read file contents with line numbers, supports offset/limit for large files. Also supports returning multimodal content blocks for non-text files (images, video, audio, and documents). See supported extensions below. | -| `write_file` | Create new files | +| `write_file` | Create a new file, or overwrite an existing one | | `edit_file` | Perform exact string replacements in files (with global replace mode) | | `glob` | Find files matching patterns (e.g., `**/*.py`) | | `grep` | Search file contents with multiple output modes (files only, content with context, or counts) | | `execute` | Run shell commands in the environment (available with [sandbox backends](/oss/deepagents/sandboxes) only) | +:::python + + `write_file` overwrites a file if it already exists, as of `deepagents>=0.7.0a2`. On earlier versions, `write_file` errors instead — use `edit_file` to modify an existing file. + +::: + | Type | Extensions | diff --git a/src/oss/deepagents/tools.mdx b/src/oss/deepagents/tools.mdx index f1da33b740..29757c7739 100644 --- a/src/oss/deepagents/tools.mdx +++ b/src/oss/deepagents/tools.mdx @@ -78,7 +78,7 @@ In addition to the tools you provide, every Deep Agent comes with a built-in set | ---- | ----------- | | `ls` | List files in a directory | | `read_file` | Read file contents (with pagination and multimodal support) | -| `write_file` | Create new files | +| `write_file` | Create a new file, or overwrite an existing one | | `edit_file` | Perform exact string replacements in files | | `glob` | Find files matching a glob pattern | | `grep` | Search file contents | @@ -86,6 +86,12 @@ In addition to the tools you provide, every Deep Agent comes with a built-in set | `task` | Spawn a subagent to handle a delegated task | | `write_todos` | Manage a structured todo list | +:::python + + `write_file` overwrites a file if it already exists, as of `deepagents>=0.7.0a2`. On earlier versions, `write_file` errors instead — use `edit_file` to modify an existing file. + +::: + For a full breakdown of what each built-in tool does, see [Harness overview](/oss/deepagents/overview#execution-environment). ## Multimodal tool outputs From 84fae45a569813fb035e5d5c78bc3f81265aba20 Mon Sep 17 00:00:00 2001 From: Nishitha Madhu Date: Mon, 6 Jul 2026 13:08:16 -0400 Subject: [PATCH 2/2] remove unwanted chars --- src/oss/deepagents/overview.mdx | 2 +- src/oss/deepagents/tools.mdx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/oss/deepagents/overview.mdx b/src/oss/deepagents/overview.mdx index 5a2825769e..0b60ae2710 100644 --- a/src/oss/deepagents/overview.mdx +++ b/src/oss/deepagents/overview.mdx @@ -298,7 +298,7 @@ The backends support the following file system operations: :::python - `write_file` overwrites a file if it already exists, as of `deepagents>=0.7.0a2`. On earlier versions, `write_file` errors instead — use `edit_file` to modify an existing file. + `write_file` overwrites a file if it already exists, as of `deepagents>=0.7.0a2`. On earlier versions, `write_file` errors instead. Use `edit_file` to modify an existing file. ::: diff --git a/src/oss/deepagents/tools.mdx b/src/oss/deepagents/tools.mdx index 29757c7739..cf0d46b4cf 100644 --- a/src/oss/deepagents/tools.mdx +++ b/src/oss/deepagents/tools.mdx @@ -88,7 +88,7 @@ In addition to the tools you provide, every Deep Agent comes with a built-in set :::python - `write_file` overwrites a file if it already exists, as of `deepagents>=0.7.0a2`. On earlier versions, `write_file` errors instead — use `edit_file` to modify an existing file. + `write_file` overwrites a file if it already exists, as of `deepagents>=0.7.0a2`. On earlier versions, `write_file` errors instead. Use `edit_file` to modify an existing file. :::