New sessions can't be created: git fetch during worktree init deadlocks on the fsmonitor daemon → "git command timed out after 60 seconds"
还没有人认领这个 Issue。
评估
调研方向
Start at the github_app::git::progress watchdog and the create_worktree_workspace / workspace_kickoff_after_init and worktree_sync paths. Reproduce the standalone fetch harness with core.fsmonitor enabled and disabled, then inspect the child-process environment and stderr handling, including the #3980 serialization concern. Done means new-session worktree initialization completes without timing out for clones with fsmonitor enabled.
由索引模型根据 Issue 内容生成。
描述
Short summary
New sessions can't be created: git fetch during worktree init deadlocks on the fsmonitor daemon → "git command timed out after 60 seconds"
Affected version or release
1.1.23 (regression introduced in 1.1.12; also reproduced on 1.1.16 and 1.1.22)
Installation context
macOS desktop app, single-user local install. Affects a normal clone that has core.fsmonitor=true and feature.manyFiles set. Copilot CLI 1.0.87-0 (bundled with app 1.1.23), Bundled git: 2.53.0-4 (the -4 build; system git is 2.98.0), Mac: M3 Pro macOS Sequoia 15.7.7
What happened?
Since v1.1.12, creating a new session fails with:
Session '' workspace initialization failed: git command timed out after 60 seconds
The worktree is never created, so no session is produced. It persists across app restarts and across the two updates I applied today (1.1.16 → 1.1.22 → 1.1.23). Deleting ~12 stale sessions did not help.
Root cause: during init the app runs (env-injected; no -c core.fsmonitor= in the argv):
git -C fetch --progress --no-write-fetch-head origin +refs/heads/:refs/remotes/origin/
With core.fsmonitor effectively on, the fetch spawns/attaches a git fsmonitor--daemon that inherits the fetch's --progress stderr write-end and never closes it. The parent holds the read-end waiting for progress; because the daemon keeps the write-end open, the pipe never reaches EOF. The watchdog sees received_output=false and kills at idle_timeout_secs=60.
This looks like the same defect as #3980 (empty core.fsmonitor override treated as "missing" at a serialization boundary, so fsmonitor stays on) surfacing on the session-creation path. My captured fetch argv carries no core.fsmonitor override at all.
Steps to reproduce
- Use a clone with core.fsmonitor=true and feature.manyFiles set.
- Create a new session (worktree-backed) in that project.
- Observe init hang ~60s, then "git command timed out after 60 seconds"; no session created.
Reproduced outside the app with a standalone harness that mimics the fetch (parent holds the stderr pipe read-end while running git fetch --progress):
- core.fsmonitor=false → pipe hits EOF in ~2s, fetch exits cleanly.
- core.fsmonitor=true → no EOF, fetch stays alive indefinitely = deadlock.
Reproduces identically on both bundled git builds (2.53.0 -3 and -4), so the bundled git version is not the cause.
Expected behavior
Session creation completes: the init fetch finishes and the worktree is created, regardless of whether the clone has core.fsmonitor enabled.
Additional context
Version/onset from ~/.copilot/logs (per-launch version= strings correlated with github_app::git::progress watchdog events):
- ≤ v1.1.11: 0 idle-timeout events (clean)
- v1.1.12 (installed Sep 9): 16 events; first fire 2026-09-16T18:16:31Z; idle_timeout_secs changed 300 → 60; hits on the refresh/worktree_sync path
- v1.1.16: 20 events; first create-path hangs 2026-09-21T14:35Z via create_worktree_workspace / workspace_kickoff_after_init
- v1.1.22 → v1.1.23 (today): ongoing
The fetch command string is byte-identical back to July, so the trigger is the surrounding process/env handling + the 300→60s watchdog drop, not the git invocation.
Log signatures: github_app::git::progress ("idle timeout — no stderr activity", idle_timeout_secs=60, received_output=false); create path create_worktree_workspace / workspace_kickoff_after_init; refresh path worktree_sync. The app does not log child-process env, so the GIT_CONFIG_COUNT / core.fsmonitor injection is invisible in logs — please confirm whether the empty override actually reaches the child (the #3980 serialization concern).
Related issues:
- #3980 — almost certainly the same root defect (empty core.fsmonitor override dropped as "missing"); this is that defect on the session-creation path.
- #3156 — "git ['fsmonitor--daemon','stop'] failed: fatal: fsmonitor--daemon is not running"; sibling symptom proving buggy per-worktree fsmonitor lifecycle management.
- #2403 — documents the exact init fetch command and ~5s/worktree fetch cadence; reporter left fsmonitor off (plausibly why the empty-override default was adopted — now broken per #3980).
Suggested fixes:
- Ensure the fsmonitor override reaches the child — pass
-c core.fsmonitor=falsein the argv, not only via an env override an empty-string-as-missing boundary can drop. - Don't let the spawned fsmonitor daemon inherit the fetch's stderr write-end — redirect the daemon's stderr or close the write-end in the parent after spawn so the progress pipe reaches EOF.
- Make the watchdog treat process exit (not only stderr activity) as completion; the 300→60s drop in v1.1.12 just made an existing pipe hazard fail faster.
Workaround: setting core.fsmonitor false (and feature.manyFiles false) on the affected clone stops the daemon from spawning and lets init fetch complete. Per-clone (--local); does not affect other clones of the same repo.
- 主要语言
- 没有语言数据
- 星标
- 2.1k
- 派生
- 157
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
github/app 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 2/5 1-3 小时 新手友好度 65/100
-
难度 2/5 1-3 小时 新手友好度 72/100
-
难度 2/5 1-3 小时 新手友好度 68/100
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
farion1231/cc-switch#7638 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
PolyMeilex/rfd#334 ·
-
难度 2/5 1-3 小时 新手友好度 65/100
-
area:general bug P1 security
难度 2/5 1-3 小时 新手友好度 75/100
uttrflow/uttrflow-swift#1333 ·
-
难度 2/5 1-3 小时 新手友好度 75/100