[Linux desktop] Codex helpers exhaust fs.inotify.max_user_instances while using zero watches

Open 💬 2 comments Opened Aug 18, 2026 by UsmanTariq2
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of the Codex App are you using (From “About Codex” dialog)?

26.810.52044

What subscription do you have?

Plus

What platform is your computer?

Fedora 44 KDE latest

What issue are you seeing?

<p data-pm-slice="1 1 []"><span>After using the Codex desktop app, KDE began displaying this warning:</span></p><blockquote><p><span>You have too many applications wanting to monitor file changes! When the capacity is exhausted it will prevent further file monitoring from working correctly. Either close some applications or increase the limit. Currently using 114% of instances and 0% of watches.</span></p></blockquote><p><span>Process inspection shows that the overwhelming majority of the inotify usage comes from ChatGPT/Codex processes. In particular, 15 Codex </span><code><span>cua_node/bin/node_repl</span></code><span> helper processes each hold eight </span><code><span>anon_inode:inotify</span></code><span> file descriptors, despite reporting zero active watches.</span></p><p><span>This appears to exhaust the system’s </span><code><span>fs.inotify.max_user_instances</span></code><span> limit and may prevent unrelated applications from monitoring file changes.</span></p><h2><span>Observed behavior</span></h2><p><span>At the time of inspection:</span></p>
Component | Processes | Inotify file-descriptor references | Watches
-- | -- | -- | --
/usr/lib/chatgpt/resources/cua_node/bin/node_repl | 15 | 120 total, 8 each | 0
Main ChatGPT process | 1 | 10 | 0
Codex app server | 1 | 10 | 0
codex-code-mode-host | 1 | 8 | 0
ChatGPT network service | 1 | 1 | 0

<p><span>ChatGPT/Codex processes therefore accounted for approximately 149 inotify file-descriptor references at inspection time. Some descriptors could refer to shared underlying inotify objects, but Codex is clearly the dominant consumer.</span></p><p><span>The configured system limit is:</span></p><pre><code><span>fs.inotify.max_user_instances = 128
fs.inotify.max_user_watches = 267284
fs.inotify.max_queued_events = 16384</span></code></pre><p><span>The desktop warning reported 114% instance usage and 0% watch usage.</span></p><p><span>Other desktop applications were using comparatively few instances. For example, Chrome used six across its inspected processes, while individual KDE components generally used between one and four.</span></p><h2><span>Expected behavior</span></h2><p><span>Codex helper processes should release inotify instances when the associated task, runtime, or code-mode operation no longer requires them.</span></p><p><span>Normal use of Codex should not exhaust the operating system’s per-user inotify instance limit, particularly when none of the instances have active watches.</span></p><h2><span>Actual behavior</span></h2><p><span>Multiple </span><code><span>node_repl</span></code><span> helper processes remain running and each retains eight inotify descriptors with zero watches. Their combined usage exhausts the system limit and triggers a desktop warning.</span></p><p><span>Once the limit is exhausted, file monitoring in Codex or unrelated applications may stop working correctly.</span></p><h2><span>Steps leading to the issue</span></h2><p><span>I do not yet have a minimal deterministic reproduction. The observed sequence was:</span></p><ol data-spread="false" start="1"><li><p><span>Install and run the Codex/ChatGPT Linux desktop app.</span></p></li><li><p><span>Use multiple Codex tasks normally.</span></p></li><li><p><span>Leave the application running as tasks and code-mode helpers are created.</span></p></li><li><p><span>Eventually receive the KDE inotify-capacity notification.</span></p></li><li><p><span>Inspect </span><code><span>/proc/&lt;pid&gt;/fd</span></code><span> and </span><code><span>/proc/&lt;pid&gt;/fdinfo</span></code><span>.</span></p></li><li><p><span>Observe 15 Codex </span><code><span>node_repl</span></code><span> helpers, each retaining eight inotify descriptors and zero watches.</span></p></li></ol><p><span>The notification first appeared on August 18, 2026. The installed package was installed on August 16, 2026.</span></p><h2><span>Environment</span></h2><ul data-spread="false"><li><p><span>Codex/ChatGPT package: </span><code><span>chatgpt-26.810.52044-1.x86_64</span></code></p></li><li><p><span>App version: </span><code><span>26.810.52044</span></code></p></li><li><p><span>Package source: OpenAI RPM</span></p></li><li><p><span>OS: Fedora Linux 44</span></p></li><li><p><span>Architecture: x86_64</span></p></li><li><p><span>Kernel: </span><code><span>7.1.8-200.fc44.x86_64</span></code></p></li><li><p><span>Desktop: KDE Plasma </span><code><span>6.7.4</span></code></p></li><li><p><span>Display session: Wayland</span></p></li><li><p><span>CPU: AMD Ryzen 7 9700X</span></p></li><li><p><span>Memory: 30.5 GiB</span></p></li><li><p><span>glibc: </span><code><span>2.43-8.fc44</span></code></p></li></ul><h2><span>Relevant process sample</span></h2><pre><code><span>INSTANCES WATCHES APPLICATION
10 0 /usr/lib/chatgpt/ChatGPT
10 0 /usr/lib/chatgpt/resources/codex ... app-server
8 0 /usr/lib/chatgpt/resources/codex-code-mode-host
8 0 /usr/lib/chatgpt/resources/cua_node/bin/node_repl
8 0 /usr/lib/chatgpt/resources/cua_node/bin/node_repl
8 0 /usr/lib/chatgpt/resources/cua_node/bin/node_repl
... 15 node_repl processes in total
1 0 /usr/lib/chatgpt/ChatGPT --type=utility --utility-sub-type=network.mojom.NetworkService</span></code></pre><p><span>The values were obtained by finding file descriptors whose targets were </span><code><span>anon_inode:inotify</span></code><span>, then counting </span><code><span>inotify</span></code><span> entries in the corresponding </span><code><span>/proc/&lt;pid&gt;/fdinfo/&lt;fd&gt;</span></code><span> files.</span></p><h2><span>Possible cause</span></h2><p><span>This may be a lifecycle or cleanup issue involving code-mode </span><code><span>node_repl</span></code><span> helpers. Each helper appears to allocate eight inotify instances even though it has no active watches, and multiple helpers accumulate during app use.</span></p><p><span>Possibilities include:</span></p><ul data-spread="false"><li><p><span>Completed or inactive task runtimes not being terminated.</span></p></li><li><p><span>Inotify instances not being closed when a helper becomes idle.</span></p></li><li><p><span>Inotify descriptors being inherited unnecessarily by child processes.</span></p></li><li><p><span>A fixed group of monitoring descriptors being created for every helper process.</span></p></li></ul><p><span>This is only a hypothesis based on the process inspection.</span></p><h2><span>Workarounds</span></h2><p><span>Potential temporary workarounds are:</span></p><ul data-spread="false"><li><p><span>Completely restart the ChatGPT/Codex desktop app.</span></p></li><li><p><span>Increase </span><code><span>fs.inotify.max_user_instances</span></code><span>.</span></p></li></ul><p><span>Increasing the kernel limit would only mask the accumulation, however, and could allow the same behavior to consume a larger number of instances over time.</span></p><p><span>I have not yet confirmed whether restarting the application permanently resolves the issue or how quickly the helpers accumulate again.</span></p>

