Skip to content

fix: handle generic ort::Error type in ort 2.0.0-rc.12 - #51

Open
yanxue06 wants to merge 2 commits into
mainfrom
fix/ort-rc12-error-type
Open

fix: handle generic ort::Error type in ort 2.0.0-rc.12#51
yanxue06 wants to merge 2 commits into
mainfrom
fix/ort-rc12-error-type

Conversation

@yanxue06

Copy link
Copy Markdown
Owner

Summary

  • Fixes CI failure caused by ort v2.0.0-rc.12 changing Error from a plain struct to Error<R = ()>
  • Session builder methods now return Error<SessionBuilder> which doesn't auto-convert via #[from] ort::Error
  • Maps through ort::Error::from to convert Error<SessionBuilder>Error<()> before the ? operator

Test plan

  • cargo check passes
  • All 23 tests pass (cargo test)
  • CI should pass on this branch

🤖 Generated with Claude Code

renovate Bot and others added 2 commits April 14, 2026 19:50
The ort crate changed Error from a plain struct to Error<R = ()> in
rc.12. Session builder methods now return Error<SessionBuilder> which
doesn't auto-convert via #[from]. Map through ort::Error::from to
convert to Error<()> before the ? operator.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 14, 2026 21:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Updates the embedding model initialization code to compile against ort v2.0.0-rc.12, which changed ort::Error to be generic (Error<R = ()>), and refreshes the lockfile accordingly.

Changes:

  • Convert SessionBuilder-typed ort::Error<R> values into ort::Error<()> via ort::Error::from so existing #[from] ort::Error conversions continue to work with ?.
  • Update Cargo.lock to resolve ort / ort-sys to 2.0.0-rc.12 and reflect transitive dependency changes.

Reviewed changes

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

File Description
src/embedding/model.rs Adds explicit error mapping steps in the ONNX session builder chain to accommodate ort::Error<R> in rc.12.
Cargo.lock Updates resolved crate versions/transitives for the ort rc.12 upgrade.

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

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.

2 participants