fix(write-existing-file-guard): defer realpath/existsSync to first tool call

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
YeonGyu-Kim
2026-04-18 14:11:03 +09:00
parent a6e3c6a5ed
commit a4c45e2770
3 changed files with 15 additions and 6 deletions
@@ -59,7 +59,7 @@ describe("createWriteExistingFileGuardHook", () => {
).rejects.toThrow("File already exists. Use edit tool instead.")
// then
expect(existsSyncMock).toHaveBeenCalledTimes(2)
expect(realpathNativeMock).toHaveBeenCalledTimes(1)
expect(existsSyncMock).toHaveBeenCalledTimes(3)
expect(realpathNativeMock).toHaveBeenCalledTimes(2)
})
})