Repository navigation
fix(runtime): file_delete description says directories are deleted recursively - #3052
Conversation
There was a problem hiding this comment.
Summary
The PR corrects the file_delete tool description in packages/runtime/src/fs-tools.ts. The implementation has always used rm(abs, { recursive: true, force: true }), so directories were already deleted recursively and a missing path was already a no-op earlier — the old description ("empty directory") was misleading. This aligns the description with the actual behavior and adds a regression test asserting both the description and the recursive delete.
Changeset
A changeset is present (.changeset/file-delete-description.md) declaring @agentproto/runtime as patch, which is the correct bump for a description/docs-only change with unchanged behavior.
Findings
No blocking or actionable findings.
- Description matches behavior:
writeAnchorperforms no existence check andrm(..., { force: true })swallowsENOENT, so "a missing path is not an error" is accurate;recursive: truebacks the "deleted recursively" wording. - Test coverage is appropriate: it asserts the description no longer mentions "empty directory", asserts
/recursive/i, and exercises a nested directory delete. file_deleteis already listed in the legacy-undocumented tools (tool-docs/legacy.ts), anddocs/design/action-hooks-entry-points-resources.mdalready describes therm recursive forcebehavior correctly, so no tool family doc drift is introduced.
Verdict
Approve — the change is accurate, well-scoped, and covered by a test.
🤖 @agentproto-bot — review · session sess_2c4bab58 (wf:agentproto-pr-review-supervised/review) · opencode / api-key · model opencode-go/deepseek-v4.1-flash · supervisor sess_df53a32a · $0.0772 · run 46562562532 · sha 53c2491d8ff62e7bacf20c271c19ef66ba1f1b4b
What
file_deletewas described as "Delete a file or empty directory in the workspace", but the handler callsrm(path, { recursive: true, force: true }): a directory is deleted with everything in it, and a missing path is not an error. The description now says exactly that. Behavior is unchanged.Why it matters
A caller reading "empty directory" can reasonably expect a non-empty directory to be refused. It is not.
Not in this PR
Whether
file_deleteshould refuse a non-empty directory (or take an explicitrecursiveflag) is a behavior change and a separate decision for the maintainer.Checks
fs-tools.test.tspins the description wording (mentions recursive, no longer says "empty directory") and that a non-empty directory is removed. It fails on the old description (expected 'Delete a file or empty directory in t…' to match /recursive/i) and passes after.fs-tools.test.ts5/5,@agentproto/runtime check-types,check-private-names: green.fsfamily doc has a pitfall quoting the old wording; I will update it in a rebase or a small follow-up.@agentproto-bot · PR · session
sess_17d12e0f(executor, skills lot 10f follow-up) · supervisorsess_c95a955c