Skip to content

[Bug]: Storage cleanup throws on Git status output >64 KiB instead of returning the intended safe KEEP #26584

Closed

Description

@kkolodziej7

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

Observed read-only on an existing managed worktree with many untracked files, T3 Code 0.1.3 on macOS:

  1. The cleanup local-change predicate uses git status --porcelain=v1 -z --ignore-submodules=none --untracked-files=all, with maxOutputBytes: 65536 and without opting into bounded/truncated output.
  2. Capture that Git command without modifying the checkout. On the observed checkout it exits 0, with stdout 1,796,287 bytes, stderr 0, and 18,421 NUL records, all untracked.
  3. In the retained native cleanup trace, the shared Git collector throws as soon as the accumulated chunk count exceeds the limit (recorded counter 131072), before cleanup can inspect stdoutTruncated.

No cleanup command or deletion was invoked to obtain the current Git reproduction.

Expected behavior

The cleanup-scoped bounded inspection should conservatively KEEP the worktree with the intended "local changes exceed the inspection limit" reason. This is not a request to ignore local changes or globally change the shared Git executor's defaults.

Actual behavior

The executor's default appendTruncationMarker: false throws first. The cleanup stdoutTruncated guard is unreachable on this path, so the candidate is recorded FAILED and retained. The ignored-files inspection has the same option/guard mismatch, although no overflowing ignored listing was observed here.

Impact

Minor bug or occasional failure: persistent failed cleanup result for affected checkouts, obscuring the intended safety refusal. No unsafe deletion was observed.

Version or commit

Installed/running 0.1.3. Relevant installed functions match pinned v0.1.3 source at d2c4403.

Environment

macOS desktop app; Any local files protection enabled.

Logs or stack traces

git: Git output exceeded 65536 bytes and was truncated.
Only byte/record counts were emitted during investigation; no filenames, conversations, private branches or credentials are attached.

Workaround

No workaround that weakens local-file protection is recommended. Preserve local work.

References

This is separate from shared-owner KEEP behavior in #17816; fixing this error does not itself make protected worktrees eligible.

Activity

  1. BlaiseBaptist commented on Nov 7, 2026

    @BlaiseBaptist

    Still happens on 0.1.7 (Beta, macOS). In one sweep, 14 worktrees failed with GitCommandError: Git output exceeded 65536 bytes and was truncated in StorageCleanup.localChanges. The output lengths were 92–131 KB, mostly from untracked venv/ folders under evidence directories. They show up as failed in the report and in logWarning, when the intended result is kept: local changes exceed the inspection limit.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions