Several bot commands (cmd_issues, cmd_suggest, cmd_prs) call github.list_issues(repo, include_prs=True) which fetches up to 30 items from the GitHub API, then filters client-side. When both /issues and /suggest are called, or when the scheduler runs _check_issues and _send_suggestions back-to-back (both are scheduled to run immediately on startup at scheduler.py:175-176), the same issues are fetched multiple times within seconds.
More critically, cmd_prs at bot.py:120 calls list_issues(repo, include_prs=True) and filters for PRs, but there's already a dedicated list_prs() function in github.py that uses the pulls API endpoint which is more appropriate and returns PR-specific fields like branch name.
Fix: Use github.list_prs() in cmd_prs instead of list_issues. Consider adding a simple time-based cache (e.g., functools.lru_cache with TTL or a manual cache dict) to list_issues to avoid redundant API calls within short windows.
Identified by minbot code review
Several bot commands (
cmd_issues,cmd_suggest,cmd_prs) callgithub.list_issues(repo, include_prs=True)which fetches up to 30 items from the GitHub API, then filters client-side. When both/issuesand/suggestare called, or when the scheduler runs_check_issuesand_send_suggestionsback-to-back (both are scheduled to run immediately on startup at scheduler.py:175-176), the same issues are fetched multiple times within seconds.More critically,
cmd_prsat bot.py:120 callslist_issues(repo, include_prs=True)and filters for PRs, but there's already a dedicatedlist_prs()function in github.py that uses the pulls API endpoint which is more appropriate and returns PR-specific fields like branch name.Fix: Use
github.list_prs()incmd_prsinstead oflist_issues. Consider adding a simple time-based cache (e.g.,functools.lru_cachewith TTL or a manual cache dict) tolist_issuesto avoid redundant API calls within short windows.Identified by minbot code review