[PR #3373] [GUI] Add Opt-In Local Model Extension Outside The App Installation #4597

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

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/3373
Author: @medking82
Created: 10/20/2026
Status: 🔄 Open

Base: main ← Head: codex/upstream-local-model-extension


📝 Commits (7)

  • 98f8da6 Add opt-in local model extension with portable owner protocol and UI examples
  • 71e2610 fix: mount one connected model card per Storage panel
  • 06d4b38 docs: record installed App 0.2.2 acceptance and limits
  • f280c61 docs: link historical Storage examples to current acceptance
  • 3d08355 docs: add native launch and default agent budget follow-up
  • 1a6c5b7 docs: bind completed native Tray lifecycle validation
  • 5d93f82 docs(extension): reconcile final staged agent acceptance

📊 Changes

33 files changed (+3990 additions, -0 deletions)

View changed files

➕ tools/local-model-extension/.gitignore (+4 -0)
➕ tools/local-model-extension/README.md (+158 -0)
➕ tools/local-model-extension/examples/current-model-in-app.png (+0 -0)
➕ tools/local-model-extension/examples/current-model.png (+0 -0)
➕ tools/local-model-extension/examples/manage-models.png (+0 -0)
➕ tools/local-model-extension/examples/render.mjs (+112 -0)
➕ tools/local-model-extension/examples/storage.png (+0 -0)
➕ tools/local-model-extension/extension.example.json (+8 -0)
➕ tools/local-model-extension/extension_bridge.mjs (+147 -0)
➕ tools/local-model-extension/extension_bridge.test.mjs (+126 -0)
➕ tools/local-model-extension/extension_manager.py (+219 -0)
➕ tools/local-model-extension/host-preload.mjs (+34 -0)
➕ tools/local-model-extension/host-preload.test.mjs (+46 -0)
➕ tools/local-model-extension/launch.py (+42 -0)
➕ tools/local-model-extension/owner_api.mjs (+155 -0)
➕ tools/local-model-extension/owner_api.test.mjs (+155 -0)
➕ tools/local-model-extension/package/manifest.json (+12 -0)
➕ tools/local-model-extension/package/ui.test.mjs (+848 -0)
➕ tools/local-model-extension/package/ui/api.mjs (+59 -0)
➕ tools/local-model-extension/package/ui/connected.css (+4 -0)

...and 13 more files

📄 Description

Problem and result

A Strata server managed outside the App can be usable through an API connection while Manage Models and Storage show no native downloads. Customizing bundled frontend files to expose that connection also conflicts with App updates.

This opt-in companion adds Current Model and isolated Connected Local Models cards while retaining the official catalog, download library and component updater. It uses the managed Tray as the sole lifecycle owner. No model files are moved or copied, and connected models do not become native prepared/downloaded rows.

Scope proposal #3369; depends on the optional owner protocol in #3365. Ready for review. Scope agreement has not yet been obtained; review is requested alongside that discussion. It changes no defaults. Reasoning effort stays in the official composer; the separate API effort fix is #3363.

Approach

All changes are new files under tools/local-model-extension/, based on main at e88ee39d. Existing engine, server, frontend, setup, installer and updater files are byte-identical to that base (git diff e88ee39d -- . ':!tools/local-model-extension' is empty).

An explicit external launcher adds a Node preload only to its App child. It checks the exact host entrypoint and listening port, preserves existing NODE_OPTIONS, and serves one versioned Shadow DOM/iframe UI package through a separate namespace. Package hashes, inventory, App 0.2.x and Bridge API 1 are checked before injection. Missing, disabled, corrupt or incompatible packages leave the original host listener in place. Activation, disable and rollback are outside the App install folder.

The companion accepts configurable loopback ports and physical model IDs, with optional display labels. It cross-checks the fresh owner snapshot with live API metadata. Context choices come from the actual native catalog; selected and effective values remain distinct. Idle choices are Never/5/10/30 Minutes. Explicit context, idle, preload and unload requests enter the existing Tray serial worker via atomic file IPC, with execution-time identity checks and durable acknowledgments. The companion never starts an inference server or bypasses owner drain/authentication through direct HTTP load/unload calls.

Use In Chat requires one existing App connection with the same API URL and physical ID. It preserves authentication and unrelated rows, updates confirmed display/capacity metadata, then selects the exact official picker entry after an explicit action. It does not change effort, Fast, permissions or client settings. The package contains no private model allowlist, Codex dependency, account details or local user paths.

Examples

Anonymous simulated fixtures from predecessor 98f8da6a, predating the App 0.2.2 Storage correction, rendered from the production extension assets and the actual NativeModels / SettingsStorage React components. These are UI render examples, not evidence of inference, actual memory fit or an installed App update. Original user screenshots were not uploaded. Captions identify the simulated state; no private paths, credentials or model IDs are present.

Current Model

Sanitized Current Model panel, simulated 128K context and 30-minute idle unload

Manage Models — the native dialog is scrolled to the connected card's actions.

Sanitized Manage Models dialog with the connected local model card

Storage — native directories and download counts remain unchanged.

Sanitized native Storage view with a separate connected model card

Current Model opened inside the App fixture. Generation source and setup instructions are in the added README; no original personal screenshot is used.

Validation

Windows 11 x64, native App/Host 0.2.2, Control/engine 0.1.47, RTX 5080, Python 3.12.10 and Node 24.12.0. Acceptance report and sanitized receipt bind source, immutable packages and observations. Current head 5d93f82de0a00e123ffc23b41315584d744f4978 changes documentation only; runtime fix remains 71e26101, package 1.0.0-088a8606771d.

Passed:

  • 71 Node tests, zero skipped, including real Python Tray IPC, plus 13 Python tests.
  • Public install/activate, launcher check and native App startup; Host compatible/ready, Bridge API1 and isolated WebView2 storage.
  • Current Model, native Manage Models/Storage and exact Use In Chat from all three surfaces; credential/unrelated-model preservation; official directory fields and zero native download counts.
  • Real owner preload/unload, Context 8K → 64K → 8K, Idle300, actual 300-second unload and lazy restart. Direct App chat returned OK with child-only STRATA_AGENT=off.
  • Storage regression: old two-card behavior failed 2 !== 1; one enclosing-panel anchor fixed it. The corrected package was rechecked in the actual App, including Storage Use In Chat, both native sections/counts and scrolling.
  • Actual disable/rollback, disabled home byte-identical to official HTML, rejected control request while disabled, fresh native startup and restored package/preferences.
  • Companion Tray follow-up: actual native menu popup and Open Strata App were exercised with human assistance. Official App 0.2.2 was a direct child of the public Tray; its child Host reported managed port18148 and 8K. The native window rendered with isolated storage. This separate bare launch did not load the Extension or register/select a native model.
  • Completed core native-menu dispatch: human-assisted Unload/Context 8K → 32K → 8K/Idle Never → 5 Minutes → Never, then automated Windows UIAutomation Stop, Start, Restart, Preload, Unload and Exit, each automated action invoked once. Owner/API/process evidence agreed: real engine loaded then unloaded; graceful Tray exit code 0; test App/processes/listeners closed; production Tray/listener identities preserved. Live Context/Idle submenus were inspected. Actual unedited captures and the hashed owner timeline are in the report.
  • The 188 previously observed installed App/Host/Control files, original profiles/client configs and production listener identities were preserved. Default product paths remain byte-identical to base e88ee39d; diff checks passed.

Failed or limited:

  • The initial disposable profile path was corrected; original Storage duplication was reproduced and fixed.
  • The default-agent 8K failure and first candidate's 104-token / OK result remain historical evidence. Separate #3684 is now Ready For Review at f273ef65: final v2 passed full Harness build/deploy/staging (9 gates), authenticated boot, 10 focused and 12 staged tests. Native App 0.2.2 completed a real read and displayed READY-3684 (wire caps 298 / 242); four further real-model turns, including two reads, answered with stop and finished at 7106 context tokens. Its source-bound report separates native acceptance from scripted 16K compaction. Installed Harness and the Extension package remain unchanged. Combined patched-Harness/portable-companion acceptance was not run.

Not run:

  • Live App/Engine installation/signature/upgrade/restart, reboot/autostart, monitor transitions, other GPU backends, larger-context memory fit, multiple-profile switching, auxiliary menu open/copy actions, combined patched-Harness/portable-companion acceptance and unbounded default-agent tool/long-form stress at 8K remain unrun. The older example PNGs above remain simulated fixtures; the follow-up report binds actual native-menu observations.

Limits

Scope still needs agreement in #3369; the updated issue comment requests confirmation. This is an optional external companion, not a supported general plugin API or a guarantee for arbitrary future App layouts. It requires the managed Tray candidate and one matching existing API connection. No default path, effort, Fast, permissions, updater or model library was changed. File IPC stays private; interrupted requests are not replayed.


🔄 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/3373 **Author:** [@medking82](https://github.com/medking82) **Created:** 10/20/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `codex/upstream-local-model-extension` --- ### 📝 Commits (7) - [`98f8da6`](https://github.com/Niko1221/Strata/commit/98f8da6aa2de0587e9346f73e1fac213f928399f) Add opt-in local model extension with portable owner protocol and UI examples - [`71e2610`](https://github.com/Niko1221/Strata/commit/71e26101131235b42422494bff0550cb193200cf) fix: mount one connected model card per Storage panel - [`06d4b38`](https://github.com/Niko1221/Strata/commit/06d4b3851f05455edc5bb15b67edc2dc53798df0) docs: record installed App 0.2.2 acceptance and limits - [`f280c61`](https://github.com/Niko1221/Strata/commit/f280c61317822aed5081ed93f25f8bba862cd429) docs: link historical Storage examples to current acceptance - [`3d08355`](https://github.com/Niko1221/Strata/commit/3d0835564f67e270421e7d73644312a409b65363) docs: add native launch and default agent budget follow-up - [`1a6c5b7`](https://github.com/Niko1221/Strata/commit/1a6c5b724441feb7cfbc791bfe832d47c5816a0f) docs: bind completed native Tray lifecycle validation - [`5d93f82`](https://github.com/Niko1221/Strata/commit/5d93f82de0a00e123ffc23b41315584d744f4978) docs(extension): reconcile final staged agent acceptance ### 📊 Changes **33 files changed** (+3990 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `tools/local-model-extension/.gitignore` (+4 -0) ➕ `tools/local-model-extension/README.md` (+158 -0) ➕ `tools/local-model-extension/examples/current-model-in-app.png` (+0 -0) ➕ `tools/local-model-extension/examples/current-model.png` (+0 -0) ➕ `tools/local-model-extension/examples/manage-models.png` (+0 -0) ➕ `tools/local-model-extension/examples/render.mjs` (+112 -0) ➕ `tools/local-model-extension/examples/storage.png` (+0 -0) ➕ `tools/local-model-extension/extension.example.json` (+8 -0) ➕ `tools/local-model-extension/extension_bridge.mjs` (+147 -0) ➕ `tools/local-model-extension/extension_bridge.test.mjs` (+126 -0) ➕ `tools/local-model-extension/extension_manager.py` (+219 -0) ➕ `tools/local-model-extension/host-preload.mjs` (+34 -0) ➕ `tools/local-model-extension/host-preload.test.mjs` (+46 -0) ➕ `tools/local-model-extension/launch.py` (+42 -0) ➕ `tools/local-model-extension/owner_api.mjs` (+155 -0) ➕ `tools/local-model-extension/owner_api.test.mjs` (+155 -0) ➕ `tools/local-model-extension/package/manifest.json` (+12 -0) ➕ `tools/local-model-extension/package/ui.test.mjs` (+848 -0) ➕ `tools/local-model-extension/package/ui/api.mjs` (+59 -0) ➕ `tools/local-model-extension/package/ui/connected.css` (+4 -0) _...and 13 more files_ </details> ### 📄 Description ## Problem and result A Strata server managed outside the App can be usable through an API connection while **Manage Models** and **Storage** show no native downloads. Customizing bundled frontend files to expose that connection also conflicts with App updates. This opt-in companion adds **Current Model** and isolated **Connected Local Models** cards while retaining the official catalog, download library and component updater. It uses the managed Tray as the sole lifecycle owner. No model files are moved or copied, and connected models do not become native prepared/downloaded rows. ## Related discussion Scope proposal #3369; depends on the optional owner protocol in #3365. **Ready for review. Scope agreement has not yet been obtained; review is requested alongside that discussion.** It changes no defaults. Reasoning effort stays in the official composer; the separate API effort fix is #3363. ## Approach All changes are new files under `tools/local-model-extension/`, based on `main` at `e88ee39d`. Existing engine, server, frontend, setup, installer and updater files are byte-identical to that base (`git diff e88ee39d -- . ':!tools/local-model-extension'` is empty). An explicit external launcher adds a Node preload only to its App child. It checks the exact host entrypoint and listening port, preserves existing `NODE_OPTIONS`, and serves one versioned Shadow DOM/iframe UI package through a separate namespace. Package hashes, inventory, App 0.2.x and Bridge API 1 are checked before injection. Missing, disabled, corrupt or incompatible packages leave the original host listener in place. Activation, disable and rollback are outside the App install folder. The companion accepts configurable loopback ports and physical model IDs, with optional display labels. It cross-checks the fresh owner snapshot with live API metadata. Context choices come from the actual native catalog; selected and effective values remain distinct. Idle choices are Never/5/10/30 Minutes. Explicit context, idle, preload and unload requests enter the existing Tray serial worker via atomic file IPC, with execution-time identity checks and durable acknowledgments. The companion never starts an inference server or bypasses owner drain/authentication through direct HTTP load/unload calls. **Use In Chat** requires one existing App connection with the same API URL and physical ID. It preserves authentication and unrelated rows, updates confirmed display/capacity metadata, then selects the exact official picker entry after an explicit action. It does not change effort, Fast, permissions or client settings. The package contains no private model allowlist, Codex dependency, account details or local user paths. ## Examples Anonymous simulated fixtures from predecessor `98f8da6a`, predating the App 0.2.2 Storage correction, rendered from the production extension assets and the actual `NativeModels` / `SettingsStorage` React components. These are UI render examples, **not evidence of inference, actual memory fit or an installed App update**. Original user screenshots were not uploaded. Captions identify the simulated state; no private paths, credentials or model IDs are present. **Current Model** <img src="https://raw.githubusercontent.com/medking82/Strata/98f8da6aa2de0587e9346f73e1fac213f928399f/tools/local-model-extension/examples/current-model.png" width="760" alt="Sanitized Current Model panel, simulated 128K context and 30-minute idle unload"> **Manage Models** — the native dialog is scrolled to the connected card's actions. <img src="https://raw.githubusercontent.com/medking82/Strata/98f8da6aa2de0587e9346f73e1fac213f928399f/tools/local-model-extension/examples/manage-models.png" width="860" alt="Sanitized Manage Models dialog with the connected local model card"> **Storage** — native directories and download counts remain unchanged. <img src="https://raw.githubusercontent.com/medking82/Strata/98f8da6aa2de0587e9346f73e1fac213f928399f/tools/local-model-extension/examples/storage.png" width="860" alt="Sanitized native Storage view with a separate connected model card"> [Current Model opened inside the App fixture](https://github.com/medking82/Strata/blob/98f8da6aa2de0587e9346f73e1fac213f928399f/tools/local-model-extension/examples/current-model-in-app.png). Generation source and setup instructions are in the added README; no original personal screenshot is used. ## Validation Windows 11 x64, native App/Host 0.2.2, Control/engine 0.1.47, RTX 5080, Python 3.12.10 and Node 24.12.0. [Acceptance report](https://github.com/medking82/Strata/blob/5d93f82de0a00e123ffc23b41315584d744f4978/tools/local-model-extension/validation-app-0.2.2.md) and [sanitized receipt](https://github.com/medking82/Strata/blob/5d93f82de0a00e123ffc23b41315584d744f4978/tools/local-model-extension/validation-app-0.2.2.json) bind source, immutable packages and observations. Current head `5d93f82de0a00e123ffc23b41315584d744f4978` changes documentation only; runtime fix remains `71e26101`, package `1.0.0-088a8606771d`. **Passed:** - **71 Node tests, zero skipped**, including real Python Tray IPC, plus **13 Python tests**. - Public install/activate, launcher check and native App startup; Host compatible/ready, Bridge API1 and isolated WebView2 storage. - Current Model, native Manage Models/Storage and exact Use In Chat from all three surfaces; credential/unrelated-model preservation; official directory fields and zero native download counts. - Real owner preload/unload, Context 8K → 64K → 8K, Idle300, actual 300-second unload and lazy restart. Direct App chat returned `OK` with child-only `STRATA_AGENT=off`. - Storage regression: old two-card behavior failed `2 !== 1`; one enclosing-panel anchor fixed it. The corrected package was rechecked in the actual App, including Storage Use In Chat, both native sections/counts and scrolling. - Actual disable/rollback, disabled home byte-identical to official HTML, rejected control request while disabled, fresh native startup and restored package/preferences. - Companion Tray follow-up: actual native menu popup and **Open Strata App** were exercised with human assistance. Official App 0.2.2 was a direct child of the public Tray; its child Host reported managed port18148 and 8K. The native window rendered with isolated storage. This separate bare launch did not load the Extension or register/select a native model. - **Completed core native-menu dispatch:** human-assisted Unload/Context 8K → 32K → 8K/Idle Never → 5 Minutes → Never, then automated Windows UIAutomation **Stop, Start, Restart, Preload, Unload and Exit**, each automated action invoked once. Owner/API/process evidence agreed: real engine loaded then unloaded; graceful Tray exit code 0; test App/processes/listeners closed; production Tray/listener identities preserved. Live Context/Idle submenus were inspected. Actual unedited captures and the hashed owner timeline are in the report. - The 188 previously observed installed App/Host/Control files, original profiles/client configs and production listener identities were preserved. Default product paths remain byte-identical to base `e88ee39d`; diff checks passed. **Failed or limited:** - The initial disposable profile path was corrected; original Storage duplication was reproduced and fixed. - The default-agent 8K failure and first candidate's **104-token / OK** result remain historical evidence. Separate #3684 is now **Ready For Review** at `f273ef65`: final v2 passed full Harness build/deploy/staging (9 gates), authenticated boot, 10 focused and 12 staged tests. Native App 0.2.2 completed a real `read` and displayed **READY-3684** (wire caps **298 / 242**); four further real-model turns, including two reads, answered with `stop` and finished at 7106 context tokens. Its [source-bound report](https://github.com/medking82/Strata/blob/f273ef65e8f4548125f3e72833cd61019b82080f/apps/host/server/agent/output-budget-validation.md) separates native acceptance from scripted 16K compaction. Installed Harness and the Extension package remain unchanged. Combined patched-Harness/portable-companion acceptance was not run. **Not run:** - Live App/Engine installation/signature/upgrade/restart, reboot/autostart, monitor transitions, other GPU backends, larger-context memory fit, multiple-profile switching, auxiliary menu open/copy actions, combined patched-Harness/portable-companion acceptance and unbounded default-agent tool/long-form stress at 8K remain unrun. The older example PNGs above remain simulated fixtures; the follow-up report binds actual native-menu observations. ## Limits Scope still needs agreement in #3369; the updated issue comment requests confirmation. This is an optional external companion, not a supported general plugin API or a guarantee for arbitrary future App layouts. It requires the managed Tray candidate and one matching existing API connection. No default path, effort, Fast, permissions, updater or model library was changed. File IPC stays private; interrupted requests are not replayed. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#4597
No description provided.