Skip to content

OpenAI exception handling for biological risk - #478

Merged
amascolo merged 1 commit into
mainfrom
fix/openai-biological-risk
Aug 4, 2026
Merged

OpenAI exception handling for biological risk#478
amascolo merged 1 commit into
mainfrom
fix/openai-biological-risk

Conversation

@amascolo

@amascolo amascolo commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

@amascolo
amascolo requested a review from Eddie-MG August 4, 2026 21:52
@amascolo amascolo self-assigned this Aug 4, 2026
Copilot AI lite review requested due to automatic review settings August 4, 2026 21:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds fallback handling for a newly observed OpenAI BadRequestError message related to “possible biological risk”, ensuring the retry/fallback logic treats it as a fall-over case and adding a regression test for it.

Changes:

  • Extend should_fallback’s message-pattern matching to include OpenAI’s “possible biological risk” 400 message.
  • Add a unit test verifying that this message triggers fallback behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
packages/lmi/src/lmi/retry.py Adds the new message pattern used by should_fallback to decide when to fall over on BadRequestError.
packages/lmi/tests/test_retry.py Adds a regression test to ensure the biological-risk BadRequestError falls back.

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

Comment thread packages/lmi/src/lmi/retry.py Outdated
@amascolo
amascolo force-pushed the fix/openai-biological-risk branch from d63a914 to 2e43c6b Compare August 4, 2026 21:59
@amascolo
amascolo merged commit 2586718 into main Aug 4, 2026
15 checks passed
@amascolo
amascolo deleted the fix/openai-biological-risk branch August 4, 2026 22:14
@amascolo

amascolo commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator Author

Actions are failing due to broken/flaky CI, unrelated to this PR:

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