Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit643fe38

Browse files
authored
fix: use temp file on same device with mcp file edit (#20477)
Otherwise you can get errors like "invalid cross-device link".
1 parentc827a08 commit643fe38

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

‎agent/files.go‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,9 @@ func (a *agent) editFile(ctx context.Context, path string, edits []workspacesdk.
250250
transforms[i]=replace.String(edit.Search,edit.Replace)
251251
}
252252

253-
tmpfile,err:=afero.TempFile(a.filesystem,"",filepath.Base(path))
253+
// Create an adjacent file to ensure it will be on the same device and can be
254+
// moved atomically.
255+
tmpfile,err:=afero.TempFile(a.filesystem,filepath.Dir(path),filepath.Base(path))
254256
iferr!=nil {
255257
returnhttp.StatusInternalServerError,err
256258
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp