[macOS] Bundled latex.png ships as 0600, causing repeated 100 MiB staging leaks

Open 💬 4 comments Opened Jul 21, 2026 by zhangbiyao1129
💡 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.715.61943 (bundle 5628), installed as /Applications/ChatGPT.app

What subscription do you have?

Paid ChatGPT plan (the issue occurs before authentication and appears unrelated to plan tier)

What platform is your computer?

Darwin 25.5.0 arm64 arm — macOS 26.5.2 (25F84)

What issue are you seeing?

The official macOS app bundle shipped one bundled-plugin resource with mode 0600 and ownership root:wheel:

/Applications/ChatGPT.app/Contents/Resources/plugins/openai-bundled/plugins/latex/assets/latex.png
-rw------- root wheel 14707 bytes

Codex runs as the logged-in user, so every attempt to materialize the bundled plugin marketplace fails while copying the LaTeX plugin:

[BundledPluginsMarketplace] plugin_marketplace_folder_write_failed
ditto: .../plugins/latex/assets/latex.png: Permission denied
folderWritePhase=copy_plugins

Cleanup then fails and leaves the full staging copy behind:

[BundledPluginsMarketplace] plugin_marketplace_folder_remove_failed
errorCode=ENOTEMPTY
removePhase=cleanup_staging_after_write

[BundledPluginsMarketplace] bundled_plugins_marketplace_resolve_failed
errorCode=ENOTEMPTY

Each leaked directory is approximately 101 MiB:

~/.codex/.tmp/bundled-marketplaces/openai-bundled.staging-<UUID>

I observed 376 copies consuming about 37 GiB. After deleting them, I reproduced 14 new copies (about 1.4 GiB) in roughly 27 minutes. The same retry/leak pattern can grow to hundreds of GiB over time.

Only latex.png had the unreadable mode; other files under the bundled marketplace had normal readable permissions.

What steps can reproduce the bug?

  1. Install/update the official macOS app to 26.715.61943 (5628).
  2. Check the resource mode:

``bash
stat -f 'mode=%Sp owner=%Su group=%Sg' \
'/Applications/ChatGPT.app/Contents/Resources/plugins/openai-bundled/plugins/latex/assets/latex.png'
``

  1. Start Codex and monitor:

``bash
watch -n 5 'du -sh ~/.codex/.tmp/bundled-marketplaces; find ~/.codex/.tmp/bundled-marketplaces -maxdepth 1 -name "*.staging-*" | wc -l'
``

  1. Inspect the Codex Desktop log for plugin_marketplace_folder_write_failed and cleanup_staging_after_write.
  2. Observe a new approximately 101 MiB staging directory after each failed retry.

Locally changing only the resource mode fixed the issue:

sudo chmod 0644 '/Applications/ChatGPT.app/Contents/Resources/plugins/openai-bundled/plugins/latex/assets/latex.png'

After that change, the exact ditto --noqtn copy succeeded and the app logged:

plugin_marketplace_folder_write_succeeded
bundled_plugins_runtime_marketplace_written pluginCount=7
plugin_marketplace_sync_completed

No additional staging directories were created after the successful sync.

What is the expected behavior?

  • Every bundled marketplace resource should be readable by the user running Codex (for example, regular resource files should ship as 0644).
  • Marketplace materialization should succeed without requiring local changes inside the signed app bundle.
  • Failed materialization should recursively clean its staging directory, or garbage-collect stale staging directories on the next startup.
  • Repeated failures should use bounded retries/backoff and must not consume unbounded disk space.

Additional information

This is related to the staging cleanup class reported in openai/codex#21005, but has a concrete macOS packaging trigger: a single unreadable bundled resource. It is also adjacent to bundled marketplace issues such as openai/codex#25758, but this report is not about plugin filtering or configuration overwrite.

Suggested safeguards:

  1. Normalize/validate permissions for all regular resources during macOS packaging.
  2. Add a release check that copies the bundled marketplace as a non-root user.
  3. Make staging cleanup recursive and resilient to partial copies.
  4. Garbage-collect stale openai-bundled.staging-* directories before a new attempt.

View original on GitHub ↗

4 Comments

github-actions[bot] contributor · 1 month ago

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

  • #34541

Powered by Codex Action

minoru-s · 1 month ago

I can confirm this issue on Codex desktop 26.715.72359 (build 5718) in a multi-user macOS setup.

Additional trigger details:

  • /Applications/ChatGPT.app was owned by local account A while Codex was run by local account B.
  • In this installation, 11 static resources (images, icons, and audio) were owned by account A with mode 0600. Reconciliation consistently stopped at Contents/Resources/plugins/openai-bundled/plugins/latex/assets/latex.png.
  • Each app focus triggered another reconciliation attempt. It failed with Permission denied, then staging cleanup failed with ENOTEMPTY.
  • Each orphaned $HOME/.codex/.tmp/bundled-marketplaces/openai-bundled.staging-* directory was about 100 MB. They accumulated to roughly 48 GB in this case.

Workaround verification:

Changing only those 11 unreadable static resources from 0600 to 0644 immediately fixed reconciliation. The next focus-triggered reconcile completed without either error, and no new staging directories appeared.

This suggests a multi-user installation/update permission trigger in addition to the staging-cleanup leak. Expected behavior would be that app-bundle resources remain readable to other local macOS users, and that failed reconciliation removes staging directories or backs off instead of leaking disk space.

I also submitted the private in-app /feedback report. I can provide sanitized diagnostics or test a future build if useful.

zanllp · 1 month ago

This is not a minor cleanup bug. A desktop app must not be able to consume an entire disk because one bundled 14 KB PNG shipped with the wrong mode.

I hit the exact same failure on macOS:

  • plugin_marketplace_folder_write_failed
  • latex.png: Permission denied
  • plugin_marketplace_folder_remove_failed with ENOTEMPTY
  • repeated openai-bundled.staging-* directories, roughly 100 MB each

The result on my machine was 1,500 leaked staging directories consuming about 140 GB, leaving only about 400 MB free and pushing the disk to 100%. After manually deleting them, free space jumped to 147 GiB. This caused serious system disruption and could easily lead to corrupted databases, failed builds, or loss of unsaved work.

An unbounded retry loop plus broken cleanup is unacceptable for a desktop application, especially for a background plugin sync that the user did not initiate. The implementation needs more than a packaging permission fix:

  1. Recursively clean staging directories on every failure path.
  2. Garbage-collect stale openai-bundled.staging-* directories on startup.
  3. Add bounded retries with exponential backoff.
  4. Stop retrying when disk space becomes low.
  5. Add a packaging test that copies all bundled resources as a non-root user.
  6. Add an end-to-end regression test proving repeated sync failures cannot grow disk usage without bound.

The current app on my machine is now 26.721.31836, and latex.png is 0644; no new staging directories have appeared after cleanup so far. But the missing cleanup and unbounded-growth safeguards still need to be fixed, because the next unrelated copy failure can trigger the same disaster again.

saidelike · 25 days ago

I had the same issue, and looks like the latest ChatGPT Desktop version fixed it?

Your machine has exactly the reported symptoms:

  • 405 abandoned staging directories
  • Approximately 101 MB each
  • 28 GB total
  • Log errors copying latex.png because of Permission denied
  • Subsequent cleanup fails with ENOTEMPTY
  • Codex retries and creates another complete staging directory

The affected Codex/ChatGPT build shipped latex.png with permissions that prevented the logged-in user from reading it. Your older logs confirm this exact failure.

Good news: your currently installed version is newer (26.727.51351) and its latex.png now has correct readable permissions. The directory count remained at 405 during my latest check. This suggests the active cause has been fixed by the update, but the update did not garbage-collect the 28 GB already leaked.

With ChatGPT/Codex completely quit, the 405 openai-bundled.staging-* directories can be removed. Do not delete the whole ~/.codex directory—only the abandoned staging directories under .tmp/bundled-marketplaces.