What steps can reproduce the bug?

Steps leading to the issue

Install and run the Codex/ChatGPT Linux desktop app.

Use multiple Codex tasks normally.

Leave the application running as tasks and code-mode helpers are created.

Eventually receive the KDE inotify-capacity notification.

Inspect /proc/<pid>/fd and /proc/<pid>/fdinfo.

Observe 15 Codex node_repl helpers, each retaining eight inotify descriptors and zero watches.

The notification first appeared on August 18, 2026. The installed package was installed on August 16, 2026.

What is the expected behavior?

Expected behavior

Codex helper processes should release inotify instances when the associated task, runtime, or code-mode operation no longer requires them.

Normal use of Codex should not exhaust the operating system’s per-user inotify instance limit, particularly when none of the instances have active watches.

Additional information

Report generated by gpt5.6 sol but verified by me ( human)

View original on GitHub ↗

2 Comments

github-actions[bot] contributor · 10 days ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #38714
  • #38948
  • #38825

Powered by Codex Action

jdcodes1 · 10 days ago

This is very likely a known process-lifecycle leak wearing an inotify costume — worth connecting the two so the fix lands once.

The 15 helpers are the real bug. node_repl is a bundled stdio MCP server (visible in the OSS tree: the MCP tool handler special-cases server_name == "node_repl", core/src/tools/handlers/mcp.rs#L252-L255). Codex's in-session MCP refresh path replaces server connections without ever shutting the superseded ones down — the replaced processes stay alive, parented to the app-server, until the app exits. Full mechanism with code references in https://github.com/openai/codex/issues/38925#issuecomment-5312030670 (macOS, same accumulation; Windows variant with socket exhaustion in #38981). Your 15 × node_repl matches that signature: one live instance plus ~14 superseded ones that were never terminated.

The inotify arithmetic is just the Linux-visible cost of the leak. A Node.js process holds a small baseline of inotify instances from libuv/runtime initialization even when nothing is being watched — which is exactly your "8 instances, 0 watches" per process. 15 leaked helpers × 8 ≈ 120 instances against the Fedora default fs.inotify.max_user_instances = 128, plus the app's own handful → your observed 114%. So KDE's warning is accurate accounting of idle, leaked processes — each individually harmless, collectively exhausting a per-user kernel limit and breaking file watching for unrelated applications, which makes this leak's blast radius larger on Linux than on the other platforms.

Implications:

  1. The durable fix is the #38925 one (explicitly shut down superseded MCP connection sets on replacement); no inotify-specific change needed — the instances die with the processes.
  2. Interim mitigations: restarting the ChatGPT app reaps all superseded children at once (shutdown draining works; it's only in-session replacement that leaks); sudo sysctl fs.inotify.max_user_instances=512 relieves the system-wide pressure meanwhile.
  3. A useful data point for the maintainers if you can grab it before a restart: whether the node_repl process count grows on a cadence (~minutes) while the app is idle — that would confirm the refresh-churn driver measured in #38925 on your platform too.