Skip to content

fix(runtime): file_delete description says directories are deleted recursively - #3052

Merged
agentiknet merged 1 commit into
mainfrom
wt/fix-file-delete-description
Dec 1, 2026
Merged

agentiknet merged 1 commit into
mainfrom
wt/fix-file-delete-description

Conversation

@agentiknet

Copy link
Copy Markdown
Contributor

What

file_delete was described as "Delete a file or empty directory in the workspace", but the handler calls rm(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_delete should refuse a non-empty directory (or take an explicit recursive flag) is a behavior change and a separate decision for the maintainer.

Checks

  • New test in fs-tools.test.ts pins 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.ts 5/5, @agentproto/runtime check-types, check-private-names: green.
  • Follow-up after feat(skills): fs, browser, panels, daemon-status and introspection tool family docs (lot 10f) #3051 merges: its fs family 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) · supervisor sess_c95a955c

@ponytail-coder ponytail-coder Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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: writeAnchor performs no existence check and rm(..., { force: true }) swallows ENOENT, so "a missing path is not an error" is accurate; recursive: true backs 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_delete is already listed in the legacy-undocumented tools (tool-docs/legacy.ts), and docs/design/action-hooks-entry-points-resources.md already describes the rm recursive force behavior 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

@agentiknet
agentiknet merged commit 6cebdc8 into main Dec 1, 2026
19 checks passed
@agentiknet
agentiknet deleted the wt/fix-file-delete-description branch December 1, 2026 05:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant