You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[bug] Upgrade Marketplaces trigger timeout after 30s would cause massive staging cache content in ".tmp" folder #38770
Every auto-upgrade attempt runs a full git clone under this budget. For a
marketplace backed by a large repository (my case: volcengine/OpenViking,
~332MB worktree + ~236MB .git) on a modest connection, 30s is never enough,
so the upgrade fails every single time:
WARN codex_core_plugins::manager: failed to auto-upgrade configured marketplace
marketplace="openviking"
error=git clone marketplace source timed out after 30s
There is no config key, env var, or CLI flag to raise it — [marketplaces.*]
only accepts source_type, source, ref_name, sparse_paths, last_updated, last_revision.
2. Failed upgrades leak their staging directories
Each attempt clones into a marketplace-upgrade-* temp dir under ~/.codex/.tmp/marketplaces/.staging/. After a timeout the directory is
abandoned, not deleted, and the upgrade is retried on every app restart /
periodic refresh. In ~6 hours this accumulated 194 orphaned directories,
43GB on my machine (mix of empty dirs, complete ~332MB clones, and partial
500–680MB clones). Since the clone is retried forever and never succeeds, the
disk usage grows unboundedly.
The staging dir is created with tempfile::Builder::new().prefix( "marketplace-upgrade-").tempdir_in(...), so it should self-clean on Drop —
empirically it does not when the upgrade fails.
What steps can reproduce the bug?
. Add a git-backed marketplace whose full clone takes >30s on your connection:
With that configuration, adding took 6.38 seconds and a subsequent marketplace upgrade took 6.56 seconds.
The failed operations also left staging data under $CODEX_HOME/.tmp/marketplaces/.staging: four directories totaling 846.88 MiB, including a completed marketplace-upgrade-* directory of approximately 223.38 MiB. This appears related to #38770.
Most complete clones were approximately 0.60–0.61 GB each and contained 1,271 files. During one long-running Codex session alone, another 72 directories / 31.47 GB appeared.
The local Codex log contains the matching failure (marketplace name and local path redacted):
WARN codex_core_plugins::manager:
failed to auto-upgrade configured marketplace marketplace="<redacted>"
error=git clone marketplace source timed out after 30s:
Cloning into '<CODEX_HOME>\.tmp\marketplaces\.staging\marketplace-upgrade-...'
The staging directory was not reclaimed on later app starts or later marketplace operations. Disk usage continued to grow.
Windows-specific cleanup detail
When manually cleaning the staging directory, a normal recursive delete removed only 152 of the 481 directories. The remaining 329 directories contained 983 large Git pack files under .git\objects\pack; those files had the Windows ReadOnly attribute. Example:
Attributes : ReadOnly, Archive
Error : Access to ...\.git\objects\pack\pack-....idx is denied
After clearing the ReadOnly attribute, all remaining staging directories could be deleted, recovering approximately 198 GB.
Expected behavior
Always remove marketplace-upgrade-* after success, timeout, validation failure, or cancellation.
Run a startup/periodic janitor for stale marketplace staging directories.
Clear or handle Windows read-only Git pack attributes during cleanup.
Make the 30-second clone timeout configurable or avoid repeated full-history clones (for example, shallow clone or fetch/update an existing mirror).
This is not just a small temp-file leak: in normal desktop use it can consume hundreds of gigabytes and exhaust the volume.
Another Windows reproduction, with a permanent trigger from a common public marketplace: https://github.com/dotnet/skills.git (dotnet-agent-skills).
Environment: codex-cli 0.162.1, Windows 11 (10.0.26200).
last_updated has not moved since 2026-08-31, so no upgrade has succeeded in about six weeks. Every attempt fails the same way:
WARN codex_core_plugins::manager failed to auto-upgrade configured marketplace marketplace="dotnet-agent-skills" error=git clone marketplace source timed out after 30s: Cloning into 'C:\Users\<user>\.codex\.tmp/marketplaces\.staging\marketplace-upgrade-sayX8U'...
Updating files: 62% (2184/3512)Updating files: 63% (2213/3512)...
The download finishes inside 30 seconds. The timeout fires during checkout: the logged attempts reached between 62% and 87% of roughly 3,500 files. File creation on Windows is slow, probably because of antivirus scanning and NTFS overhead. As a result, this repository never finishes checking out in time on this machine. The failure is permanent rather than transient.
Leak rate:.staging held 13 marketplace-upgrade-* directories, all created between 14:24 and 14:56 today. Ten were complete 381 MB clones; three were empty. That is 3.72 GB in about 30 minutes, from normal use with a few Codex sessions open.
Requests, in order of impact:
Delete the staging directory when an upgrade fails or times out. On Windows, clear the read-only attribute on .git/objects/pack/* first, or the recursive delete fails.
Make the timeout configurable, or apply it to the network fetch only and not to checkout.
Clone shallowly and sparsely (--depth 1 --filter=blob:none, plus sparse checkout of the marketplace and plugin paths). The upgrade only needs the manifest and plugin directories, not 3,500 files of history and tests.
Back off after repeated failures for the same marketplace and revision, rather than recloning at every startup.
Another reproduction on Linux (Arch), codex-cli 0.164.0.
Marketplace: https://github.com/pbakaus/impeccable.git (no sparse_paths; the installed snapshot is ~720 MB). codex plugin marketplace upgrade impeccable fails every time with git clone marketplace source timed out after 30s.
~/.codex/.tmp/marketplaces/.staging/ had grown to 53 GB in 810 abandoned marketplace-upgrade-* / marketplace-linux-* directories before I emptied it by hand.
One observation that may help others until there is a fix: codex plugin marketplace add (marketplace_add/install.rs, run_git) runs git without any timeout, so marketplace remove <name> followed by marketplace add <source> gets a large marketplace current where upgrade cannot. A configurable timeout (or the same no-timeout path for upgrade) plus removing the staging dir on failure would fix both halves.
Activity
michaelsamoilenko commentedon Sep 16, 2026
Reproduced on Windows with
codex-cli 0.154.0.Environment:
10.0.26200.02.51.1.windows.17.6.6https://github.com/dotnet/skills.gitCommand:
Result:
The checkout eventually reaches 100%, but Codex still rejects it because the 30-second deadline has already elapsed.
Independent measurements on the same machine:
66.67 seconds,.gitsize approximately224.76 MiB8.02 seconds,.gitsize approximately3.93 MiBcodex plugin marketplace add dotnet/skillssucceeds after approximately 69 secondsmarketplace upgradefails because it enforces the 30-second limitA sparse marketplace is an effective workaround:
With that configuration, adding took
6.38 secondsand a subsequent marketplace upgrade took6.56 seconds.The failed operations also left staging data under
$CODEX_HOME/.tmp/marketplaces/.staging: four directories totaling846.88 MiB, including a completedmarketplace-upgrade-*directory of approximately223.38 MiB. This appears related to #38770.KanadeK commentedon Sep 21, 2026
I can confirm this issue still reproduces on the current Windows desktop build, with severe disk impact.
Environment
26.915.31945CODEX_HOME: non-default location on a secondary NTFS volumeObserved result
The directory below accumulated 481 orphaned upgrade clones totaling 198.02 GB:
Most complete clones were approximately 0.60–0.61 GB each and contained 1,271 files. During one long-running Codex session alone, another 72 directories / 31.47 GB appeared.
The local Codex log contains the matching failure (marketplace name and local path redacted):
The staging directory was not reclaimed on later app starts or later marketplace operations. Disk usage continued to grow.
Windows-specific cleanup detail
When manually cleaning the staging directory, a normal recursive delete removed only 152 of the 481 directories. The remaining 329 directories contained 983 large Git pack files under
.git\objects\pack; those files had the WindowsReadOnlyattribute. Example:After clearing the
ReadOnlyattribute, all remaining staging directories could be deleted, recovering approximately 198 GB.Expected behavior
marketplace-upgrade-*after success, timeout, validation failure, or cancellation.This is not just a small temp-file leak: in normal desktop use it can consume hundreds of gigabytes and exhaust the volume.
thomhurst commentedon Oct 14, 2026
Another Windows reproduction, with a permanent trigger from a common public marketplace:
https://github.com/dotnet/skills.git(dotnet-agent-skills).Environment: codex-cli 0.162.1, Windows 11 (10.0.26200).
Config:
last_updatedhas not moved since 2026-08-31, so no upgrade has succeeded in about six weeks. Every attempt fails the same way:The download finishes inside 30 seconds. The timeout fires during checkout: the logged attempts reached between 62% and 87% of roughly 3,500 files. File creation on Windows is slow, probably because of antivirus scanning and NTFS overhead. As a result, this repository never finishes checking out in time on this machine. The failure is permanent rather than transient.
Leak rate:
.stagingheld 13marketplace-upgrade-*directories, all created between 14:24 and 14:56 today. Ten were complete 381 MB clones; three were empty. That is 3.72 GB in about 30 minutes, from normal use with a few Codex sessions open.Requests, in order of impact:
.git/objects/pack/*first, or the recursive delete fails.--depth 1 --filter=blob:none, plus sparse checkout of the marketplace and plugin paths). The upgrade only needs the manifest and plugin directories, not 3,500 files of history and tests.marketplace-upgrade-*directories at startup (fix(marketplace): prune stale upgrade staging directories #30620).Workaround for other Windows users, run while Codex is closed:
Related: #21005, #39421, #45943, #51609.
chore(loop): prune leaked Codex marketplace staging clones each unit
chore(loop): prune leaked Codex marketplace staging clones each unit
chore(loop): prune leaked Codex marketplace staging clones each unit
chore(loop): prune leaked Codex marketplace staging clones each unit
chore(loop): prune leaked Codex marketplace staging clones each unit
chore(loop): prune leaked Codex marketplace staging clones each unit
chore(loop): prune leaked Codex marketplace staging clones each unit
chore(loop): prune leaked Codex marketplace staging clones each unit
jonasyr commentedon Oct 24, 2026
Another reproduction on Linux (Arch),
codex-cli 0.164.0.https://github.com/pbakaus/impeccable.git(nosparse_paths; the installed snapshot is ~720 MB).codex plugin marketplace upgrade impeccablefails every time withgit clone marketplace source timed out after 30s.~/.codex/.tmp/marketplaces/.staging/had grown to 53 GB in 810 abandonedmarketplace-upgrade-*/marketplace-linux-*directories before I emptied it by hand.One observation that may help others until there is a fix:
codex plugin marketplace add(marketplace_add/install.rs,run_git) runs git without any timeout, somarketplace remove <name>followed bymarketplace add <source>gets a large marketplace current whereupgradecannot. A configurable timeout (or the same no-timeout path forupgrade) plus removing the staging dir on failure would fix both halves.