Harden JS native object lifetimes - #904
Draft
bmehta001 wants to merge 4 commits into
Draft
Conversation
Keep native managers alive while JS models and sessions reference them, reject session creation after disposal, and add disposal coverage for the JS SDK native layer. Files changed: - sdk_v2/js/native/src/catalog.cc/.h - sdk_v2/js/native/src/manager.cc/.h - sdk_v2/js/native/src/model.cc/.h - sdk_v2/js/native/src/session.cc/.h - sdk_v2/js/src/catalog.ts - sdk_v2/js/test/manager-dispose.test.ts Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 297bc539-5f7f-4a70-9411-48e91a5bf532
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
The test only needs to prove disposal is blocked while a native worker lease exists; the unknown-EP operation may legitimately resolve or reject. Always await it and dispose the singleton in a finally block so one assertion cannot poison later tests. Files changed: - sdk_v2/js/test/manager-dispose.test.ts Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 297bc539-5f7f-4a70-9411-48e91a5bf532
A transient catalog response can leave no selectable cached chat model even when the test cache exists. Treat that existing environmental condition as SkipFixture in CI and dynamically skip the new disposal suite instead of failing unrelated lifecycle coverage. Files changed: - sdk_v2/js/test/_fixtures/realModelManager.ts - sdk_v2/js/test/openai-client-dispose.test.ts Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 297bc539-5f7f-4a70-9411-48e91a5bf532
Only the disposal suite should treat unavailable CI catalog data as an environmental skip. Keep every other real-model suite's existing fail-fast behavior instead of globally converting model-selection failures into SkipFixture. Files changed: - sdk_v2/js/test/_fixtures/realModelManager.ts - sdk_v2/js/test/openai-client-dispose.test.ts Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 297bc539-5f7f-4a70-9411-48e91a5bf532
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Validation