You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
pr-review: model confusion about line numbers and old/new parts of diffs #151
Data collection is disabled.
Okay, I'm ready to start the code review. I'll begin by gathering the necessary information about the pull request.Got it. Repo is XXXX/XXXX-Android. Now, PR data.PR "Remove RawDayOfWeek usage from ProductivitySettingsFragment and friends" from branch prateek/date-api-cleanup-pt3 has 4 changed files, 40 additions, 35 deletions. Now, getting changed files list.Okay, changed files are changelog/prateek.date-api-cleanup-pt3.txt, XXXX-app-viewmodel/src/main/kotlin/com/XXXX/viewmodel/ProductivitySettingsViewModel.kt, XXXX-app/src/main/java/com/XXXX/fragment/ProductivitySettingsFragment.kt, and XXXX-app/src/main/java/com/XXXX/preference/IgnoreDaysPreference.kt. Ignoring the changelog. Getting PR number now.PR 9628. Checking for instructions.No extra instructions. I'll get the PR diff now.I've reviewed the diff; the PR's goal of replacing RawDayOfWeek with kotlinx.datetime.DayOfWeek is a positive change. The updates in ProductivitySettingsViewModel.kt, ProductivitySettingsFragment.kt, and IgnoreDaysPreference.kt are consistent and correct. I have minor suggestions for improvement and will now create the pending review with my comments.Okay, I'm adding a comment to the pending review for XXXX-app-viewmodel/src/main/kotlin/com/XXXX/viewmodel/ProductivitySettingsViewModel.kt. I'll suggest simplifying the DayOfWeek conversion from the verbose ignoreDays.map { JavaDayOfWeek.of(it.toCalendarDay().calendarWeekday) }.toSet() to the more concise ignoreDays.map { JavaDayOfWeek.of(it.value) }.toSet(), since both kotlinx.datetime.DayOfWeek and java.time.DayOfWeek use the same 1-7 mapping for days of the week.I'll skip commenting on the let block in ProductivitySettingsFragment.kt as it's a style preference.
In IgnoreDaysPreference.kt, I'll suggest simplifying the getViewIdForWeekday method. The current implementation uses a custom toXXXXDayOfWeek() extension function. Since kotlinx.datetime.DayOfWeek is an enum with constants defined in order from Monday to Sunday, I can use the ordinal property for a cleaner day-of-week calculation. The logic (weekday.ordinal - startDay.ordinal + 7) % 7 is equivalent and avoids the custom function. I will add a comment suggesting this refactor.Comments added. Submitting review. The PR's refactoring to kotlinx.datetime.DayOfWeek is a solid improvement. My minor suggestions focus on conciseness and better use of standard library features. Submitting now.(node:2031) MaxListenersExceededWarning: Possible EventTarget memory leak detected. 11 abort listeners added to [AbortSignal]. MaxListeners is 10. Use events.setMaxListeners() to increase limit
(Use node --trace-warnings ... to show where the warning was created)
Review submitted. Done.
I've had really good success with a diff pre-processor approach. It takes a unified diff and creates a JSON based file that contains line numbers and chunks. I was seeing significant error rate before and now it is nailing exact numbers every time. I think this is the right approach. It is a python script. Would it make sense to convert it to JS given that this project seems to prefer it?
I noticed that certain PRs would produce much higher rates of errors although not always. I suspect you can probably find a PR that has a higher chance of showing this problem. Unfortunately I cannot share mine since they are in private repos.
Activity
leehagoodjames commentedon Aug 8, 2025
Hi @dan-ri, thanks for surfacing this - you are correct on the expected behavior.
There have been 4 changes to the PR review YAML in the last 24 hours. Can you please include the YAML (or version tag, ex
v0.1.8) that you are using?Can you please include any examples of this occurring? It would be helpful to for debugging.
Note: If you aren't using the latest (updated ~1h ago) version of review, can you copy the
/reviewworkflow from https://github.com/google-github-actions/run-gemini-cli/blob/main/examples/workflows/pr-review/gemini-pr-review.yml and let me know if it resolves any of the issues you are seeing?leehagoodjames commentedon Aug 8, 2025
Thanks for confirming @dan-ri. Can you please provide some info to help debug in the form of:
https://github.com/<OWNER>/<REPO>/pull/<PR_NUMBER>/filesUI?leehagoodjames commentedon Aug 14, 2025
@dan-ri that is great to hear. Please feel free to suggest that we include these changes into the
mainbranchhackertronix commentedon Aug 19, 2025
@leehagoodjames I am running into the same on v0.1.22
Here's the log from the agent
6 remaining items
michalszelagsonos commentedon Oct 19, 2025
I've had really good success with a diff pre-processor approach. It takes a unified diff and creates a JSON based file that contains line numbers and chunks. I was seeing significant error rate before and now it is nailing exact numbers every time. I think this is the right approach. It is a python script. Would it make sense to convert it to JS given that this project seems to prefer it?
MJjainam commentedon Nov 17, 2025
@dan-ri Is there a way to consistently reproduce this?
michalszelagsonos commentedon Nov 17, 2025
I noticed that certain PRs would produce much higher rates of errors although not always. I suspect you can probably find a PR that has a higher chance of showing this problem. Unfortunately I cannot share mine since they are in private repos.
MJjainam commentedon Dec 9, 2025
@michalszelagsonos Did you update Gemini CLI - this should be fixed in latest versions.
MJjainam commentedon Dec 23, 2025
This is not reproducible with later models. If the issue persists, please re-open.