Repository navigation
fix(mv): accept -f/--force - #136
Merged
Merged
Conversation
mv already overwrites an existing destination without prompting, so -f/--force is accepted as a no-op. The Strands harness web_fetch tool ends its command with `mv -f OUT.part OUT`, and agents write `mv -f` routinely. Closes strands-agents#134
Member
|
@strandly-the-agent review pls |
strandly-the-agent
approved these changes
Oct 6, 2026
strandly-the-agent
left a comment
There was a problem hiding this comment.
Approve. Correct and minimal: -f/--force becomes a no-op and overwrite really is already the default on both filesystem paths, so the new HELP text is honest. One non-blocking docs follow-up in harness-sdk.
🟡 Docs drift (other repo, non-blocking): strands-agents/harness-sdk site/src/content/docs/user-guide/shell/commands.mdx:53 says "mv | … no -f, -i, -n, or -v." — stale once this merges. PR says Documentation PR: N/A; a one-line edit there (drop -f) would close the loop.
✅ What was verified (head 5926965)
- Overwrite is the default on both paths:
src/vfs.rs:466-485removes an existing destination entry before re-inserting (// If destination exists, remove it first);src/vfs_kernel.rs:673routes host↔host renames tostd::fs::rename, which replaces on Unix. Exercised the host bind path manually withmv -f OUT.part OUT— exit 0,OUTcontainsnew,OUT.partgone (the exactweb_fetchpattern from #134). - Tests prove the fix:
tests/shell_integration.rs:1815-1824create the destination witholdfirst and use;, so a failingmvsurfaces asold.cargo test --test shell_integration mv_→ 4 passed on this branch; the two new tests fail onorigin/main(left: "old", right: "new"). - CI Gate: success on 5926965.
-i/-nstill error (mv: invalid option '-i') — the right call; silently accepting those would clobber data.- HELP style matches precedent:
src/commands/grep.rs:18documents a no-op flag with(default)the same way;Usage: mv [-f] …mirrorsrm's[-rf].
Appendix — non-blocking (2)
- ⚪ No
mv_helptest, though the PR body claims--helplists the flag andrm_helpexists (tests/shell_integration.rs:5701). Optional — only ~11/34 commands have one. If you want it:expect!(mv_help, "mv --help | head -n 1", "Usage: mv [-f] SOURCE... DEST"); - ⚪ The "I have reviewed and understand every line of code" checklist box is the one left unticked.
Reviewed by strandly-the-agent — an AI agent; please treat as input for a human reviewer.
mkmeral
approved these changes
Oct 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The
mvcommand rejected-f/--forceas an invalid option.mvalready overwrites an existing destination without prompting, which is what-fmeans, so the flag is now accepted and changes nothing. The Strands harnessweb_fetchtool (Python and TypeScript) ends its command withmv -f OUT.part OUT, and agents writemv -froutinely.mv --helpnow lists the option.Related Issues
Closes #134
Documentation PR
N/A
Type of Change
Bug fix
Testing
Added
mv_force_overwritesandmv_long_force_overwritesintegration tests, which check thatmv -fandmv --forceoverwrite an existing destination. Also ranmv -fandmv --helpin thestrands-shellbinary.cargo test --workspace --all-targets,pytest tests/python,npm test)cargo fmtandcargo clippyChecklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.