Make manager reinitialization safe - #990
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
Makes native manager recreation safe while improving Python package-version resolution.
Changes:
- Defers GenAI global shutdown until process exit.
- Updates manager lifetime documentation.
- Resolves Python versions from source or distribution metadata with tests.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
sdk_v2/cpp/src/manager.cc |
Moves GenAI shutdown to an exit hook. |
sdk_v2/cpp/src/manager.h |
Documents process-scoped GenAI lifetime. |
sdk_v2/python/src/foundry_local_sdk/version.py |
Adds package-version resolution logic. |
sdk_v2/python/test/unit/test_version.py |
Tests version precedence and fallbacks. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: c57f1ea3-b538-4db9-9223-8ca4f174f277
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: c57f1ea3-b538-4db9-9223-8ca4f174f277
|
ogashutdown and re-creating the ogamodel should work? Is that not the case? |
af900dd to
a3e980b
Compare
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: c90dfab7-1285-4d6c-a735-451395a09887
|
Yes - our pinned ORT GenAI 0.15.2 supports calling |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
Suppressed comments (1)
sdk_v2/python/src/foundry_local_sdk/version.py:42
- This source-first lookup can return an unrelated application's version. For example, a wheel installed with
pip --target <project>/srchas distribution metadata available, but this path resolves to<project>/pyproject.toml, so the host project's[project].versionwins. Only accept the source-tree file when its project name identifies this distribution; otherwise fall back to_dist_version().
source_version = _version_from_source_tree()
if source_version is not None:
return source_version
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: c90dfab7-1285-4d6c-a735-451395a09887
Summary
OgaShutdown()until process exitinitialize() -> close() -> initialize()safeThis also includes the branch's previously completed Python package-version resolution changes.
Validation
CApiTest.ManagerCanBeRecreatedAfterRelease