Skip to content

Fix for Explicit returns mixed with implicit (fall through) returns#377

Closed
Priyanka-Microsoft wants to merge 1 commit intomainfrom
finding-autofix-564e73cd
Closed

Fix for Explicit returns mixed with implicit (fall through) returns#377
Priyanka-Microsoft wants to merge 1 commit intomainfrom
finding-autofix-564e73cd

Conversation

@Priyanka-Microsoft
Copy link
Copy Markdown
Collaborator

The best fix is to add an explicit return None statement at the end of the select_agent method. This will ensure the method always returns a value explicitly, even if no branch in the match is taken (e.g. if history[-1].name is an unexpected value). This change will clarify developer intention and satisfy CodeQL. Only src/backend/sql_agents/helpers/comms_manager.py around the select_agent method needs modification; specifically, add an explicit return None after the match statement.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
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.

1 participant