Skip to content

fix: codeQL fix for raising the error#861

Merged
Roopan-Microsoft merged 2 commits intodev-v4from
psl-latestversinov2
Mar 17, 2026
Merged

fix: codeQL fix for raising the error#861
Roopan-Microsoft merged 2 commits intodev-v4from
psl-latestversinov2

Conversation

@Dhruvkumar-Microsoft
Copy link
Collaborator

Purpose

This pull request adds improved error handling to the human_approval_manager.py orchestration logic. Now, if all retry attempts fail when completing a task, the code will raise a clear exception instead of silently failing.

Error handling improvements:

  • Added a RuntimeError that is raised after all retry attempts are exhausted in the _complete method, providing a clear error message when the agent fails to complete due to repeated errors.

Does this introduce a breaking change?

  • Yes
  • No

How to Test

  • Get the code
git clone [repo-address]
cd [repo-name]
git checkout [branch-name]
npm install
  • Test the code

What to Check

Verify that the following are valid

  • ...

Other Information

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Improves error handling in the v4 orchestration HumanApprovalManager completion flow by attempting to surface a clearer failure when the agent cannot complete after retrying.

Changes:

  • Adds a final RuntimeError intended to trigger after _complete() exhausts all retry attempts.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +135 to +138
# If we get here, all retry attempts have been exhausted without a successful response.
raise RuntimeError(
f"Agent failed to complete after {max_retries} attempts due to repeated errors."
)
Comment on lines +137 to +138
f"Agent failed to complete after {max_retries} attempts due to repeated errors."
)
Comment on lines +135 to +138
# If we get here, all retry attempts have been exhausted without a successful response.
raise RuntimeError(
f"Agent failed to complete after {max_retries} attempts due to repeated errors."
)
@Roopan-Microsoft Roopan-Microsoft merged commit 649ac4f into dev-v4 Mar 17, 2026
4 of 5 checks passed
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.

3 participants