pingdotgg / pingdotgg/t3code

[Bug]: Remote server updates accumulate every immutable runtime and consume disk space

Open
#8,345 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
23k
Forks
5.9k
Avg merge
11h 14m
Merged PRs (30d)
357

Description

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

  1. Install and run T3 Code as the Linux background service.
  2. Connect from the T3 Code client and use the remote Update server button whenever a newer version is offered.
  3. Repeat this across several nightly versions.
  4. Inspect ~/.t3/runtime/versions and its disk usage:
find ~/.t3/runtime/versions -mindepth 1 -maxdepth 1 -type d | wc -l
du -sh ~/.t3/runtime/versions ~/.t3/runtime

On the observed host, the service log contains 12 successful Server update prepared; handing off to the service launcher. events. There are 13 completed version directories: the original runtime plus one new immutable npm installation for each update.

Expected behavior

After an update is durably committed, T3 Code should provide a supported way to prune obsolete completed runtimes, or automatically prune runtimes that are no longer required for rollback.

At minimum, pruning should preserve:

  • the active runtime;
  • update.fromVersion and update.targetVersion from the latest launcher state;
  • any runtime involved in a pending update;
  • incomplete/staging directories, symlinks, or unexpected entries unless handled separately and safely.

Old completed versions that are no longer referenced should not accumulate indefinitely.

Actual behavior

Every successfully installed runtime remains under ~/.t3/runtime/versions indefinitely. Each runtime occupies roughly 610–750 MiB on this host.

Observed state:

  • 13 completed runtime directories;
  • 8.8 GiB under ~/.t3/runtime;
  • 11 obsolete completed runtimes account for approximately 7.57 GiB of allocated blocks;
  • active runtime: 0.0.35-nightly.20260826.1195;
  • latest rollback/source runtime: 0.0.34-nightly.20260825.1187;
  • latest update status: committed.

The current pinnedRuntime.ts implementation removes an incomplete destination before reinstalling and cleans its unique staging directory in an Effect.ensuring, but it does not prune older successfully completed version directories. The installed bundle also has no t3 service prune command.

This appears to be the problem addressed by open PR #7811, feat(server): add safe service runtime pruning, but that functionality has not shipped in the observed build and the PR is currently unmerged.

Impact

Major degradation or frequent failure

Disk use grows by approximately 600–750 MiB per remote update. Nightly users who update frequently can accumulate many gigabytes in a few days, eventually creating disk-pressure or out-of-space failures on a server.

Version or commit

Observed on 0.0.35-nightly.20260826.1195; also verified against main at 33b650a5b3b27382b35d2182dec6b22438c3da56.

Environment

Ubuntu 24.04, Linux x86_64, systemd user service, Node.js v24.19.0.

Logs or stack traces

$ du -sh ~/.t3/runtime
8.8G    ~/.t3/runtime

$ find ~/.t3/runtime/versions -mindepth 1 -maxdepth 1 -type d | wc -l
13

$ jq '{protocol, activeVersion, update}' ~/.t3/runtime/service-state.json
{
  "protocol": 2,
  "activeVersion": "0.0.35-nightly.20260826.1195",
  "update": {
    "fromVersion": "0.0.34-nightly.20260825.1187",
    "targetVersion": "0.0.35-nightly.20260826.1195",
    "status": "committed"
  }
}

Workaround

Manually removing only completed, unreferenced old runtime directories can recover the space, but this is not currently exposed as a supported command and is risky without reproducing the launcher's state-based safety checks. PR #7811 proposes t3 service prune --dry-run and t3 service prune for this purpose.

Note: 5.6 Sol in behalf of Jonatas Walker

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the current pinnedRuntime.ts implementation and the launcher state in service-state.json, then compare them with the proposed changes in PR #7811. Verify that pruning considers active, rollback, pending-update, incomplete, staging, symlink, and unexpected entries safely; done means obsolete completed runtimes can be pruned without removing required state.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
cli, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.