fix(multi-review): address review issues from PR #196#208
Conversation
- Fix globToRegex: ** at start now matches top-level paths (gitignore semantics) **/vendor matches 'vendor' at any depth including root vendor/** matches any file under vendor/ - Rename originalBytes → filteredBytes for semantic accuracy Log message now says 'after filtering' instead of 'original' - Always keep at least first section when truncating to avoid empty diff - Update action.yml description to document gitignore convention for patterns - Add trailing newline to diff-filter.ts - Remove bun.lock that was accidentally committed - Add tests for **/ top-level matching and empty-first-section edge case
分析总结根据 PR 标题和 body("address review issues from PR #196"),需求即为 PR body 中列出的 6 项修复 + 2 个测试。逐一验证如下:
所有需求均完整实现,无遗漏。 无遗漏 |
有条件合并 / CONDITIONAL MERGE总结: PR 的 glob 语义改进和截断保底逻辑整体方向正确,但存在 2 个阻塞问题需修复。 阻塞项:
建议项:
📋 各 Reviewer 详细审查结果quality有条件合并 / CONDITIONAL MERGE 此 PR 改进了 阻塞项:
建议项:
security存在风险 / AT RISK 本次 PR 主要改进了 glob pattern 匹配逻辑以支持 gitignore 语义,并修正了 diff 截断逻辑确保至少保留首个文件段,同时删除了 阻塞项:
建议项:
performance性能良好 / GOOD 该 PR 不涉及性能问题。主要变更包括:
无数据库查询、无并发问题、无内存泄漏、无冗余计算。 阻塞项:无 建议项:无 architecture架构合理 / SOUND 此次 PR 对 变更摘要
架构分析
阻塞项:无 建议项:
|
Svitter
left a comment
There was a problem hiding this comment.
P0 — lgtm. Tightly scoped follow-up that fixes three real bugs from #196 without collateral changes.
globToRegexrewrite:**/vendornow correctly matches top-levelvendorvia(.+/)?— the old.*/vendorrequired at least one leading segment. Trailing/**and middle**cases preserved. The bare**fallback (no surrounding slashes) returns.*which is correct for that degenerate case.filteredBytesrename: complete — zero references tooriginalBytesremain. The truncation notice text changed from "KB original" to "KB after filtering", matching the semantics.- Truncation loop:
truncatedKept.length > 0guard ensures at least the first section survives even when it alone exceeds budget. Prevents sending empty diff to LLM. bun.lockremoval: restores pre-#196 state;package-lock.jsonis the canonical lockfile.- Description update in
action.ymldocuments the gitignore path/basename convention.
All 24 diff-filter tests pass. The single reviewers.test.ts failure is pre-existing — js-yaml not installed in node_modules (unrelated to this PR).
Thanks for the clean fixes.
3e60d5a
into
farm/d9cd57e8/multi-review-fails-when-pr-diff-contains
…ncation (#196) * fix(multi-review): add configurable diff exclusion and size-based truncation The existing lock-file filter strips known lock files from the PR diff, but large diffs can still exceed the LLM context window when they contain other auto-generated or vendored content. Add two new action inputs: - diff-exclude: comma-separated glob patterns for additional files to exclude (gitignore convention: patterns without '/' match basenames) - diff-max-size-kb: maximum diff size in KB after filtering; if exceeded, only leading file sections are kept with a truncation notice The filterDiff function now accepts FilterDiffOptions with excludePatterns and maxSizeBytes. Truncation keeps whole file sections from the start and appends a notice showing how many of the total sections were included. Fixes #194 * chore: add bun.lock for multi-review * fix(multi-review): address review issues from PR #196 (#208) - Fix globToRegex: ** at start now matches top-level paths (gitignore semantics) **/vendor matches 'vendor' at any depth including root vendor/** matches any file under vendor/ - Rename originalBytes → filteredBytes for semantic accuracy Log message now says 'after filtering' instead of 'original' - Always keep at least first section when truncating to avoid empty diff - Update action.yml description to document gitignore convention for patterns - Add trailing newline to diff-filter.ts - Remove bun.lock that was accidentally committed - Add tests for **/ top-level matching and empty-first-section edge case * chore(multi-review): rebuild dist after diff-filter changes --------- Co-authored-by: Svitter <Svitter@users.noreply.github.com> Co-authored-by: 修昊 <svtter@qq.com>

Summary
Fixes all blocking issues and suggestions identified in the AI review of #196.
Blocking Issues Fixed
globToRegex**/prefix bug —**/vendornow correctly matches top-levelvendordirectory, not just nested paths. RewroteglobToRegexwith context-aware globstar replacement:**/→(.+/)?(zero or more leading path segments)/**→(/.+)?(zero or more trailing path segments)/**/→ handled correctlyoriginalBytessemantic mismatch — Renamed tofilteredBytes. Log message changed from"KB original"to"KB after filtering"so users understand the value is post-filtering, not raw input.Empty diff when first section exceeds budget — Changed truncation loop to always keep at least the first section:
if (truncatedKept.length > 0 && size > budget) break. Prevents sending empty content to LLM.Suggestions Implemented
action.yml description updated — Now documents gitignore convention: "Patterns without `/` match against the file basename; patterns with `/` match against the full file path."
Trailing newline added to
diff-filter.tsbun.lockremoved — Accidentally committed in the original PR.Tests
"**/pattern matches top-level file (gitignore semantics)"— verifies**/vendormatches bothvendorandsubdir/vendor"keeps at least the first section when it exceeds maxSizeBytes"— verifies no empty diff edge caseFixes review issues from #196