mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
fix(file_tools): refresh staleness timestamp after writes (#4390)
After a successful write_file or patch, update the stored read timestamp to match the file's new modification time. Without this, consecutive edits by the same task (read → write → write) would false-warn on the second write because the stored timestamp still reflected the original read, not the first write. Also renames the internal tracker key from 'file_mtimes' to 'read_timestamps' for clarity.
This commit is contained in:
parent
83dec2b3ec
commit
ef2ae3e48f
2 changed files with 36 additions and 7 deletions
|
|
@ -221,7 +221,7 @@ class TestCheckFileStalenessHelper(unittest.TestCase):
|
|||
_read_tracker["t1"] = {
|
||||
"last_key": None, "consecutive": 0,
|
||||
"read_history": set(), "dedup": {},
|
||||
"file_mtimes": {"/tmp/other.py": 12345.0},
|
||||
"read_timestamps": {"/tmp/other.py": 12345.0},
|
||||
}
|
||||
self.assertIsNone(_check_file_staleness("/tmp/x.py", "t1"))
|
||||
|
||||
|
|
@ -231,7 +231,7 @@ class TestCheckFileStalenessHelper(unittest.TestCase):
|
|||
_read_tracker["t1"] = {
|
||||
"last_key": None, "consecutive": 0,
|
||||
"read_history": set(), "dedup": {},
|
||||
"file_mtimes": {"/nonexistent/path": 99999.0},
|
||||
"read_timestamps": {"/nonexistent/path": 99999.0},
|
||||
}
|
||||
# File doesn't exist → stat fails → returns None (let write handle it)
|
||||
self.assertIsNone(_check_file_staleness("/nonexistent/path", "t1"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue