Skip to content

fix(preview): scope preview totals to the tracked changeset - #1241

Merged
lizhengfeng101 merged 1 commit into
alibaba:mainfrom
anmolxlight:fix-1235-untracked-provider-preview
Sep 15, 2026
Merged

lizhengfeng101 merged 1 commit into
alibaba:mainfrom
anmolxlight:fix-1235-untracked-provider-preview

Conversation

@anmolxlight

Copy link
Copy Markdown
Contributor

Fixes #1235.

What

Narrows the preview totals promise to tracked changes (option 3 from the issue). Untracked provider-directory files are dropped in untrackedFilesList before any diff exists, so they are neither listed nor counted. Counting them (options 1/2) would mean reading every file under an untracked node_modules//target/ on every review, not just --preview, since that list feeds the normal workspace path too. The gap needs a provider dir that is neither tracked nor gitignored, which is narrower than the read cost.

Changes

  • internal/agent/preview.go: Preview doc + inline comment now say totals match the tracked Git changeset, with the reason recorded.
  • cmd/opencodereview/output_helpers_test.go: vendor/lib.go pairs with ExcludeProviderDirectory (that combination is the only one possible after fix(preview): show provider-excluded diffs #1223).
  • internal/agent/preview_run_test.go: new TestPreviewOmitsUntrackedProviderDirFile (untracked main.go + untracked target/demo.go; asserts no target/ entry, totals exactly 1 file / +1).

FAQ wording left alone: provider_directory "never reviewable, even when included" stays accurate, nothing about reviewability moved.

Gates

  • make test pass, make check pass, make coverage 91.5% (threshold 90%).

AI/LLM disclosure

Per AGENTS.md: this change was implemented with Claude Code (Claude Opus 5) from the issue spec, then reviewed, verified (all gates re-run locally), and submitted by me. I understand every line and can explain it on review.

@CLAassistant

CLAassistant commented Sep 14, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@github-actions

Copy link
Copy Markdown
Contributor

✅ OpenCodeReview: Review complete: 0 finding(s) across 1 selected item(s).

@lizhengfeng101

Copy link
Copy Markdown
Contributor

@anmolxlight anmolxlight seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.

@lizhengfeng101 lizhengfeng101 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lizhengfeng101
lizhengfeng101 merged commit 01ae248 into alibaba:main Sep 15, 2026
12 checks passed
@anmolxlight
anmolxlight deleted the fix-1235-untracked-provider-preview branch September 15, 2026 09:52
Githab-capibara added a commit to Githab-capibara/open-code-review that referenced this pull request Sep 17, 2026
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.

fix(preview): untracked provider-directory files are missing from workspace preview totals

3 participants