Skip to content

Commit 649ac4f

Browse files
Merge pull request #861 from microsoft/psl-latestversinov2
fix: codeQL fix for raising the error
2 parents ecc97fb + 8e8cc8b commit 649ac4f

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/backend/v4/orchestration/human_approval_manager.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,10 @@ async def _complete(self, messages: list[Message]) -> Message:
132132
await asyncio.sleep(delay)
133133
continue
134134
raise
135+
# If we get here, all retry attempts have been exhausted without a successful response.
136+
raise RuntimeError(
137+
f"Agent failed to complete after {max_retries} attempts due to repeated errors."
138+
)
135139

136140
async def plan(self, magentic_context: MagenticContext) -> Any:
137141
"""

0 commit comments

Comments
 (0)