Skip to content

fix(session): derive agent-file filter from tool filediff only (#742) - #285

Merged
jeonghun-jj-lee merged 1 commit into
local/amicodefrom
fix/742-contamination-filter
Sep 3, 2026
Merged

fix(session): derive agent-file filter from tool filediff only (#742)#285
jeonghun-jj-lee merged 1 commit into
local/amicodefrom
fix/742-contamination-filter

Conversation

@jeonghun-jj-lee

Copy link
Copy Markdown
Contributor

Remove patch-part file lists from agentFilesAbsolute in session.diff(). The filter is now derived exclusively from tool filediff metadata. Patch parts retain their snapshot hashes but their files arrays no longer feed the filter.

Also: when the primary diff path (snapshot-based) runs, return its result even if empty, instead of falling through to the filediff-accumulation fallback.

Part of harmoniqs/amicode#741 · Closes harmoniqs/amicode#742

@coderabbitai

coderabbitai Bot commented Sep 3, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: 6a2f1606-f6d2-400f-b511-28ec1f56b140


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Remove patch-part file lists from the agentFilesAbsolute set in session.diff().
Patch parts captured all worktree changes between step-start and step-finish
snapshots (including modifications by other sessions or external processes),
causing the Files Changed tab to show files the current session never edited.

The filter is now derived exclusively from completed tool parts with filediff
metadata — the same metadata that edit/write/patch/apply_patch tools already
emit. Patch parts retain their snapshot hashes (used for the from/to diff range)
but their files arrays no longer feed the filter.

Also fix: when the primary diff path (snapshot-based) runs and finds zero net
changes, it now returns [] directly instead of falling through to the filediff-
accumulation fallback, which would surface stale metadata for reverted files.

Closes harmoniqs/amicode#742
@jeonghun-jj-lee
jeonghun-jj-lee force-pushed the fix/742-contamination-filter branch from aabb9c5 to 0bc684c Compare September 3, 2026 16:23
@jeonghun-jj-lee
jeonghun-jj-lee merged commit 5728853 into local/amicode Sep 3, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Slice 1: Contamination fix — derive agent-file filter from tool filediff only

1 participant