Skip to content

Comments

[APO-2934] Make _parse_ml_models resilient to validation errors#3702

Merged
dvargas92495 merged 2 commits intomainfrom
devin/APO-2934-1770141527
Feb 3, 2026
Merged

[APO-2934] Make _parse_ml_models resilient to validation errors#3702
dvargas92495 merged 2 commits intomainfrom
devin/APO-2934-1770141527

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Feb 3, 2026

Makes _parse_ml_models in BaseWorkflowDisplay resilient to validation errors by catching exceptions for individual models, skipping invalid ones, and logging warnings instead of failing the entire serialization process.


Co-Authored-By: vargas@vellum.ai <vargas@vellum.ai>
@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Co-Authored-By: vargas@vellum.ai <vargas@vellum.ai>
@dvargas92495 dvargas92495 marked this pull request as ready for review February 3, 2026 18:20
@dvargas92495 dvargas92495 merged commit 8b55772 into main Feb 3, 2026
9 checks passed
@dvargas92495 dvargas92495 deleted the devin/APO-2934-1770141527 branch February 3, 2026 18:20
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3a80df6a4e

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +221 to +225
try:
parsed_models.append(MLModel.model_validate(item))
except Exception as e:
model_name = item.get("name") if isinstance(item, dict) else None
logger.warning(f"Skipping ML model '{model_name}' due to validation error: {type(e).__name__}")

Choose a reason for hiding this comment

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

P2 Badge Limit exception handling to validation errors

Catching Exception here will silently skip models on any unexpected error raised inside MLModel.model_validate, including programming errors or runtime issues unrelated to input validation. That can mask real regressions (e.g., a bug in validation logic) by downgrading them to warnings and dropping models, which makes failures harder to detect. Since the intent is only to ignore validation failures, consider catching the specific Pydantic validation exception(s) instead.

Useful? React with 👍 / 👎.

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