Repository navigation
Description
Environment
ChatGPT/Codex desktop 26.1013.31256 (build 20586), Apple M4 MacBook Air, 16 GB RAM, macOS 26.5.1. Observed October 18, 2026. Local execution with multiple plugins and scheduled tasks enabled.
Observed behavior
After a full desktop restart around 20:56 UTC, repeated copies of local tool services accumulated while investigating memory usage. This was active diagnostic use, not a controlled idle test. Existing chats and background/scheduled activity may contribute.
| Measurement | Approximately 21:07 UTC | 21:34:53 UTC |
|---|---|---|
| App and descendant processes, summed memory footprint | 6035 MiB | 9732 MiB |
| App-family process count | 111 | 198 |
| Node helper processes | 78 | 156 |
| Node helper summed footprint | 2273 MiB | 4543 MiB |
| System swap used | 2656 MiB | 5095 MiB |
| Memory pressure | Yellow | Yellow |
Measurements used process ancestry and macOS top memory values. These are summed process footprints, not unique physical RAM, and other apps were running.
Earlier, 11 concurrent copies each of code-review, app-tools, Todoist and several other local helper services were observed. The 11 code-review processes totaled approximately 942 MiB. This does not mean 11 reviews were actively running.
The desktop log recorded 29 code-review server startup events across 27 distinct thread IDs between launch and approximately 21:35 UTC. Some new IDs also had these messages:
Received turn/started for unknown conversation
Conversation state not found
Received turn/completed for unknown conversation
Their origin and connection to retained processes remain unresolved.
Archiving one idle chat resulted in that chat reporting notLoaded, but overall process counts continued to grow. There is no immediate before/after sample or PID-to-thread mapping proving which processes that archive released. No plugins were disabled and no helper processes were manually killed.
Expected behavior / requested investigation
Please investigate lifecycle and cleanup of per-thread MCP/tool servers, including internal or transient threads, restored chats and scheduled activity. Determine whether servers remain alive after their owning work completes or unloads, and whether bounded retention or shared services can avoid the memory amplification without disabling functionality.
This is a suspected session/tool-process retention bug, not a proven heap leak. A minimal reproduction and exact trigger are not yet established. Local inspection suggests a three-hour renderer inactivity retention policy and a ten-eligible-thread cap; please confirm how these interact with internal threads and server cleanup.
Privacy
This report intentionally excludes chat contents, chat titles, thread identifiers, account details and raw logs. Sanitized measurements and relevant log excerpts can be supplied separately if needed.
Activity
github-actions commentedon Oct 18, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
bomtobe-hgkim commentedon Oct 18, 2026
A useful lifecycle regression case may be to open several MCP-enabled threads, record server-process counts, then close/archive one thread and resume/restart the app. Assert against the intended sharing policy and check for orphaned or duplicate servers; repeat with scheduled tasks enabled/disabled to separate contributors. I’m with BOMTOBE/Orke and haven’t reproduced this.
nokiyliao commentedon Oct 19, 2026
Additional macOS measurements: retained renderer memory and repeated local MCP services
Adding measurements from another affected Mac to this existing issue rather than opening a duplicate. These observations support investigation of tool-server lifetime and renderer retention; they do not establish a heap leak, that the servers are orphaned, or a causal link between them.
Environment and impact
2DC432GLL2.Process footprint measurements
proc_pid_rusagephysical-footprint measurements were attributed by executable identity, process ancestry and launch time, withvmmap -summarychecks of the major processes.The largest renderer alone ended near 3.52 GiB. A separate
vmmapcheck reported about 3.5 GiB physical footprint, a 3.6 GiB lifetime peak, and about 2.3 GiB swapped writable regions.vmmapwarned that PartitionAlloc malloc-zone analysis was incomplete, so these measurements do not identify which JS/DOM/history/image/cache objects were retained.The main desktop app-server was about 659 MiB, with a reported lifetime peak of 1.3 GiB in this app generation. It was not the largest current owner. Earlier large-history backend spikes should be investigated separately from this window.
Footprint includes charged compressed/swapped memory and is not RSS. Summing process footprints is an attribution estimate, not unique physical system RAM. Other applications and small diagnostic processes were present.
Repeated MCP/tool-service instances
A concurrent process/cwd census around 02:07:46 UTC, distinct from the final sample above, identified:
These are concurrent instances, not counts of active reviews or meetings. No exact PID-to-owning-chat mapping was established, and process counts alone do not show which instances should have been released. No services were disabled, no processes were manually killed, and the child-agent limit was not reduced.
System pressure and background retries
The inspected current-day log up to 02:08:51 UTC contained 890 such failures across nine chat IDs; one chat ID appeared 107 times. The allocation cost of these retries is unknown. This observation resembles #53677, but it does not prove that denied hydration caused the renderer footprint or the repeated MCP instances.
Requested investigation
Please investigate renderer retained-object ownership and per-thread MCP lifecycle together, while keeping their causal relationship open. In particular:
This report was prepared with AI-assisted read-only process/log analysis and the user's authorization. It contains no conversation text, chat titles/IDs, account details, private filesystem paths, raw logs, credentials, or screenshots. A sanitized measurement summary can be provided if useful. No clean-profile, controlled lifecycle, retained-object heap, or post-fix acceptance result is claimed.
nokiyliao commentedon Oct 19, 2026
Follow-up: eager MCP startup in ephemeral helpers (2026-10-19)
I narrowed one amplification path to the startup policy used by ephemeral desktop helpers, including title generation and composer predictions. This does not establish that all of the application's memory footprint comes from MCP.
In both the version-matched 0.163.0-alpha.10.2 source and pinned main,
build_mcp_runtime_inputselectsLazyWhenCachedonly forSessionSource::SubAgent. An ephemeral desktop thread can therefore still selectEagereven when the process already holds a reusable MCP tool catalog. The prediction fork handler explicitly requires an ephemeral fork for prediction mode.The existing connection manager already implements the desired separation: expose eligible cached tool definitions while keeping the connection dormant; start and validate the live connection on an actual tool call. Merely setting
startup_readiness = "catalog"changes readiness waiting, but still starts the connection, so that is not an equivalent fix for process amplification.A small local candidate extends the existing
LazyWhenCachedeligibility toconfig.ephemeral. It leaves the cache eligibility checks, explicit reconnect path, tool visibility checks, actual invocation, normal persistent root startup, and subagent limits unchanged. I parameterized the existing MCP process-lifecycle integration test to cover both the existing subagent source and an ephemeralSessionSource::VSCodesource. The test checks that a warm unused MCP does not create a new PID and that a subsequent real MCP call starts a live process and returns its result; it also retains the existing visibility and interruption checks.Validation: both parameterized integration cases passed (2 passed, 0 failed, 0 ignored), with the repository CI's
RUST_MIN_STACK=8388608setting. The initial local run without that setting overflowed the test thread stack; the original failure is retained locally.rustfmt --checkandgit diff --checkpassed. The source candidate was tested against pinned main89461ea6833832b0551ce24ee32205824d5c108d; this is not an end-to-end memory measurement of the installed app.RUST_MIN_STACK=8388608 cargo test --locked --offline -p codex-core --test all cached_mcp_startup_is_eager_for_root_and_lazy_for_background_threads -- --nocapture --test-threads=1This is a source candidate, not a shipped signed fix. The installed OpenAI-signed runtime was not replaced, no user sessions or private native databases were rewritten, and no feature or subagent limit was disabled or reduced. End-to-end application memory acceptance remains pending an official signed implementation. Following the repository contribution policy, I am providing the root-cause analysis here rather than opening an external PR.
Related reports: #54988 and #54700.
nokiyliao commentedon Oct 19, 2026
Sanitized maintainer follow-up for #55141
Prepared for review only; not posted by this bounded investigation. Please preserve the official App and backend signatures, originalIDs, all enabled functionality and services, and current concurrency and subagent limits.
The installed desktop is 26.1013.40934 (build 20770). Prior static verification passed for the official App and bundled backend; this follow-up did not replace either component or change code, configuration, native data, or runtime adoption.
The complete public issue snapshot returned HTTP 200 at 2026-10-19 07:42:24 UTC. It remains OPEN and includes all four comments and nine timeline entries, with both timeline pagination flags false. Linked and closing PR lists are empty. No commenter has a verifiable maintainer role in the returned data: one Bot is marked CONTRIBUTOR and three User comments are marked NONE. This does not prove that an unbadged participant cannot be a maintainer. See the existing issue.
The 02:58 UTC follow-up describes a local source candidate extending LazyWhenCached eligibility to config.ephemeral. It claims two integration cases passed and explicitly states, “This is a source candidate, not a shipped signed fix.” Its links identify version-matched and pinned implementation source, a prediction fork handler, and contribution policy. They supply no patch diff, PR, signed package, or verified installed adoption. Those linked sources and claimed tests were not independently checked here. An absent link on this page is not evidence that no repair exists elsewhere.
Current local evidence supports a separate renderer hydration problem:
Please resolve the following before an App repair is claimed:
The sealed app.asar is covered by CodeResources/hash2 and ElectronAsarIntegrity. Editing it would invalidate the OpenAI signature. No verified user owner-reset or cache-clear control, or archive source maps, was established. An official signed implementation and observable memory attribution remain the blockers. No current probe, install, restart, lifecycle experiment, cache clearing, settings change, additional publication, or background follow-up was performed or started in this task.
nokiyliao commentedon Oct 19, 2026
Follow-up: unresolved RPC callback ownership and cancellation cleanup in App 26.1013.40934 (build 20770).
This adds an isolated lifecycle reproducer and candidate repair semantics to the existing report. It does not establish that callback retention explains all App memory or the previously reported MCP process accumulation.
The reproducer uses the relevant extracted/reconstructed loaded class paths in an offline fixture, rather than exercising App integration. Synthetic sequence:
After 32 cancellation/disposal cycles, the original implementation retains 32 occupied callback slots; the candidate retains 0. Count occupied entries, not array.length: deleting a slot can leave an array hole. Recorded validation passed 12/12 offline checks, including lifecycle fixtures, counter checks, syntax/CLI checks, command-schema checks, and candidate/fixture equivalence. These checks do not include App integration.
The lifecycle findings and candidate behavior are:
Candidate patch SHA-256:
8442f0efc76223d89a8e8d0653b539ac39d8414681d1cd457b8ee290e5b05dcb. This identifies the locally tested review candidate; the digest does not establish upstream adoption. No proprietary minified source or heap is included here.Two native read-only snapshots completed while both associated live-counter readers later ended with a bounded CDP deadline. The last renderer observation in each native snapshot was:
Memory units above preserve macOS top/sysctl output. Pressure and swap are system observations; CMPRS is the renderer's compressed-memory reading. These values must not be added together or treated as bytes reclaimed by the candidate. No diagnostic Send or Stop occurred, no diagnostic cancellation/request ID exists, and the settled reader did not complete. These are partial observations without send/cancel causality or a before/after repair result. An earlier single-heap estimate of about 52.3 MiB for an overlapping retained model subgraph also does not establish that all callback entries are stale or explain total renderer memory.
The native updater's supplied observation identifies 26.1013.40934/build 20770 as the latest offered compatible App. No adoptable local repair preserving the official signature has been established, and the candidate has not been applied to the App. Please review the lifecycle correction and reentrant/consumer-failure ordering, integrate it in a compatible officially signed release, and validate actual send/cancel memory under a matched workload while preserving the existing session, all features, and concurrency limits. Full functional validation and real send/cancel memory acceptance remain outstanding.
Tracking marker:
callback-cleanup-repro-20261019-v1omarpinarecords commentedon Oct 21, 2026
Additional macOS observations may help distinguish helper lifetime from renderer growth.
Environment: macOS27.0.1 on arm64,8GiBRAM; ChatGPT/Codex desktop26.1016.51333 build21161; bundled backend0.163.0-alpha.11. The updater reported up to date at the retained check.
Before an owner-side reboot,278 app-family processes and7GiB reserved swap were observed. Twenty Code Review helper processes summed approximately1.23GiB of process footprint. Summed footprints are not exclusive physical RAM. One naturally completed helper remained loaded exactly30minutes.
The version-matched schema supports thread_unload_delay_secs, default1800, after no subscribers and no activity. Setting it to60 was the only semantic user-config change. Following a separately observed reboot, a helper finished sampling at10:24:30.059343EDT and tore down at10:25:30.306730 with had_active_turn=false:60.247seconds. This supports loaded shorter retention for one natural completion; cancellation and preservation of prediction output have not been independently tested.
The shorter retention has not resolved the disk recurrence. Between10:27:22 and10:43:00EDT on October21:
These endpoints do not prove a leak or isolate renderer causality. The post-reboot workload also differed from the earlier workload, so the lower process count is not matched-workload acceptance.
Version-matched mcp_runtime.rs selects cached deferred startup for subagents but eager startup for ordinary sessions. A source candidate extends the existing LazyWhenCached selection to configured ephemeral sessions and parameterizes existing cache tests for that case. It preserves existing cache-validity, permission and invocation logic. The patch applies cleanly to alpha.11 source; it has NOT been compiled, run through Rust tests, installed or validated as a shipped fix. This is separate from the earlier contributor's candidate/test claim in #55141 (comment) .
Requested maintainer guidance: confirm whether ephemeral desktop helpers should share the cache-based startup policy, identify any supported signed fix/release, and advise on the remaining renderer growth without changing prediction settings or disrupting active work. Acceptance should cover unused-service startup, successful real invocation, cleanup on completion/cancellation, preservation of parent chats and predictions, and at least35minutes of comparable ordinary use with bounded helpers and no continuing swap/free-space decline.
A separate user-owned transaction writer also amplified local storage. That custom-code problem is being handled independently and is not attributed to the Codex runtime.
No private conversations, case files, local usernames/paths, raw logs, credentials, feedback identifiers or attachments are included in this draft.
omarpinarecords commentedon Oct 23, 2026
Additional native macOS observations from October 22, 2026. The installed desktop bundle reports 26.1016.62342/build 21477. These measurements do not independently bind every loaded renderer resource to that build. The previously prepared 35-minute test remains specifically for signed build 21421 and must not be treated as a 21477 acceptance test.
During ordinary use, with active work, predictions and Google Drive left running:
Between the last two endpoints, free space fell 4,195,225,600 bytes while reserved system swap increased 4,294,967,296 bytes. The reserve increase exceeds net free-space loss by 99,741,696 bytes; it must not be described as an exact or exclusive attribution. The history database's allocated size and the separately tracked transaction record/journal allocation were both unchanged during that interval. Those record/journal measurements exclude referenced payload blobs and are not a whole-disk inventory.
At 20:03, 45 app-family processes had complete native working-directory observations. Summed process physical footprint was 10,432,812,536 bytes, including 7,667,888,616 across renderer processes and 1,737,622,312 across other helpers. Summed footprint is not exclusive physical RAM, and system swap includes other applications. These endpoints establish renewed pressure, not exclusive application causation or a particular leak.
The existing 60-second completed-helper unload mitigation was previously observed working; it did not establish resolution of renderer/swap growth. Retained managed worktrees currently allocate only 143,360 bytes, so worktree cleanup cannot account for this multi-GiB capacity loss. No restart, process termination, plugin invocation for testing, cleanup, sync change or renderer instrumentation was performed for these observations.
Could engineering provide either (1) a version-matched signed correction for an established renderer or helper lifecycle/retention cause, or (2) an officially supported user-initiated metadata-only diagnostic joining OS PID and process-creation identity, renderer/WebContents lifecycle identity and the same memory sample? The requested diagnostic excludes chat contents, titles, URLs and message payloads. Please identify any supported noninterrupting memory-release control if one exists. A source patch or generic release note would not establish installed delivery or acceptance; the original memory/swap/disk behavior still needs to pass under comparable ordinary use.
Masu135 commentedon Oct 30, 2026
Same accumulation on Windows desktop (codex-cli 0.164.0), with one concrete trigger identified that may explain part of the "existing chats and background activity" contribution here.
Backend-notification resumes reload idle threads with a full per-thread MCP set, and those threads then never unload.
From
logs_2.sqlite+ Win32_Process ancestry (2026-10-30, times UTC+8), withthread_unload_delay_secs = 300set:Agent loop exitedat 17:10 and 17:51).__slingshot_backend_notification_thread_resume__:<thread_id>.Overall at the time: 302 app-server descendants / 12.5 GiB private on a 32 GiB machine. The rest was the active chats plus completed subagents that never unload (tracked in #38247).
A quick way to check whether this is happening to you: look for
__slingshot_backend_notification_thread_resume__request ids in the app-server logs around the times new batches of tool servers appear.Details and the subagent side: #38247 (comment)
suryar113 commentedon Nov 3, 2026
Hi gturbahn2, thanks for the report on per-thread tool servers piling up on macOS. I'm working on an experimental Mac tool for people who run several coding agents at once. When agents like this are running, do your own builds and tests slow down, and what do you do about it? A couple of lines is plenty. I'm not selling anything, just trying to learn whether the problem is real.
gturbahn2 commentedon Nov 5, 2026
suryar113 commentedon Nov 6, 2026
That makes sense, and it's useful to know it doesn't clear after the process ends. Two questions if you don't mind. Do you usually run more than one Codex task at once? And when the laptop slows down, do your own builds or editor lag first, or does everything get sluggish together?
IgorGanapolsky commentedon Nov 11, 2026
After closing a thread, inspect candidates with
ps -Ao pid,ppid,etime,command | grep -i mcp. Verify the specific server belongs only to that closed thread, not a live client, before usingkill <pid>; don't infer that every remaining MCP server is abandoned. Full disclosure: I build Mac YOLO Safeguards, a free signed menu-bar app for agent-process cleanup; Pro adds Auto-Guard for automatic cleanup. https://macyolosafeguards.iogturbahn2 commentedon Nov 12, 2026
suryar113 commentedon Nov 13, 2026
Yeah, that happens for me too. I wrote a free script that scores how my Mac is doing when coding agents are running. You run it with this script: brew install yare-org/tap/yare-doctor && yare-doctor, or if you want the compact card version, it's yare-doctor card.
I'm also building a mac app that's supposed to solve this exact problem, waitlist is here: https://meetyare.vercel.app
Let me know your results.