Skip to content

[Bug]: MacOs T3 fills up disk #10953

Description

@robert2411

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

Enable create new worktree per chat, create a lot of chats -> full disk.

Image Image

Expected behavior

The work trees are cleaned up at some point.

Actual behavior

They are not :)

Impact

Minor bug or occasional failure

Version or commit

No response

Environment

MacOs

Logs or stack traces

Screenshots, recordings, or supporting files

No response

Workaround

No response

Activity

  1. added
    bugSomething is broken or behaving incorrectly.
    needs-triageIssue needs maintainer review and initial categorization.
    on Sep 9, 2026
  2. juliusmarminge commented on Sep 9, 2026

    @juliusmarminge
    Member

    Triage

    This matches current shipped behavior, not a regression and not a wash of #9085.

    New worktree (defaultThreadEnvMode = "worktree") creates a full git checkout under the environment’s worktrees/ directory for each chat ({T3 home}/worktrees/<repo>/<branch>). A project setup script can also run there, so each thread can carry its own node_modules / build artifacts. macOS is incidental — the same lifecycle exists on every platform.

    On main those directories are not reaped by settle, archive, inactivity, or PR merge. The only removal path is the desktop “Delete the worktree too?” prompt after thread delete (useThreadActions + worktreeCleanup). That prompt is gated on localApi, so web and mobile never clean up. Server thread.delete does not touch disk. git worktree prune only drops stale Git admin entries after a directory is already gone.

    Why this is not #9085

    #9085 / PR #9116 are a delete-path bug: deleting an archived thread skips that prompt and orphans the worktree. Landing #9116 still leaves this report open — creating many New-worktree chats without deleting them (or settling/archiving them) will keep filling the disk. The autoclean comment on #9085 is the same product ask as this issue.

    Related work (already accepted, not shipped)

    Workaround

    Delete the thread on desktop and confirm worktree removal, or remove the trees yourself (git worktree remove / delete under ~/.t3/worktrees). To avoid growth, use Current checkout or New thread in this worktree instead of New worktree per chat.

    Keeping this open as the live disk-growth report for the missing worktree lifecycle. No new product call — #5589 is the plan.

  3. added
    enhancementRequested improvement or new capability.
    acceptedfeature request accepted
    via-triageFiled through npx t3 triage
    and removed
    bugSomething is broken or behaving incorrectly.
    needs-triageIssue needs maintainer review and initial categorization.
    on Sep 9, 2026
  4. wouteth commented on Sep 11, 2026

    @wouteth

    Correction to my previous cross-reference:

    The earlier 997 ms t3code-3c0f8faf failure was not a valid clean reproduction. Our external janitor had already moved and deregistered that worktree about 2 hours 39 minutes earlier, so T3 was acting on stale thread/worktree state.

    A subsequent untouched T3 Code 0.0.40 removal of t3code-f1f40334 did fail independently: Git exited 255 after 11.13 seconds, the .git pointer and Git registration were removed, but most of the checkout remained on disk, including 2,793 pnpm package directories. That is a genuine partially removed orphan and was not caused by the five-minute timeout.

    The trace records only stderr length 96, so the initiating filesystem/Git cause remains unknown. The supported conclusion is that non-timeout partial removals can still strand directories and need retry/reconciliation. I posted the complete corrected evidence on #5614.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedfeature request acceptedenhancementRequested improvement or new capability.plannedvia-triageFiled through npx t3 triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions