Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/codegen/extensions/tools/github/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,18 @@

# Search using PyGitHub's search_issues (which searches both issues and PRs)
results = []
for item in repo.search_issues(query)[:max_results]:
search_results = repo.search_issues(query)

# Handle the case when no results are found
if search_results.totalCount == 0:

Check failure on line 55 in src/codegen/extensions/tools/github/search.py

View workflow job for this annotation

GitHub Actions / mypy

error: "list[Issue]" has no attribute "totalCount" [attr-defined]
return SearchResultObservation(
status="success",
query=query,
results=[],
)

# Process the results
for item in search_results[:max_results]:
result = {
"title": item.title,
"number": item.number,
Expand Down
Loading