Skip to content

[Bug] Session turn diff shows nothing for non-git projects and filters out git-ignored files #339

@Astro-Han

Description

@Astro-Han

What happened?

The session review panel in "Last Turn" mode does not show per-turn file changes in two scenarios:

  1. Non-git projects: The turn diff is always empty, even when the assistant modified files during the turn. Users have no way to see what changed.
  2. Git-ignored files: When the assistant modifies a file listed in .gitignore or .git/info/exclude (e.g. node_modules/, .env, build output), the turn diff silently omits those files.

The root cause is that the snapshot tracking system uses git internally (Snapshot.Service in packages/opencode/src/snapshot/index.ts) and has two hard gates:

  • enabled() returns false when project.vcs !== "git" (line 185), so no snapshot is ever taken for non-git projects.
  • ignore() calls git check-ignore against the project's .git directory (line 128-146), then filters matched files out of both the snapshot index and the diff output (lines 242-251, 698-701).

Steps to reproduce

Non-git projects:

  1. Open PawWork in a directory that is not a git repository
  2. Ask the assistant to create or modify files
  3. Observe the session review panel shows "No changes" after the turn completes

Git-ignored files:

  1. Open PawWork in a git repository
  2. Ensure .env or a node_modules/ file is listed in .gitignore
  3. Ask the assistant to modify that ignored file
  4. Observe the turn diff does not list the ignored file

What did you expect to happen?

  • Non-git projects: The turn diff should still show which files the assistant created or modified, using a git-independent tracking mechanism (e.g. file content hashes).
  • Git-ignored files: At minimum, ignored files that were actively modified by the assistant during the turn should appear in the diff, possibly with a visual indicator that they are ignored. Alternatively, a user-facing setting could control whether ignored files are included.

PawWork version

dev branch (pre-release)

OS version

macOS (any version)

Can you reproduce it again?

Yes, every time

Screenshots, recordings, or extra context

Affected code paths:

File Line(s) Role
packages/opencode/src/snapshot/index.ts 184-186 enabled() gates on vcs === "git"
packages/opencode/src/snapshot/index.ts 126-147 ignore() filters via git check-ignore
packages/opencode/src/snapshot/index.ts 242-251 Ignored files dropped from snapshot index
packages/opencode/src/snapshot/index.ts 698-701 Ignored files filtered from diff output
packages/app/src/pages/session/review-change-mode.ts 8-11 Non-git projects limited to "turn" mode only
packages/app/src/pages/session.tsx 737 turnDiffs reads from snapshot-produced summary.diffs

Suggested approach:

For non-git projects, a lightweight git-independent diff mechanism could compare file content hashes (e.g. SHA-256) before and after each turn. The snapshot system's existing track() / diffFull() interface could be extended with a hash-based fallback when vcs !== "git".

For git-ignored files, the simplest fix is to stop filtering ignored files from the diff output (remove the ignore() call at line 698-701) while keeping the filter on the snapshot index (line 242-251) so ignored files are not permanently tracked. This way, changes to ignored files appear in the turn diff but don't accumulate in the snapshot history.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium priorityappApplication behavior and product flowsbugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions