Skip to content

run: disable per-step worktree snapshots and session diff summaries #146

Closed

Description

@byapparov

Context

Each step of a headless run snapshots the whole worktree with git. Nothing in run reads the result.

  • session/processor.ts:235,258,267,394 calls Snapshot.track() at start-step and finish-step, plus Snapshot.patch(). Each of these runs git add . over the whole worktree into the shadow repo at $DATA/snapshot/<projectId> (snapshot/index.ts). The first run hashes the entire repo.
  • SessionSummary.summarize (session/prompt.ts:642, session/summary.ts) runs diffFull and writes session_diff to storage.
  • cli/cmd/run.ts never subscribes to snapshot, patch or diff data.

Problem

That is several full-tree git add passes per step, which costs time on every step in large repos. It also writes shadow-repo data that is thrown away when the container exits.

Proposal

  • In run, force snapshot: false. The guard already exists at snapshot/index.ts:53. Allow re-enabling it explicitly, e.g. AICTRL_ENABLE_SNAPSHOT=1 or config snapshot: true.
  • Skip SessionSummary.summarize when snapshots are off.

Acceptance

  • A headless run creates no $DATA/snapshot/* directory and runs no git add. Check with a test or by counting spawned processes.
  • Patch parts and session_diff are still produced when snapshots are enabled explicitly.
  • Before/after step timing on a large repo is recorded in the PR.

Activity

  1. added 2 commits that reference this issue on Oct 17, 2026
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

    P1Should have - HighenhancementNew feature or requestperformancePerformance optimization

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions