fix: return Promise from Model.download() to enable await with progress callback#474
Merged
baijumeswani merged 2 commits intosamuel100/fix-model-download-awaitfrom Feb 28, 2026
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: baijumeswani <12852605+baijumeswani@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix promise return from Model.download to enable correct await handling
fix: return Promise from Model.download() to enable await with progress callback
Feb 28, 2026
baijumeswani
approved these changes
Feb 28, 2026
1b336c3
into
samuel100/fix-model-download-await
3 checks passed
baijumeswani
added a commit
that referenced
this pull request
Feb 28, 2026
#467) * fix: return promise from Model.download() to enable await with progress callback Model.download() was discarding the Promise returned by ModelVariant.download(), causing await to resolve immediately. This meant load() could run before the download completed, resulting in 'Model path does not exist' errors. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix: return Promise from Model.download() to enable await with progress callback (#474) * Initial plan * Merge main into branch: resolve conflicts keeping Promise<void> fix Co-authored-by: baijumeswani <12852605+baijumeswani@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: baijumeswani <12852605+baijumeswani@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: baijumeswani <12852605+baijumeswani@users.noreply.github.com>
prathikr
pushed a commit
that referenced
this pull request
Feb 28, 2026
#467) * fix: return promise from Model.download() to enable await with progress callback Model.download() was discarding the Promise returned by ModelVariant.download(), causing await to resolve immediately. This meant load() could run before the download completed, resulting in 'Model path does not exist' errors. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix: return Promise from Model.download() to enable await with progress callback (#474) * Initial plan * Merge main into branch: resolve conflicts keeping Promise<void> fix Co-authored-by: baijumeswani <12852605+baijumeswani@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: baijumeswani <12852605+baijumeswani@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: baijumeswani <12852605+baijumeswani@users.noreply.github.com>
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.
Model.download()was discarding thePromisereturned byModelVariant.download(), causingawaitto resolve immediately. This allowedload()to execute before the download completed, resulting in'Model path does not exist'errors.Changes
sdk_v2/js/src/model.ts: Changeddownload()toreturnthe promise fromselectedVariant.download()instead of discarding itsdk_v2/js/src/imodel.ts: UpdatedIModel.download()interface signature fromvoidtoPromise<void>Usage
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.