Skip to content

[Bug]: Claude skill discovery and favicon reads of project files can exhaust the libuv pool and wedge the host for hours (TCC-blocked open on a removable volume) #26417

Done

Description

@Wout-AxioSozo

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

  1. On an unattended macOS host (screen locked), keep T3 Code Desktop (nightly) running with projects on an external USB volume (/Volumes/<ssd>, which TCC classifies as a Removable Volume). Connect to it from a second Mac over T3 Connect.
  2. Have any other app raise a TCC consent prompt on the host that nobody answers. In our case a freshly ad-hoc-signed dev app launched by automation did this. While that prompt is pending, sandboxd queues every later interactive TCC approval behind it. Once its 64-thread GCD pool (kern.wq_max_constrained_threads=64) is full, open() on existing files on the external volume blocks in the kernel. stat(), access() and ENOENT lookups still return immediately.
  3. Use the host normally from the client: send a Claude turn, or let server.refreshProviders / PR sync favicon enrichment run.

Deterministic repro without TCC (same idea as #15971): make <repo>/public/index.html or <repo>/.claude/settings.local.json a FIFO (mkfifo). Then open that project and start a Claude turn four times, or trigger favicon resolution.

Expected behavior

A project file that can't be opened shouldn't take down the server. Skill discovery and favicon lookup should skip or time out on that path, auth, secrets and tracing should keep working, and the client should stay connected.

Actual behavior

Four background reads of project files each take a libuv threadpool worker that never comes back. UV_THREADPOOL_SIZE is unset, so there are 4 workers in total. After that, every async fs, dns.lookup and crypto/zlib operation queues forever, while the main event loop stays idle and the process stays alive:

  • ServerSecretStore.get (plain readFile) never completes. /api/t3-connect/mint-credential returns 499 after about 8.6 s on every attempt (25 attempts over 70 min). /api/auth/websocket-ticket hangs in dpop.verifyRequestDpopProof on the replay-marker write, for 32,735 s. /.well-known/t3/environment returns 499.
  • The client shows EnvironmentRpcUnavailableError: <host> is not connected. for 9 hours, until the OS-level stall cleared. Nothing in T3 noticed. The desktop restarts the backend only when the process exits, and readiness is probed only at startup.
  • server.trace.ndjson stops being written, because the trace sink's fs.writeFile is queued too. After recovery the server wrote out the four long-running spans, so we know exactly which reads held the workers:
started duration span chain read on main @ 2a73827
23:21:51.402 33,093 s ProjectEnrichmentService.resolveFavicon > ProjectFaviconResolver.firstInOrder > findIconFromSource ProjectFaviconResolver.ts:214 readFileString(sourcePath) (index.html etc.; firstInOrder forks all 7 source reads at once)
23:22:31.799 32,089 s ws.rpc.server.refreshProviders > probeClaudeWorkspaceSnapshot > discoverClaudeSkills > discoverPluginSkillRoots > findPluginRepositoryRoot ClaudeSkills.ts:172 readFileString(path.join(root, ".git"))
23:27:15.002 32,518 s ws.rpc.server.refreshProviders > ... > discoverClaudeSkills > readSkillSettings ClaudeSkills.ts:259 readFileString(settingsPath) (<cwd>/.claude/settings.local.json)
23:27:18.615 32,787 s ProviderTurnStartService.start > ClaudeAdapterV2.startTurn > discoverClaudeSkills > findPluginRepositoryRoot ClaudeSkills.ts:172 again (4th worker; last span written before the wedge ends 23:27:18.017)

In each case the findRepositoryRoot child (exists, i.e. access()) on the same root finished in 0 ms, and the ENOENT sibling probes in the favicon resolver also finished in about 0 ms. Only real open()s of existing entries blocked.

findPluginRepositoryRoot is the worst case. In a normal (non-worktree) repo, .git is a directory, yet it is always opened with readFile. That fails with EISDIR, but only after an open() that needs authorization. A stat/isFile() first would have kept 2 of the 4 workers free here. Skill discovery runs on every Claude turn start and every refreshProviders, so this is on the hot path.

This is the same failure class as #15971 (AgentSessionScanner.readGitIdentity, TCC-blocked .git/config). The open PRs for it (#15977, #23690) fix only AgentSessionScanner. It is probably also the explanation for #24897: the triage there already suspected pool exhaustion, and the symptom (ServerSecretStore.get and mint-credential stuck, the tunnel healthy) is identical. #23877 shows that UV_THREADPOOL_SIZE=16 alone doesn't fix it.

Suggested direction (maintainers' call):

  • Don't read untrusted project paths through the shared pool unbounded. Add a per-volume (st_dev) cap, released from the native completion callback, not when the fiber is interrupted (with withPermits the permit leaks while the worker stays stuck in open()). Or do these reads synchronously in a dedicated worker thread or child process. Async fs in a worker_thread uses the same process-wide pool.
  • findPluginRepositoryRoot: stat <root>/.git and read it only if isFile() (gitdir file case).
  • Keep auth off the pool: cache server secrets in memory, and keep DPoP replay markers and cloud replay guards (consumeCloudReplayGuards) out of fs.
  • Desktop: add a continuous liveness probe that exercises the threadpool (and set a larger pool), and show "host unresponsive" instead of a generic "not connected".

Impact

Blocks work completely

Version or commit

0.1.4-nightly.20261027.3770 (host and client). The code paths above are unchanged on main @ 2a73827

Environment

Host: Mac mini, macOS 27.0.1 (26A434), arm64, T3 Code (Nightly) desktop (Electron 44.9.3), projects on an external USB APFS volume, reached over T3 Connect. Client: MacBook Pro, same build. Provider: Claude.

Logs or stack traces

# `sample <server pid> 10` on the host, ~9 h into the wedge (excerpt)
8469 Thread_159502997   DispatchQueue_1: com.apple.main-thread  (serial)
  ... node::SpinEventLoopInternal > uv_run > uv__io_poll > kevent     # 8449/8469: idle
8469 Thread_159503077: libuv-worker   ... > open > __open              # 8469/8469
8469 Thread_159503078: libuv-worker   ... > open > __open              # 8469/8469
8469 Thread_159503079: libuv-worker   ... > open > __open              # 8469/8469
8469 Thread_159503080: libuv-worker   ... > open > __open              # 8469/8469

# On the host during the wedge
$ curl -m 8 http://127.0.0.1:3773/          -> no response (timeout)
$ ps -o stat,%cpu -p <server pid>           -> Ss 0.0
$ ps eww -p <server pid> | grep UV_THREADPOOL_SIZE   -> (none)

# Recovery: the four spans above end at 08:33:13.329 / 20.519 / 24.528 / 45.236.
# Each is within 10 ms of the respawned sandboxd finishing one queued TCC approval.
# mint-credential 200 at 08:33:46.072, websocket-ticket 200 at 08:33:47.073; client reconnects 08:33:47.

Workaround

Answer the pending TCC dialog on the host (Screen Sharing), or keep projects off removable volumes. Restarting T3 alone doesn't help while the OS stall persists: the new server passes readiness, then wedges again on its first project read.

Activity

  1. Armand-Lluka commented on Nov 2, 2026

    @Armand-Lluka

    Another case of the same failure class, reached a different way: a headless macOS host, no removable volume, with projects in ~/Documents.

    Setup. 0.1.6-nightly.20261030.3917 ran as the launchd service (com.t3tools.t3code.service) on an unattended MacBook Pro (Apple silicon, macOS 27.0.1), reached from a second Mac. The projects lived under ~/Documents, and the launcher had no Files & Folders grant.

    What happened. An unrelated process prompted TCC for Documents access, and nobody was at the screen to answer. After that:

    • The server's git calls into the projects under ~/Documents blocked first.
    • All 4 libuv-worker threads then sat in uv_fs_open > __open; sample showed that across the whole run.
    • /.well-known/t3/environment failed with Interrupt (ServerSecretStore.get > readAgentActivityPublishingActive > ServerEnvironment.getDescriptor).
    • The client showed the host as reconnecting for hours, and nothing was logged on the host.

    Two details we haven't seen mentioned here:

    1. Restarting doesn't help, and startup can take minutes. The login-shell PATH probe (apps/server/src/os-jank.ts, spawnSync of zsh -ilc) blocks too if the user's shell startup files read anything under a protected folder. Ours sourced a file from ~/Documents. The server logged Listening only after that probe hit its timeout, about 4 minutes later, and then Failed to read PATH from login shell /bin/zsh. spawnSync /bin/zsh ETIMEDOUT.
    2. The grant is tied to a path that moves. TCC attributes the service's file access to the launcher, ~/.t3/runtime/versions/<version>/t3 (the path in ProgramArguments), not to the server binary. That path changes whenever t3 service install runs for a new version. So a Full Disk Access or Files & Folders grant given to the launcher silently stops applying after a repair or update, and the next protected read prompts again. A version-independent launcher path would let one grant survive updates.

    Workaround. We moved everything the service touches out of ~/Documents, ~/Desktop and ~/Downloads: project roots, shell startup files and symlinked dotfiles. We also added an external watchdog that polls /.well-known/t3/environment and alerts. After a reboot test, the server logged Listening 32 s after boot, and tccd showed no further folder requests from the launcher.

  2. GA16-24 commented on Nov 14, 2026

    @GA16-24

    Another reproduction of this exact libuv pool exhaustion, this time through Tailscale Serve rather than T3 Connect.

    Environment:

    • Headless Apple Silicon Mac mini, macOS 26.7.3 (25G342)
    • t3 v0.1.10-nightly.20261114.4669
    • launchd background service
    • Projects under ~/Documents
    • Remote clients reach the host through Tailscale Serve on another machine

    Observed behavior:

    • /.well-known/t3/environment timed out on loopback, direct Tailscale, and proxy routes.
    • /pair could still return HTTP 200 while secret-dependent requests hung.
    • The service repeatedly logged environment api request failed with Interrupt at ServerSecretStore.get -> config.readAgentActivityPublishingActive -> environment.metadata.descriptor.
    • sample showed all four libuv-worker threads blocked in node::fs::ReadFileJob::DoThreadPoolWork() -> uv_fs_open -> __open.
    • Multiple TCC prompts were queued on the host, including a Documents folder prompt.

    Restarting the service, and separately upgrading from nightly 4656 to 4669, only restored service temporarily. Repeated project reads wedged the host again. Answering the pending permission prompt released the workers without another service restart. Afterward, 108/108 environment requests passed over three minutes across loopback, LAN proxy, and remote Tailscale routes.

    This confirms the failure is not specific to T3 Connect or removable volumes. The effective workaround was answering the pending TCC dialog. I can provide sanitized traces and the full sample if useful.

  3. andrewfree commented on Nov 18, 2026

    @andrewfree

    Another trigger, this time hardware: a USB SSD stuck in a reset loop. Unlike the TCC case, stat() and getattrlist() blocked too, not only open().

    Setup: macOS (Darwin 27.3, arm64), t3 0.1.11-nightly.20261118.4864 as the launchd service, desktop Nightly on the same build. A Samsung T9 (APFS, /Volumes/Storage) on a CalDigit TS4 dock started re-enumerating about every 16 s, with no I/O errors in the kernel log. Every syscall that touched the volume blocked.

    What sample showed: all four libuv-worker threads in uv__fs_work, three in stat and one in __getattrlist, for the whole sample. A timeout or skip that covers only open()/readFile would not have helped here. Metadata calls on project paths need the same protection.

    Symptoms matched this issue:

    • From about 23:59, every environment API request logged environment api request failed, with an Interrupt at ServerSecretStore.get.
    • /api/health returned no bytes within 8 s, while the event loop kept logging.
    • The lsof -iTCP -sTCP:LISTEN -P -n -F pcn child that the server spawned also hung in uninterruptible wait for about 35 minutes, because lsof stats every open file.

    Recovery: unplugging the drive made the blocked calls return, and /api/health answered in 3 ms within seconds, with no server restart. No T3 log line names the path being checked, so I couldn't tell which server code path was stuck on the volume.

    While the service was frozen, the desktop's handling of the outage led straight into #22820. Details are there.

    Investigated with Claude Opus 5.5 in Claude Code (desktop app). Claude Fable 5.2, run through Claude Code's Agent tool, captured the stack samples and diagnosed the reset loop.

  4. trevorschachner commented on Nov 23, 2026

    @trevorschachner

    Hit this on 0.1.10 (macOS, Darwin 25.6.0) with projects in iCloud Drive. They worked fine until iCloud's bird stalled.

    #26462 moves file reads into killable child processes. Git child processes hit the same problem. git rev-parse hung in the kernel resolving its cwd (init_git > strbuf_getcwd > __getcwd > open). VcsProcessTimeoutError fired at 5s, but the git process kept running for 3+ minutes and several piled up. refreshProviders hung for up to 28 minutes.

    After ⌘Q, the old backend was orphaned and ignored SIGTERM, same as #28510. killall bird cleared it.

  5. juliusmarminge commented on Nov 23, 2026

    @juliusmarminge
    Member

    #37870, now on main: Favicon metadata discovery now skips non-regular files before opening them, preventing the reported public/index.html FIFO reproduction from occupying libuv workers.

    Not done: Regular files whose open blocks on macOS TCC, Claude skill/settings reads, and t3.json reads remain unprotected; the issue also requests auth resilience and ongoing desktop liveness detection.

    Closing; open a new issue if what is left still matters to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions