entropy-0x
f79cb77224
fix(tools): reject V4A Add File onto an existing path
...
A V4A `*** Add File:` operation is meant to create a new file. The apply
path called `write_file` unconditionally and `_validate_operations` had no
pre-check for ADD, so an Add targeting a path that already existed
overwrote the file with only the patch's `+` lines, returned success, and
emitted a `--- /dev/null` diff that hid what was lost. Models frequently
confuse Add with Update, so this destroyed existing file contents with no
error. The MOVE path already guards its destination against clobbering;
ADD now follows the same rule.
Makes a V4A `Add File` operation fail when its target already exists,
instead of silently overwriting the existing file. Validation now rejects
the operation before any write happens, so the two-phase
validate-then-apply contract ("no files were modified" on a validation
failure) holds for ADD as it already does for UPDATE/MOVE/DELETE. A
matching re-check in the apply phase closes the validate-to-apply race.
N/A
- [x] 🐛 Bug fix (non-breaking change that fixes an issue)
- `tools/patch_parser.py`: add an ADD branch in `_validate_operations`
that errors when `read_file_raw` finds an existing file, and a
defensive existence re-check in `_apply_add` before `write_file`,
mirroring the existing MOVE destination guard.
- `tests/tools/test_patch_parser.py`: add a test asserting an Add onto an
existing path fails validation and leaves the original bytes unwritten;
add `read_file_raw` to three ADD-path LSP fakes so they match the real
`file_ops` interface now exercised on ADD.
1. Build a V4A patch with `*** Add File: <path>` where `<path>` already
exists on disk.
2. Apply it via `apply_v4a_operations`. Before this change the file is
overwritten with the patch's `+` lines and the result is success;
after, the result is a validation failure and the file is untouched.
3. Run `scripts/run_tests.sh tests/tools/test_patch_parser.py` —
`TestApplyOperations::test_add_onto_existing_file_fails_and_preserves_contents`
covers the regression.
- [x] I've read the [Contributing Guide](https://github.com/NousResearch/hermes-agent/blob/main/CONTRIBUTING.md )
- [x] My commit messages follow [Conventional Commits](https://www.conventionalcommits.org/ ) (`fix(scope):`, `feat(scope):`, etc.)
- [x] I searched for [existing PRs](https://github.com/NousResearch/hermes-agent/pulls ) to make sure this isn't a duplicate
- [x] My PR contains **only** changes related to this fix/feature (no unrelated commits)
- [x] I've run `pytest tests/ -q` and all tests pass
- [x] I've added tests for my changes (required for bug fixes, strongly encouraged for features)
- [x] I've tested on my platform: macOS 15 (Darwin 25.5.0)
- [x] I've updated relevant documentation (README, `docs/`, docstrings) — or N/A
- [x] I've updated `cli-config.yaml.example` if I added/changed config keys — or N/A
- [x] I've updated `CONTRIBUTING.md` or `AGENTS.md` if I changed architecture or workflows — or N/A
- [x] I've considered cross-platform impact (Windows, macOS) per the [compatibility guide](https://github.com/NousResearch/hermes-agent/blob/main/CONTRIBUTING.md#cross-platform-compatibility ) — or N/A
- [x] I've updated tool descriptions/schemas if I changed tool behavior — or N/A
2026-09-12 21:13:40 -07:00
..
2026-09-04 07:17:00 -07:00
2026-09-03 02:27:52 +05:30
2026-09-01 12:07:52 -07:00
2026-08-23 20:07:21 -07:00
2026-09-03 13:30:27 -07:00
2026-09-07 08:13:38 -07:00
2026-09-03 13:49:57 -07:00
2026-09-03 13:49:57 -07:00
2026-09-07 14:30:41 -07:00
2026-09-05 06:07:21 -07:00
2026-09-03 13:49:57 -07:00
2026-09-03 13:49:57 -07:00
2026-09-03 13:49:57 -07:00
2026-09-03 13:49:57 -07:00
2026-09-03 13:49:57 -07:00
2026-09-03 13:49:57 -07:00
2026-09-12 21:12:18 -07:00
2026-08-23 18:25:19 -07:00
2026-09-05 06:12:37 -07:00
2026-09-11 06:24:54 -07:00
2026-09-12 20:43:42 -07:00
2026-09-11 11:19:53 +05:30
2026-09-03 13:30:27 -07:00
2026-09-03 13:49:57 -07:00
2026-08-23 03:57:43 -07:00
2026-08-24 00:57:15 +05:30
2026-09-10 10:27:07 -07:00
2026-09-10 10:27:07 -07:00
2026-09-06 13:08:31 -07:00
2026-09-07 08:15:32 -07:00
2026-08-24 03:21:37 -07:00
2026-09-10 10:27:07 -07:00
2026-08-24 03:21:37 -07:00
2026-08-24 03:21:37 -07:00
2026-09-03 14:18:25 -07:00
2026-09-03 14:18:25 -07:00
2026-09-03 14:18:25 -07:00
2026-09-03 14:18:25 -07:00
2026-09-03 14:18:25 -07:00
2026-09-03 14:18:25 -07:00
2026-09-12 08:43:28 -07:00
2026-09-03 14:18:25 -07:00
2026-09-03 14:25:33 -07:00
2026-09-03 14:18:25 -07:00
2026-09-03 14:18:25 -07:00
2026-08-24 20:11:18 -07:00
2026-09-03 14:18:25 -07:00
2026-09-03 14:18:25 -07:00
2026-08-26 19:25:33 -07:00
2026-09-03 14:18:25 -07:00
2026-09-03 14:18:25 -07:00
2026-09-03 14:18:25 -07:00
2026-09-03 14:18:25 -07:00
2026-09-03 14:18:25 -07:00
2026-09-03 14:18:25 -07:00
2026-09-03 14:18:25 -07:00
2026-09-03 14:18:25 -07:00
2026-09-03 14:18:25 -07:00
2026-09-03 14:18:25 -07:00
2026-09-06 23:31:05 +05:30
2026-09-03 14:18:25 -07:00
2026-09-08 05:10:57 -07:00
2026-09-08 05:10:57 -07:00
2026-09-10 10:35:07 -07:00
2026-09-03 14:18:25 -07:00
2026-09-03 14:18:25 -07:00
2026-09-03 14:18:25 -07:00
2026-09-03 14:18:25 -07:00
2026-09-03 14:18:25 -07:00
2026-09-10 10:35:07 -07:00
2026-09-03 14:18:25 -07:00
2026-08-23 18:27:15 -07:00
2026-09-02 14:44:15 -07:00
2026-09-07 06:00:46 -07:00
refactor(tools): first-wave simplification of tools/ (file ops split, lazy_deps, code_exec, approval, browser, delegate, mcp, skills, terminal, voice, media)
2026-09-02 14:43:45 -07:00
2026-08-26 16:42:44 -07:00
2026-09-07 07:05:59 -07:00
2026-09-03 13:49:57 -07:00
2026-08-28 23:10:01 -07:00
2026-09-03 13:24:04 -07:00
2026-09-03 13:24:04 -07:00
2026-09-03 13:24:04 -07:00
2026-09-05 18:46:53 +05:30
2026-09-10 10:35:07 -07:00
2026-09-03 13:49:57 -07:00
2026-09-07 08:25:33 -07:00
2026-09-03 13:22:51 -07:00
2026-09-03 13:22:51 -07:00
2026-09-03 13:22:51 -07:00
2026-09-03 13:22:51 -07:00
2026-09-03 13:22:51 -07:00
2026-09-03 17:45:53 -07:00
2026-08-25 02:31:34 -07:00
2026-09-03 13:22:51 -07:00
2026-09-03 13:22:51 -07:00
2026-09-07 22:47:33 +05:30
2026-09-10 02:21:16 +05:30
2026-09-10 02:21:16 +05:30
2026-09-10 02:21:16 +05:30
2026-09-10 02:21:16 +05:30
2026-09-10 02:21:16 +05:30
2026-09-10 02:21:16 +05:30
2026-09-03 13:24:04 -07:00
2026-09-11 19:39:12 -07:00
2026-09-03 13:49:57 -07:00
2026-09-03 13:30:27 -07:00
2026-09-09 12:17:13 +05:30
2026-09-03 13:49:57 -07:00
2026-09-09 12:17:13 +05:30
2026-09-12 20:57:21 -07:00
2026-08-28 06:36:22 -07:00
2026-09-01 22:28:52 -07:00
refactor(tools): first-wave simplification of tools/ (file ops split, lazy_deps, code_exec, approval, browser, delegate, mcp, skills, terminal, voice, media)
2026-09-02 14:43:45 -07:00
2026-09-10 02:21:15 +05:30
2026-09-09 10:55:32 -07:00
2026-09-06 05:03:20 -07:00
2026-08-27 07:38:53 -07:00
2026-08-30 05:16:10 -07:00
2026-09-06 02:20:49 -07:00
2026-09-06 10:36:08 -07:00
2026-09-03 02:35:37 -07:00
2026-09-07 05:57:26 -07:00
2026-09-07 08:08:41 -07:00
2026-09-08 02:26:05 +05:30
2026-09-08 13:38:18 -07:00
2026-09-07 07:10:28 -07:00
2026-08-31 01:02:42 -07:00
2026-09-07 06:15:43 -07:00
2026-09-05 06:18:41 -07:00
2026-09-01 12:07:52 -07:00
2026-09-08 02:26:05 +05:30
2026-09-03 19:33:28 -07:00
2026-08-29 18:23:07 -07:00
2026-08-31 21:11:11 -05:00
2026-09-09 02:36:00 -07:00
2026-09-05 21:00:19 +05:30
2026-09-05 18:32:44 +05:30
2026-09-03 13:24:04 -07:00
2026-09-05 21:07:14 +05:30
2026-09-03 13:24:04 -07:00
2026-09-11 15:29:15 -07:00
2026-09-07 07:10:28 -07:00
2026-09-07 06:12:24 -07:00
2026-09-03 13:49:57 -07:00
2026-09-09 11:46:36 -07:00
2026-09-12 20:52:49 -07:00
2026-09-12 20:52:49 -07:00
2026-09-05 19:06:57 +05:30
2026-09-12 20:52:49 -07:00
2026-09-11 15:44:00 -07:00
2026-09-03 13:30:27 -07:00
2026-09-03 13:30:27 -07:00
2026-09-05 20:49:29 +05:30
2026-09-07 06:02:41 -07:00
2026-09-07 06:02:41 -07:00
2026-09-03 13:24:04 -07:00
2026-09-03 13:30:27 -07:00
2026-09-05 18:03:05 +05:30
2026-09-03 13:30:27 -07:00
2026-09-07 00:20:11 +05:30
2026-09-11 15:29:15 -07:00
2026-09-03 13:24:04 -07:00
2026-09-08 02:26:39 +05:30
2026-09-10 05:02:41 -07:00
2026-09-03 13:49:57 -07:00
2026-09-07 07:10:28 -07:00
2026-09-03 13:53:03 -07:00
2026-08-28 03:58:52 -07:00
2026-09-03 13:10:38 -07:00
2026-09-09 11:46:36 -07:00
2026-09-02 14:45:15 -07:00
2026-09-03 04:56:59 +05:30
2026-09-03 13:48:14 -07:00
2026-09-07 07:10:28 -07:00
2026-09-07 14:16:57 -07:00
2026-09-03 13:48:14 -07:00
2026-09-09 12:18:58 -07:00
2026-09-12 12:32:55 -07:00
2026-09-07 06:05:51 -07:00
2026-09-02 00:03:55 -07:00
2026-09-03 13:30:27 -07:00
2026-08-31 20:43:00 -05:00
2026-09-03 14:00:59 -07:00
2026-09-03 14:00:59 -07:00
2026-08-25 01:34:56 +05:30
2026-08-28 07:50:33 -07:00
2026-09-03 13:10:52 -07:00
2026-09-07 14:10:46 -07:00
2026-09-09 11:46:36 -07:00
2026-09-02 22:12:25 -07:00
2026-09-12 10:00:06 +05:30
2026-09-03 13:29:55 -07:00
2026-09-03 13:29:55 -07:00
2026-09-12 09:05:56 -07:00
2026-09-03 13:29:55 -07:00
2026-09-03 13:29:55 -07:00
2026-09-03 13:29:55 -07:00
2026-09-07 08:22:35 -07:00
2026-09-03 13:29:55 -07:00
2026-09-05 17:00:18 -07:00
2026-09-07 22:47:33 +05:30
2026-09-03 13:29:55 -07:00
2026-09-03 13:29:55 -07:00
2026-09-03 13:29:55 -07:00
2026-09-03 13:29:55 -07:00
2026-09-03 13:29:55 -07:00
2026-09-03 13:29:55 -07:00
2026-09-03 13:29:55 -07:00
2026-09-07 07:04:52 -07:00
2026-09-03 13:29:55 -07:00
2026-09-11 15:27:23 -07:00
2026-09-03 13:29:55 -07:00
2026-08-28 20:16:26 -07:00
2026-09-08 17:44:51 -07:00
2026-09-02 14:45:42 -07:00
2026-09-07 08:22:35 -07:00
2026-09-03 13:29:55 -07:00
2026-09-03 13:29:55 -07:00
2026-09-03 13:29:55 -07:00
2026-09-03 13:29:55 -07:00
2026-09-03 13:29:55 -07:00
2026-09-03 13:29:55 -07:00
2026-08-26 08:40:07 -07:00
2026-09-03 13:29:55 -07:00
2026-09-03 13:29:55 -07:00
2026-09-03 13:29:55 -07:00
2026-09-03 13:29:55 -07:00
2026-09-12 21:05:29 -07:00
2026-09-03 13:29:55 -07:00
2026-09-02 14:44:15 -07:00
2026-09-03 13:29:55 -07:00
2026-09-09 11:27:29 -07:00
2026-09-03 13:29:55 -07:00
2026-09-03 13:29:55 -07:00
2026-09-03 13:29:55 -07:00
2026-09-03 13:29:55 -07:00
2026-09-03 13:29:55 -07:00
2026-09-12 08:23:28 -07:00
2026-09-10 18:12:39 -07:00
2026-09-03 13:29:55 -07:00
2026-09-03 13:29:55 -07:00
2026-09-03 13:30:27 -07:00
2026-09-12 20:43:42 -07:00
2026-08-26 02:54:35 +05:30
2026-09-05 19:01:22 +05:30
2026-09-07 14:10:46 -07:00
2026-09-12 01:35:05 -07:00
2026-09-11 15:26:46 -07:00
2026-09-11 15:44:00 -07:00
2026-09-11 19:39:12 -07:00
2026-09-03 13:24:04 -07:00
2026-09-07 08:25:33 -07:00
2026-08-28 23:10:01 -07:00
2026-09-03 02:05:42 +05:30
2026-09-03 13:30:27 -07:00
2026-09-12 21:13:40 -07:00
2026-08-28 12:59:41 -07:00
2026-09-03 13:22:48 -07:00
2026-09-03 13:17:25 -07:00
2026-09-01 02:32:53 -07:00
2026-09-09 10:56:37 +05:30
2026-09-07 12:50:29 -07:00
2026-09-02 14:43:45 -07:00
2026-08-28 08:46:11 -07:00
2026-09-03 13:30:27 -07:00
2026-08-28 23:10:01 -07:00
2026-09-11 19:50:46 -07:00
2026-09-01 10:56:49 -07:00
2026-09-03 19:33:28 -07:00
2026-09-03 13:10:52 -07:00
2026-08-26 04:51:41 -07:00
2026-09-07 06:12:24 -07:00
2026-09-07 08:14:51 -07:00
2026-09-03 13:29:55 -07:00
2026-09-03 13:10:52 -07:00
2026-09-03 13:10:52 -07:00
2026-09-03 13:10:52 -07:00
2026-09-03 04:56:59 +05:30
2026-09-03 03:18:44 +05:30
2026-09-07 14:10:46 -07:00
2026-09-07 00:28:46 +05:30
2026-09-07 00:28:46 +05:30
2026-08-27 07:33:36 -07:00
2026-09-10 18:17:22 -07:00
2026-09-03 13:38:36 -07:00
2026-09-08 17:51:35 +10:00
2026-09-03 13:30:27 -07:00
2026-09-11 11:54:49 -07:00
2026-09-11 11:54:49 -07:00
2026-09-03 13:30:27 -07:00
2026-09-11 06:24:11 -07:00
2026-08-29 17:58:51 -07:00
2026-08-25 04:00:27 -07:00
2026-09-03 13:49:57 -07:00
2026-09-03 13:24:04 -07:00
2026-09-03 13:22:48 -07:00
2026-09-01 07:32:45 -07:00
2026-09-11 15:29:15 -07:00
2026-09-03 13:27:01 -07:00
2026-09-04 08:15:22 -07:00
2026-08-29 19:38:31 +05:30
2026-09-11 11:54:49 -07:00
2026-09-03 13:27:01 -07:00
2026-09-09 12:19:13 +05:30
2026-09-11 11:54:49 -07:00
2026-09-11 11:54:49 -07:00
2026-08-28 03:24:43 -07:00
2026-09-12 05:09:26 -07:00
2026-09-03 13:22:48 -07:00
2026-09-12 07:54:04 -07:00
2026-09-12 07:54:04 -07:00
2026-09-03 13:27:01 -07:00
2026-09-06 07:17:03 -07:00
2026-09-11 11:54:49 -07:00
2026-09-03 13:27:01 -07:00
2026-09-11 11:54:49 -07:00
2026-09-03 13:49:57 -07:00
2026-09-03 13:49:57 -07:00
2026-09-03 13:24:04 -07:00
2026-09-03 13:24:04 -07:00
2026-09-02 13:30:10 -07:00
2026-09-06 13:32:51 +05:30
2026-09-06 05:36:26 -07:00
2026-09-03 13:17:25 -07:00
2026-09-03 13:17:25 -07:00
2026-09-03 13:17:25 -07:00
2026-09-07 12:50:29 -07:00
2026-09-10 10:23:12 -07:00
2026-09-11 11:19:53 +05:30
2026-09-03 22:00:01 -07:00
2026-09-11 11:54:49 -07:00
2026-08-31 10:42:39 -07:00
2026-09-03 13:24:04 -07:00
2026-09-05 21:00:19 +05:30
2026-09-11 15:29:15 -07:00
2026-09-12 20:55:04 -07:00
2026-09-03 13:24:04 -07:00
2026-09-03 13:24:04 -07:00
2026-09-05 06:30:33 -07:00
2026-09-03 13:24:04 -07:00
2026-09-03 13:24:04 -07:00
2026-09-03 13:24:04 -07:00
2026-09-03 14:42:20 -07:00
2026-09-03 13:24:04 -07:00
2026-09-11 15:29:15 -07:00
2026-09-03 13:24:04 -07:00
2026-09-05 13:51:06 -07:00
2026-09-03 13:24:04 -07:00
2026-09-11 11:19:53 +05:30
2026-09-11 15:44:00 -07:00
2026-09-05 13:51:06 -07:00
2026-09-03 13:24:04 -07:00
2026-08-29 20:39:31 -07:00
2026-09-01 21:49:14 -07:00
2026-09-02 23:19:42 -07:00
2026-08-29 07:25:12 -07:00
2026-08-28 08:58:12 -07:00
2026-08-29 18:40:51 -07:00
2026-09-10 02:21:16 +05:30
2026-09-10 02:21:16 +05:30
2026-09-11 19:39:12 -07:00
2026-09-10 02:21:16 +05:30
2026-09-10 02:21:15 +05:30
2026-09-01 21:50:19 -07:00
2026-09-03 13:17:25 -07:00
2026-09-03 13:17:25 -07:00
2026-09-03 13:17:25 -07:00
2026-09-03 13:17:25 -07:00
2026-09-07 08:09:20 -07:00
2026-09-05 18:46:16 +05:30
2026-09-03 13:20:22 -07:00
2026-09-03 13:20:22 -07:00
2026-09-03 13:20:22 -07:00
2026-09-03 13:20:22 -07:00
2026-09-03 13:20:22 -07:00
2026-09-03 13:20:22 -07:00
2026-09-03 13:20:22 -07:00
2026-09-03 13:20:22 -07:00
2026-09-03 13:20:22 -07:00
2026-09-03 13:20:22 -07:00
2026-09-03 00:51:58 -07:00
2026-09-03 13:20:22 -07:00
2026-09-03 13:20:22 -07:00
2026-09-02 06:48:31 -07:00
2026-09-02 14:45:15 -07:00
2026-09-03 13:20:22 -07:00
2026-09-03 13:20:22 -07:00
2026-09-03 13:20:22 -07:00
2026-09-02 14:45:15 -07:00
2026-09-03 13:20:22 -07:00
2026-09-03 13:20:22 -07:00
2026-09-03 13:20:22 -07:00
2026-09-12 13:44:52 -07:00
2026-08-28 05:10:33 -07:00
2026-08-28 05:10:33 -07:00
2026-09-09 11:46:36 -07:00
2026-09-03 00:57:40 -07:00
2026-09-03 13:07:34 -07:00
2026-09-03 13:30:31 -07:00
2026-08-23 03:54:52 -07:00
2026-09-03 09:35:38 -07:00
2026-09-03 13:30:31 -07:00
2026-09-03 13:30:31 -07:00
2026-09-03 13:24:36 -07:00
2026-09-03 13:30:27 -07:00
2026-09-03 13:08:53 -07:00
2026-09-01 10:56:49 -07:00
2026-09-03 13:08:53 -07:00
2026-08-31 00:56:41 -07:00
2026-08-31 00:56:41 -07:00
2026-08-31 00:56:41 -07:00
2026-08-31 00:56:41 -07:00
2026-09-03 14:18:25 -07:00
2026-09-03 13:08:53 -07:00
2026-09-03 13:04:17 -07:00
2026-09-04 07:17:00 -07:00
2026-09-03 13:08:53 -07:00
2026-09-03 13:08:53 -07:00
2026-09-03 13:22:48 -07:00
2026-09-02 14:44:15 -07:00
2026-09-03 17:28:02 -07:00
2026-09-03 13:10:52 -07:00
2026-09-05 02:01:04 -07:00
2026-09-03 19:33:28 -07:00
2026-09-03 13:49:57 -07:00
2026-09-07 04:38:59 -07:00