computerd: writes applied over sync do not reach inotify watchers on the FUSE mount
维护者通常 1 天内回复
@aron-cf 已经在做这个了。
开始于 2026年10月3日。
评估
这个 Issue 还没有评估数据。
描述
Describe the bug
When the host pushes a change to computerd, the entry is applied straight into the in-container VFS. Reads through the FUSE mount return the new bytes, but the kernel never sees an operation on the path, so no inotify event is emitted. File watchers inside the container (Vite/chokidar, astro dev, tsc --watch, node --watch) never notice the change.
The workflow this breaks: an agent edits files through workspace.fs (or the worker-shell backend) while a dev server runs in the container. Hot module replacement never fires, and new files are not picked up by the dev server's router until it restarts.
Writes made inside the container through the mount do emit events, because they go through the kernel.
Expected behavior
A change applied by the sync push handler is visible to inotify watchers on the mount, the same way a local write is, without syncing anything back to the host.
Steps to reproduce
computerd built from main (2f76387), FUSE_MOUNT=fuse, MOUNT_POINT=/workspace. The host side is driven by pushOnce, pullOnce and reconcileWatermarks from @cloudflare/computer-rpc/driver on a SQLiteTestStorage database, as in script/computerd-soak.mjs.
- Run
inotifywait -m -r /workspace, then write a file on the host andpushOnce. The file content is correct on the mount and no event is printed. A localecho hi > /workspace/xprints CREATE, MODIFY and CLOSE_WRITE. - Run
astro dev(Astro 7, Vite 8, chokidar 4) on a project in the mount, with an HMR WebSocket client connected. Push an edit tosrc/site.ts: no HMR message arrives and the page keeps serving the old content. - Push a new
src/pages/nova.astro:GET /novareturns 404.
Environment
@cloudflare/computer0.4.0,computerdfrommainat 2f76387- Linux x86_64 (kernel 6.18), Node 22, libfuse 2.9.9, real FUSE (
/dev/fuse) - Host side run locally with the sync driver; not yet reproduced on Cloudflare Containers
Proposed fix
Pass the applied paths to the existing afterApply hook, and in the real FUSE backend set the times of each applied path and its parent directory through the mount after the batch commits:
ServerOptions.afterApplybecomes(applied: { readonly paths: readonly string[] }) => void | Promise<void>. The shim'safterApplyignores the argument, so existing callers keep compiling.computerdregistersafterApply: ({ paths }) => announceAppliedPaths(paths)when FUSE is mounted.utimeson the file covers edits;utimeson the parent covers creates and deletes. ENOENT is ignored.- The FUSE
utimenshandler only records times in driver metadata, so the poke does not produce a VFS change and nothing syncs back.
The patch is about 30 lines in packages/rpc/src/server.ts and packages/computerd/src/cli/computerd.ts. I can share it as a diff or open a pull request if a maintainer asks for one.
Results with the patch
| Case | Without patch | With patch |
|---|---|---|
| Pushed edit to an imported module | no HMR, stale page | full-reload 25 ms after the push, page updated |
| Pushed new page | /nova returns 404 |
/nova returns 200 |
| Pull after the poke | 0 entries | 0 entries (no echo) |
tsc --noEmit for packages/rpc and packages/computerd reports the same pre-existing errors in test files before and after the change.
Compatibility and open questions
- The hook signature change is additive for implementers of
afterApply. - Large batches: touching every applied path may be worth bounding, for example to the parent directories once a batch passes some size.
- The touch sets the times to now. Using the VFS mtime instead would keep
statconsistent with what the host wrote. - A privileged Docker test in the style of
src/exec/runner.fuse.test.tscould runinotifywaitand assert an event after a push.
- 主要语言
- TypeScript
- 星标
- 9.5k
- 派生
- 552
- 平均合并
- 1 天 17 小时
- 30 天内合并 PR
- 50
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
cloudflare/computer 的其他 Issue
-
enhancement
难度 4/5 3-5 天 新手友好度 30/100
cloudflare/computer#224 · 5 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
Always run the "next" computerd workflow on push to the `release` branch可能已有人在做 @aron-cf 于 4 天前认领。 未关闭bug
cloudflare/computer#222 · 2 条评论 · 1 个 reaction · 已指派 1 人 ·
维护者通常 1 天内回复
-
Make just-bash and acorn optional peer dependencies, pulled in only by the backend that needs them未关闭enhancement
难度 3/5 1-2 天 新手友好度 45/100
cloudflare/computer#220 · 3 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
Workspace namespaces: more than one Workspace per Durable Object storage可能已有人在做 @aron-cf 于 4 天前认领。 未关闭enhancement
cloudflare/computer#219 · 1 条评论 · 1 个 reaction · 已指派 1 人 ·
维护者通常 1 天内回复
-
git: host-held credentials for model-driven clone, fetch, pull and push可能已有人在做 @aron-cf 于 4 天前认领。 未关闭enhancement
cloudflare/computer#218 · 3 条评论 · 1 个 reaction · 已指派 1 人 ·
维护者通常 1 天内回复
查看 cloudflare/computer 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 85/100
-
area:cowork area:desktop documentation enhancement platform:macos
难度 2/5 1-3 小时 新手友好度 68/100
anthropics/claude-code#101720 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 77/100
apache/rocketmq-dashboard#6610 ·
维护者通常 3 天内回复
-
Add: MS NOW未关闭check:passed streams:add
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
Global update drops overrideAccess, so Local API updateGlobal fails filterOptions validation (3.90 regression)可能已有人在做 @PINYOPATTANAWASANPORN 今天认领。 未关闭area: core Bug
难度 2/5 1-3 小时 新手友好度 76/100
payloadcms/payload#18674 · 1 条评论 ·
维护者通常 1 天内回复