Skip to content

Fix GitHub search_issues error handling#941

Draft
codegen-sh[bot] wants to merge 2 commits intodevelopfrom
codegen-fix-github-search-issues-error-handling
Draft

Fix GitHub search_issues error handling#941
codegen-sh[bot] wants to merge 2 commits intodevelopfrom
codegen-fix-github-search-issues-error-handling

Conversation

@codegen-sh
Copy link
Contributor

@codegen-sh codegen-sh bot commented Mar 22, 2025

Description

This PR fixes the error handling in the github_search_issues function. Previously, when a search query returned no results, the function would try to access elements in an empty list, resulting in a "list index out of range" error.

Changes

  • Added proper handling for the case when no search results are found
  • Explicitly checks search_results.totalCount before attempting to iterate through results
  • Returns a successful response with an empty results list when no matches are found

Testing

The fix ensures that when a search query returns no results, the function will return a proper success response with an empty results list instead of throwing an error.

Fixes Linear issue CG-13551.

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.

0 participants