Repository navigation
fix(server): unload Codex threads left idle on the shared app-server - #16917
Merged
juliusmarminge merged 2 commits intoOct 7, 2026
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
juliusmarminge
marked this pull request as ready for review
October 7, 2026 20:47
juliusmarminge
enabled auto-merge (squash)
October 7, 2026 20:52
github-actions Bot
added a commit
to omarcresp/t3code-flake
that referenced
this pull request
Oct 8, 2026
## What's Changed * feat(models): add Claude Haiku 5.5 and retire Sonnet 5 and Opus 5 to legacy by @juliusmarminge in pingdotgg/t3code#16903 * fix(web): iPhone Duo folds animate, center on the hinge, and keep the phone's orientation by @gabrielelpidio in pingdotgg/t3code#16885 * fix(server): Claude 5-series models always run 1M context by @juliusmarminge in pingdotgg/t3code#16908 * fix(desktop): setup prompts name a t3 that runs on desktop installs by @juliusmarminge in pingdotgg/t3code#16676 * feat(desktop): install the t3 command from Settings by @juliusmarminge in pingdotgg/t3code#16683 * fix(web): show live names in thread-read activity by @Bil0000 in pingdotgg/t3code#13140 * feat(mobile): adopt v5 navigation and native iPad columns by @juliusmarminge in pingdotgg/t3code#16733 * fix(mobile): Android composer picker scrolls past the first four rows by @shivamhwp in pingdotgg/t3code#15856 * fix(desktop): sign-in and captchas work again in desktop browser tabs by @juliusmarminge in pingdotgg/t3code#16939 * fix(server): missing project folders no longer log favicon warnings by @yordis in pingdotgg/t3code#16757 * fix(server): unload Codex threads left idle on the shared app-server by @RhysSullivan in pingdotgg/t3code#16917 * fix(web): fast typing no longer scrambles text when type-to-focus kicks in by @otavio in pingdotgg/t3code#14595 * fix(web): simplify workspace card rows by @Bil0000 in pingdotgg/t3code#16823 * fix(web): Copy MCP URL shows up for environments reached over plain http by @SunkenInTime in pingdotgg/t3code#16909 * fix(web): C#, Java, PHP and 11 other languages get file icons by @juliusmarminge in pingdotgg/t3code#16974 * feat(clients): live row shows the agent's latest thought by @t3dotgg in pingdotgg/t3code#16284 * feat(web): block-level Markdown in the rich text composer by @chrisdeeming in pingdotgg/t3code#14677 * fix(web): center project monograms in settled rows by @Aforno in pingdotgg/t3code#16841 * fix(web): cancelling a new citation no longer leaves a stray space by @Aforno in pingdotgg/t3code#16828 * fix(settings): provider updates show live progress instead of a bare spinner by @shivamhwp in pingdotgg/t3code#16958 * feat(web): find in diffs with Cmd+F by @juliusmarminge in pingdotgg/t3code#14623 * refactor(server): GitHub services are named for the API they call, not gh by @juliusmarminge in pingdotgg/t3code#16967 * refactor(server): GitHub GraphQL batches use variables and share one pager by @juliusmarminge in pingdotgg/t3code#16960 * refactor(server): GitHub source control reads GitHubApi directly by @juliusmarminge in pingdotgg/t3code#16982 * refactor(server): GitHub rate limits read the response headers by @juliusmarminge in pingdotgg/t3code#16986 ## New Contributors * @RhysSullivan made their first contribution in pingdotgg/t3code#16917 * @Aforno made their first contribution in pingdotgg/t3code#16841 **Full Changelog**: pingdotgg/t3code@v0.0.46-nightly.20261007.2787...v0.0.46-nightly.20261008.2801 Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.46-nightly.20261008.2801
github-actions Bot
added a commit
to davidvanderklay/t3code-flake
that referenced
this pull request
Oct 8, 2026
## What's Changed * feat(models): add Claude Haiku 5.5 and retire Sonnet 5 and Opus 5 to legacy by @juliusmarminge in pingdotgg/t3code#16903 * fix(web): iPhone Duo folds animate, center on the hinge, and keep the phone's orientation by @gabrielelpidio in pingdotgg/t3code#16885 * fix(server): Claude 5-series models always run 1M context by @juliusmarminge in pingdotgg/t3code#16908 * fix(desktop): setup prompts name a t3 that runs on desktop installs by @juliusmarminge in pingdotgg/t3code#16676 * feat(desktop): install the t3 command from Settings by @juliusmarminge in pingdotgg/t3code#16683 * fix(web): show live names in thread-read activity by @Bil0000 in pingdotgg/t3code#13140 * feat(mobile): adopt v5 navigation and native iPad columns by @juliusmarminge in pingdotgg/t3code#16733 * fix(mobile): Android composer picker scrolls past the first four rows by @shivamhwp in pingdotgg/t3code#15856 * fix(desktop): sign-in and captchas work again in desktop browser tabs by @juliusmarminge in pingdotgg/t3code#16939 * fix(server): missing project folders no longer log favicon warnings by @yordis in pingdotgg/t3code#16757 * fix(server): unload Codex threads left idle on the shared app-server by @RhysSullivan in pingdotgg/t3code#16917 * fix(web): fast typing no longer scrambles text when type-to-focus kicks in by @otavio in pingdotgg/t3code#14595 * fix(web): simplify workspace card rows by @Bil0000 in pingdotgg/t3code#16823 * fix(web): Copy MCP URL shows up for environments reached over plain http by @SunkenInTime in pingdotgg/t3code#16909 * fix(web): C#, Java, PHP and 11 other languages get file icons by @juliusmarminge in pingdotgg/t3code#16974 * feat(clients): live row shows the agent's latest thought by @t3dotgg in pingdotgg/t3code#16284 * feat(web): block-level Markdown in the rich text composer by @chrisdeeming in pingdotgg/t3code#14677 * fix(web): center project monograms in settled rows by @Aforno in pingdotgg/t3code#16841 * fix(web): cancelling a new citation no longer leaves a stray space by @Aforno in pingdotgg/t3code#16828 * fix(settings): provider updates show live progress instead of a bare spinner by @shivamhwp in pingdotgg/t3code#16958 * feat(web): find in diffs with Cmd+F by @juliusmarminge in pingdotgg/t3code#14623 * refactor(server): GitHub services are named for the API they call, not gh by @juliusmarminge in pingdotgg/t3code#16967 * refactor(server): GitHub GraphQL batches use variables and share one pager by @juliusmarminge in pingdotgg/t3code#16960 * refactor(server): GitHub source control reads GitHubApi directly by @juliusmarminge in pingdotgg/t3code#16982 * refactor(server): GitHub rate limits read the response headers by @juliusmarminge in pingdotgg/t3code#16986 ## New Contributors * @RhysSullivan made their first contribution in pingdotgg/t3code#16917 * @Aforno made their first contribution in pingdotgg/t3code#16841 **Full Changelog**: pingdotgg/t3code@v0.0.46-nightly.20261007.2787...v0.0.46-nightly.20261008.2801 Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.46-nightly.20261008.2801
aorwall
added a commit
to aorwall/t3code
that referenced
this pull request
Oct 12, 2026
Merges `pingdotgg/t3code` `0f09627a11` (44 commits since `cd41c4ada0`) into the fork. Branched from `main` at `75baf5f94`; no other merge PR is open. ## Resolution - **Counts:** 320 files landed against 320 in the upstream range, an exact match. The fork delta is still 765 files. - **Conflicts (2, both `converged`):** - `apps/web/src/components/ChatMarkdown.tsx`: the fork's Moatless Artifact chip still renders before upstream's new thread-link renderer (pingdotgg#17017). - `apps/web/src/components/chat/ThreadDetailsPanel.tsx`: took upstream's merged environment and branch row (pingdotgg#16823) and re-applied `FEATURES.openInEditor`. - `pnpm-lock.yaml` was re-derived with `install.mjs`. - `duplicate-adds.mjs` and `resolution-check.mjs` found nothing. - **Unsupported methods:** added `UnsupportedMethodError` to `mcpApps.callTool`, `toolInfo`, `readResource` and `updateModelContext`. Nothing to drop. - Formatted `docs/fork/inventory.json`, which was unformatted on `main`. ## Verification `verify.mjs` passed duplicate-adds, tripwires, resolution-check, unsupported-methods, lockfile, fmt, lint, typecheck and build. The `test` step failed: - `@t3tools/web` failed the full run and passed in isolation. - In `t3`, `OpenCodeServerLedger`, `AcpAdapterV2`, `OrchestratorReplayFixtures` and `ServerBrowserPage` fail when run alone. This is the same set the 2026-10-07 merge recorded: the sandbox does not reap process groups, `CLAUDE_CONFIG_DIR` leaks, and Playwright's headless shell is missing. Machine, not code. ## Usable as-is - Thread links reference the thread id and open in the app (pingdotgg#17017, pingdotgg#16782 client half) - Find in diffs with Cmd+F (pingdotgg#14623) - Block-level Markdown in the rich-text composer (pingdotgg#14677) - The live row shows the agent's latest thought (pingdotgg#16284), and running subagent cards stay visible (pingdotgg#16878) - Simplified workspace card rows (pingdotgg#16823), centred project monograms (pingdotgg#16841), file icons for 14 more languages (pingdotgg#16974) - Composer fixes: citation-cancel spacing (pingdotgg#16828), type-to-focus scrambling (pingdotgg#14595) - Lineage: Stop on hover (pingdotgg#16791), live names in thread-read activity (pingdotgg#13140) - Model catalogue: Claude Haiku 5.5, with Sonnet 5 and Opus 5 retired to legacy (pingdotgg#16903) - Mobile, desktop and onboarding fixes (pingdotgg#16713, pingdotgg#15856, pingdotgg#16733, pingdotgg#16886, pingdotgg#16885, pingdotgg#16939, pingdotgg#16676, pingdotgg#16887) ## Unsupported in Moatless / needs implementation - **MCP apps inline in threads** (pingdotgg#16236): `mcpApps.callTool`, `mcpApps.toolInfo`, `mcpApps.readResource`, `mcpApps.updateModelContext`, and the `McpAppFrame.tsx` UI. The frame mounts only for a work-log item that carries an MCP app snapshot. Upstream's Codex adapter projects that snapshot; Moatless does not, so nothing renders. Moatless would need to project the snapshots and dispatch the family. The new union entries are recorded in `docs/fork/gaps.md`. - **Provider update live progress** (pingdotgg#16958) and **install the `t3` command from Settings** (pingdotgg#16683): behind `providerConfiguration` and the desktop bridge respectively. Nothing new is reachable. - **Copy MCP URL over plain http** (pingdotgg#16909): still behind `FEATURES.connections`. ## Backend behavior to consider reproducing in Moatless - The orchestrator MCP thread list and detail report and filter on snooze state (`snoozed`, `snoozedUntil`; pingdotgg#16782). - Idle Codex threads are unloaded from the shared app-server (pingdotgg#16917). - A refused Claude turn keeps its session (pingdotgg#16287), and a prompt does not hang on a uuid the session already holds (pingdotgg#16897). - Claude 5-series models always run with 1M context (pingdotgg#16908). - A background Claude subagent's work shows while its parent is idle (pingdotgg#16486). - Worktree cleanup: freed for terminal thread statuses (pingdotgg#15150), removed after squash merges (pingdotgg#14847), files hidden by `showUntrackedFiles=no` are kept (pingdotgg#15834), and Windows long paths work (pingdotgg#14917). - Replaying a command or opening a long thread no longer blocks the server (pingdotgg#17041, pingdotgg#17029). - GitHub: rate limits are read from response headers, and GraphQL batches use variables (pingdotgg#16986, pingdotgg#16960). `ChangeRequest` gained an optional `headSha`. All of these are recorded under "Runtime fixes upstream made to its own server" in `docs/fork/gaps.md`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- Moatless task: https://moatless.soaplabstest.com/tasks/af277a83-a9de-4d81-9c77-866e383cdb99
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #13331 (item 4) and #14187.
Problem
All Codex threads share one
codex app-server, and every loaded native thread runs its own copy of each configured stdio MCP server. Since #14187, a thread is unloaded (thread/unsubscribe) when it detaches: settle, archive, delete, selection change, or handoff. A thread that finishes its turn and is left alone never detaches, so its native thread and MCP servers stay up as long as the shared app-server does. The app-server itself is only released after 30 idle minutes across all threads, which a busy environment rarely reaches.Delegated tasks hit this constantly. Each
delegate_taskchild is a new thread that runs one turn, completes, and is never settled. On one machine over about 22 hours, T3's provider logs showed 89thread/startagainst 5thread/unsubscribe, and the shared app-server had 1,244 descendant processes using about 28 GB (about 19 MCP servers per native thread, 4 of them stdio).Fix
ProviderSessionManagernow applies its existing idle timeout to each thread on a shared runtime. When a thread's turn ends (turn.terminal, or a failed start) and it has no other busy turn, a per-thread timer starts. If no turn starts withinidleTimeoutMs, the thread is unloaded through the sameunloadThread(thread/unsubscribe) that detach uses, and its loaded mark is cleared, so the next turn's resume callsthread/resumeand reloads it.hasPendingBackgroundWorkForThread) stays loaded, because unloading stops Codex background terminals. The timer re-checks after each further idle window.unloadThread, and exclusive runtimes, are unaffected.Evidence
Codex contract. The script below drives
codex app-server(codex-cli 0.157.0) directly, with an isolatedCODEX_HOME, one stdio MCP server, andthread_unload_delay_secs = 2:MCP servers exit if and only if the client unsubscribes, so the cleanup has to come from T3.
Through T3 Code (Nightly 0.0.46-nightly.20261005.2676, macOS), counting descendants of T3's shared app-server:
Tests. There are two new tests in
ProviderSessionManager.test.ts. Both fail onmainand pass with this change.unloads a shared-runtime thread left idle, and reloads it on its next turn: a follow-up turn inside the timeout keeps the thread loaded. A full idle timeout after its last turn unloads it, while another thread's running turn keeps the runtime up. The next resume reaches the provider again.keeps an idle shared-runtime thread loaded while its background work runs: no unload while the per-thread probe reports pending work; unloaded one idle window after it clears.Commands run:
vp test runonProviderSessionManager.test.ts,CodexAdapterV2.test.ts,ProviderTurnStartService.test.ts,ProviderTurnControlService.test.ts,runtimeLayer.test.ts,EffectWorker.test.ts,BackgroundWorkStop.integration.test.ts,RuntimeRequestService.test.ts,CheckpointRollbackService.test.ts,OpenCode2AdapterV2.test.ts: all passed.vp exec tsc --noEmit -p .inapps/server: no errors.vp linton the touched files: clean.Not checked: a patched server running end to end against a live Codex app-server for the full 30-minute default timeout.
repro.mjsandfake-mcp.mjs