dsh-hardlink-publish-fallback: New file writes on volumes that do not support hard links

Introduction

In DeepSeek Harness (DSH), agents create or update files in the workspace via the write tool. On Windows, @deepseek-ai/dsh-fs-local uses hard links for the publishing path of new files: it hard links the temporary file from the staging directory to the target path, acting simultaneously as a guard to “not overwrite existing files.” If the workspace is located on exFAT, FAT32 (common for USB drives and external hard drives), or certain network shares that do not support hard links, this link call will be rejected; Node often reports this error as EISDIR instead of the more intuitive ENOTSUP or EPERM. The result is: creating new files fails every time, while updating existing files still works via rename/ReplaceFileW, appearing to “be able to edit but not create,” which leads to high troubleshooting costs. The following text describes how the community plugin dsh-hardlink-publish-fallback provides a one-time fallback specifically when such hard link publishing failures are identified, without altering default behavior.

What is this?

dsh-hardlink-publish-fallback is published by the maintainer Mushroomcowisheggs. The repository is on GitHub, and the directory page is on SkillHub. It injects into the configuration layer (cordis.patch.yml) as a DSH bundle. When a write fails due to “volume does not support hard link publishing,” and after strict verification passes, it switches to the volume-supported rename path to complete the creation (the same path used for updating files) and records an observation consistent with a normal successful write. Writes that do not trigger this failure signature are completely unaffected.

Background: What does the failure look like?

On volumes that do not support hard links, the typical error looks like:

cannot write "<workspace>\<file>": EISDIR: illegal operation on a directory,
  link '<workspace>\.<file>.<pid>.<uuid>.tmpdir\<file>.tmp' -> '<workspace>\<file>'

The caller’s intent to “create only if the target does not exist” is never satisfied, so all creation attempts fail permanently on such workspaces. The same type of volume usually does not support symbolic links either; dsh-app-boot’s healProfilesModuleFallback links installations to profiles using symbolic links during composition, so DSH_HOME cannot be placed on a filesystem without symbolic link capability—this plugin does not solve the problem of profiles failing to start; it only solves the hard link publishing failure for write creating new files.

Core Functionality

The plugin’s behavior can be summarized in four steps (based on the design documentation):

  1. Let the real write execute as-is first.
  2. Only when the failure message contains both the .tmpdir staging marker and the link verb, and belongs to the hard link publishing signature of FS_IO_ERROR, verify again that the target still does not exist, then complete the publish using an intent-free write without the “no replace” guard (the rename path).
  3. After a successful write, record the same observation as a normal write.
  4. If any step in the fallback chain fails, return the original error to the caller without masking other issues.

The detection is strict: unrelated EISDIR errors (e.g., target is a directory, incorrect path components) will not be intercepted. Default behavior is not modified—successful writes do not enter the fallback, nor does it replace existing services or overwrite existing configuration lines.

Installation and Activation

When installing from GitHub, it is recommended to pin a tag or commit; if no ref is specified, pnpm will follow the current pointer of the default branch, and subsequent pushes may silently change the code actually running on your machine:

dsh plugin --profile web add "github:Mushroomcowisheggs/dsh-hardlink-publish-fallback#v0.1.0"

# Even stronger: pin a 40-character commit
dsh plugin --profile web add "github:Mushroomcowisheggs/dsh-hardlink-publish-fallback#<40-char-sha>"

This package is pure JavaScript with no prepare/build scripts, so generally, you do not need to authorize allowBuilds separately in the profile’s pnpm-workspace.yaml (if a future version adds build steps, you will need to handle git dependency builds according to DSH documentation).

When installing from a local directory or tarball, ensure the path is wrapped in double quotes (on Windows, without quotes, \d, \t, etc., may be treated as escapes):

dsh plugin --profile web add "<path-to-checkout>"
pnpm pack
dsh plugin --profile web add "<path-to-checkout>\dsh-hardlink-publish-fallback-0.1.0.tgz"

dsh plugin add will automatically append the bundle to the profile’s dsh.profile.bundles due to the dsh.bundle declared within the package.

Verify if it is loaded:

dsh --profile web --dump-config          # Look for "# == dsh-hardlink-publish-fallback"

Typical Usage and Verification

Open a workspace on an affected volume and let the agent create a new file. Without the plugin, the EISDIR/link error mentioned above should appear; after installation and loading, it should report Created file as usual. The maintainer has verified this in scenarios with a fixed exFAT volume installed from a release tag: creating new files, creating new files in paths requiring directory creation first, writing to the same file consecutively for the second time without an intermediate read, and having no staging residue; observations for files created via this plugin are consistent with normal writes, and subsequent behavior is identical to other files.

You can run behavior tests using the following command in the repository (no real exFAT volume required):

npm test          # or: node test/plugin.test.mjs

Use Cases and Notes

Who it is for: If you run DSH on exFAT/FAT32 or removable media, or certain network shares, and the main pain point is that the agent’s write cannot create new files but editing existing files works fine, you can install this plugin in the corresponding profile as a runtime workaround.

Scope and Limitations (subject to README):

  • Only fixes creation; updates and edit do not use the hard link path originally, so the plugin does not intercept them.
  • The logic identifies by failure signature and is not limited to Windows; any POSIX filesystem that rejects link() with the same error pattern may also benefit.
  • You cannot rely on this plugin to create files directly in the Windows drive letter root directory: writeFileAtomic will get EPERM when doing mkdir on the root, which is a separate defect; please write to subdirectories.
  • It cannot replace the upstream fix for dsh-fs-local publishing logic; see DEFECT-REPORT.md in the repository for detailed analysis.
  • Before falling back, it checks again that the target does not exist. Like the original writeText, there is a limited TOCTOU window; the semantics of “not silently overwriting race creators” are preserved.

Security and Trust: The plugin runs with the current DSH process permissions and intervenes in the file writing path. Please read the source code and MIT license before installation and assess whether to include it in your profile. SkillHub etc. are community directories and have no official affiliation with DeepSeek / High-Flyer; the DSH ecosystem emphasizes “everything is a plugin,” so you need to perform your own pinning and auditing when selecting third-party bundles.

Conclusion

dsh-hardlink-publish-fallback provides a narrow-scope fallback for “new file write that does not support hard link publishing”: the default path remains unchanged, and it only switches to rename to complete creation when a hard link failure is identified and the target is still missing. If your workspace is often on exFAT or similar volumes, you can install a pinned version and confirm the bundle is loaded in --dump-config. For more information, see the SkillHub directory page and the GitHub repository.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye