[PR #3362] [CLOSED] [GUI] Reuse Legacy Model Libraries Through A Valid Native Data Root #4590

Closed
opened 2026-11-07 15:37:41 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/3362
Author: @medking82
Created: 10/20/2026
Status: ❌ Closed

Base: main ← Head: codex/upstream-legacy-model-data-root


📝 Commits (2)

  • 14c2886 [GUI] Reuse Legacy Model Libraries Through A Valid Native Data Root
  • 1eae837 [GUI] Merge upstream main and preserve legacy model libraries

📊 Changes

2 files changed (+101 additions, -5 deletions)

View changed files

📝 apps/host/server/store.mjs (+14 -3)
📝 apps/host/tests/model-directory-default.test.mjs (+87 -2)

📄 Description

Problem and result

With a retained <Strata Home>/models library and no existing run configuration for the selected model, the Host can pass that model-library folder as the installer's data root. The installer then plans HOME/models/models/<model> instead of reusing HOME/models/<model>.

This fix resolves that exact retained library through HOME/Strata-data/models, a verified directory alias to the original library. Original weights stay in place and conflicting destinations are refused.

Related storage feedback: #3292. This fixes retained legacy libraries; it does not provide general arbitrary-GGUF import or repair every model-recognition case.

Upstream coverage checked

Checked current main 011c9e600a93bbc9fd451c563501b5831c32bbca on 2026-10-22. The PR is partially covered upstream and remains needed.

  • Upstream rememberDataFolder now writes the selected data folder to Control settings before the packaged install request, resolving the earlier folder-name guard for this flow.
  • The library/data-root distinction remains. Safe synthetic detected, saved and environment-selected legacy cases all passed the real upstream guard but planned an extra models directory. Original-library reuse acceptance was 0/3.
  • Upstream already handles the case where an existing run configuration supplies the correct parent data folder. That behavior is preserved.
  • The merged fix passes the same three legacy-reuse cases, 3/3, against current Host and installer planning functions. These are fixture plans, not actual downloads.

Approach

Merged current main into the existing PR branch without rewriting history. Submitted head: 1eae8377e7c7562b9e47cdf9ed2345679c8564e3. Compared with main, only apps/host/server/store.mjs and apps/host/tests/model-directory-default.test.mjs differ.

Map only the exact legacy library, including saved/environment-selected copies of that path. Windows uses a real Junction; POSIX uses a relative directory symlink. Verify destination physical identity before returning the data root, preserve original bytes, and refuse a conflicting directory or junction.

Keep upstream's pickModelsDirectory, MODELS_DIR_NOTICE, alignModels default-directory fallback, Control settings ownership and custom-directory behavior.

Validation

Windows x64, Node v24.18.0, Python 3.12. Tests used disposable synthetic weight bytes and directories. Commands below omit the windowless runner and use process-local TEMP/TMP under the authorized scratch directory.

Passed:

From apps/host:

node --test --test-isolation=none tests/model-directory-default.test.mjs

8 passed, 0 failed. Includes detected/saved/environment legacy selection, a pre-existing Documents default, original weight bytes and file identity, idempotence, custom/fresh folders, conflicting directories/junctions and unchanged Documents fallback.

Affected upstream regressions:

node --test --test-isolation=none --test-name-pattern="a whole drive is not|a folder that cannot|models and Models|the data folder is written|choosing a folder that is gone|the Terminal settings file|a Documents folder that cannot|a usable Documents" tests/model-folder.test.mjs tests/models-directory-fallback.test.mjs

8 passed, 0 failed. Preserves upstream link-failure fallback, settings merge/idempotence and Documents fallback/normal startup.

Additional disposable acceptance harnesses executed the submitted actual createNativeControl/store and actual Python check_data_dir/install_plan functions: 11 Host scenarios and 11 installer/refusal scenarios passed. Transport, catalog, hardware, setup-table loading and free-space values were explicit fixtures; no install was launched.

Legacy selection Guard accepted Plan reaches original weight folder Original bytes unchanged Repeated plan unchanged
Detected yes yes yes yes
Saved yes yes yes yes
Environment yes yes yes yes

The Junction maps HOME/Strata-data/models/IQ3_XXS to the original HOME/models/IQ3_XXS. The plan reports existing partial-download material in that fixture. Conflict-directory and conflict-junction cases refuse the destination and preserve both libraries.

git diff --check 011c9e60 HEAD passed. The final worktree was clean, the remote head was checked before the normal fast-forward push, and no force-push was used.

Failed:

The upstream baseline's legacy-reuse acceptance failed 0/3 because the plan used the nested library. All three pass with this fix. The expected merge conflict in store.mjs was resolved while preserving current upstream behavior. No unresolved failure remains in the listed checks.

Not run:

Full npm suite, the excluded subst drive cases, real model preparation/download/resume or GGUF integrity validation, application UI, GPU inference, macOS/Linux execution, exFAT/UNC or actual link-permission failure. No engine backend source is changed.

Upstream Actions remain separate from these local results; workflows awaiting maintainer approval are not counted as test passes.

Limits

Path identity and fixture bytes establish library reuse, not a complete prepared model or a successful real installation. Existing custom folders retain native setup rules. The alias requires permission to create a directory link under Strata Home. Documents-unavailable fallback and unrelated imported-model behavior retain upstream semantics.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/3362 **Author:** [@medking82](https://github.com/medking82) **Created:** 10/20/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `codex/upstream-legacy-model-data-root` --- ### 📝 Commits (2) - [`14c2886`](https://github.com/Niko1221/Strata/commit/14c28861c9ca5dab7c1ac212c415d29c69f40a04) [GUI] Reuse Legacy Model Libraries Through A Valid Native Data Root - [`1eae837`](https://github.com/Niko1221/Strata/commit/1eae8377e7c7562b9e47cdf9ed2345679c8564e3) [GUI] Merge upstream main and preserve legacy model libraries ### 📊 Changes **2 files changed** (+101 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `apps/host/server/store.mjs` (+14 -3) 📝 `apps/host/tests/model-directory-default.test.mjs` (+87 -2) </details> ### 📄 Description ## Problem and result With a retained `<Strata Home>/models` library and no existing run configuration for the selected model, the Host can pass that model-library folder as the installer's data root. The installer then plans `HOME/models/models/<model>` instead of reusing `HOME/models/<model>`. This fix resolves that exact retained library through `HOME/Strata-data/models`, a verified directory alias to the original library. Original weights stay in place and conflicting destinations are refused. ## Related discussion Related storage feedback: #3292. This fixes retained legacy libraries; it does not provide general arbitrary-GGUF import or repair every model-recognition case. ## Upstream coverage checked Checked current main `011c9e600a93bbc9fd451c563501b5831c32bbca` on 2026-10-22. **The PR is partially covered upstream and remains needed.** - Upstream `rememberDataFolder` now writes the selected data folder to Control settings before the packaged install request, resolving the earlier folder-name guard for this flow. - The library/data-root distinction remains. Safe synthetic detected, saved and environment-selected legacy cases all passed the real upstream guard but planned an extra `models` directory. Original-library reuse acceptance was **0/3**. - Upstream already handles the case where an existing run configuration supplies the correct parent data folder. That behavior is preserved. - The merged fix passes the same three legacy-reuse cases, **3/3**, against current Host and installer planning functions. These are fixture plans, not actual downloads. ## Approach Merged current main into the existing PR branch without rewriting history. Submitted head: `1eae8377e7c7562b9e47cdf9ed2345679c8564e3`. Compared with main, only `apps/host/server/store.mjs` and `apps/host/tests/model-directory-default.test.mjs` differ. Map only the exact legacy library, including saved/environment-selected copies of that path. Windows uses a real Junction; POSIX uses a relative directory symlink. Verify destination physical identity before returning the data root, preserve original bytes, and refuse a conflicting directory or junction. Keep upstream's `pickModelsDirectory`, `MODELS_DIR_NOTICE`, `alignModels` default-directory fallback, Control settings ownership and custom-directory behavior. ## Validation Windows x64, Node v24.18.0, Python 3.12. Tests used disposable synthetic weight bytes and directories. Commands below omit the windowless runner and use process-local TEMP/TMP under the authorized scratch directory. **Passed:** From `apps/host`: ```text node --test --test-isolation=none tests/model-directory-default.test.mjs ``` **8 passed, 0 failed.** Includes detected/saved/environment legacy selection, a pre-existing Documents default, original weight bytes and file identity, idempotence, custom/fresh folders, conflicting directories/junctions and unchanged Documents fallback. Affected upstream regressions: ```text node --test --test-isolation=none --test-name-pattern="a whole drive is not|a folder that cannot|models and Models|the data folder is written|choosing a folder that is gone|the Terminal settings file|a Documents folder that cannot|a usable Documents" tests/model-folder.test.mjs tests/models-directory-fallback.test.mjs ``` **8 passed, 0 failed.** Preserves upstream link-failure fallback, settings merge/idempotence and Documents fallback/normal startup. Additional disposable acceptance harnesses executed the submitted actual `createNativeControl`/store and actual Python `check_data_dir`/`install_plan` functions: **11 Host scenarios and 11 installer/refusal scenarios passed**. Transport, catalog, hardware, setup-table loading and free-space values were explicit fixtures; no install was launched. | Legacy selection | Guard accepted | Plan reaches original weight folder | Original bytes unchanged | Repeated plan unchanged | | --- | --- | --- | --- | --- | | Detected | yes | yes | yes | yes | | Saved | yes | yes | yes | yes | | Environment | yes | yes | yes | yes | The Junction maps `HOME/Strata-data/models/IQ3_XXS` to the original `HOME/models/IQ3_XXS`. The plan reports existing partial-download material in that fixture. Conflict-directory and conflict-junction cases refuse the destination and preserve both libraries. `git diff --check 011c9e60 HEAD` passed. The final worktree was clean, the remote head was checked before the normal fast-forward push, and no force-push was used. **Failed:** The upstream baseline's legacy-reuse acceptance failed 0/3 because the plan used the nested library. All three pass with this fix. The expected merge conflict in `store.mjs` was resolved while preserving current upstream behavior. No unresolved failure remains in the listed checks. **Not run:** Full npm suite, the excluded `subst` drive cases, real model preparation/download/resume or GGUF integrity validation, application UI, GPU inference, macOS/Linux execution, exFAT/UNC or actual link-permission failure. No engine backend source is changed. Upstream Actions remain separate from these local results; workflows awaiting maintainer approval are not counted as test passes. ## Limits Path identity and fixture bytes establish library reuse, not a complete prepared model or a successful real installation. Existing custom folders retain native setup rules. The alias requires permission to create a directory link under Strata Home. Documents-unavailable fallback and unrelated imported-model behavior retain upstream semantics. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:37:41 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#4590
No description provided.