[PR #3365] [GUI] Add Optional Windows Tray For Local Model Control #4592

Open
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/3365
Author: @medking82
Created: 10/20/2026
Status: 🔄 Open

Base: main ← Head: codex/windows-tray-20261012


📝 Commits (6)

  • d2303a5 [GUI] Add Opt-In Windows Tray For Model Control On 0.2.0
  • ff69390 Add sanitized native menu examples and opt-in App extension IPC
  • 02bdf9a docs: record portable Tray App 0.2.2 acceptance
  • b08ab08 docs: record native Tray launch and agent budget follow-up
  • 42a1fe9 docs: complete native Tray lifecycle acceptance
  • 5580133 docs(tray): reconcile final staged agent acceptance

📊 Changes

36 files changed (+4314 additions, -0 deletions)

View changed files

➕ tools/windows-tray/.gitignore (+3 -0)
➕ tools/windows-tray/App.config (+7 -0)
➕ tools/windows-tray/AppUpdatePolicy.cs (+118 -0)
➕ tools/windows-tray/AssemblyInfo.cs (+2 -0)
➕ tools/windows-tray/Build.ps1 (+23 -0)
➕ tools/windows-tray/ManagedMenu.cs (+110 -0)
➕ tools/windows-tray/ManagedTray.cs (+262 -0)
➕ tools/windows-tray/MenuExamples.cs (+88 -0)
➕ tools/windows-tray/ProcessJob.cs (+72 -0)
➕ tools/windows-tray/Program.cs (+266 -0)
➕ tools/windows-tray/README.md (+251 -0)
➕ tools/windows-tray/Strata.ico (+0 -0)
➕ tools/windows-tray/TrayTests.cs (+151 -0)
➕ tools/windows-tray/app.manifest (+12 -0)
➕ tools/windows-tray/managed/config.py (+166 -0)
➕ tools/windows-tray/managed/controller.py (+395 -0)
➕ tools/windows-tray/managed/extension.py (+153 -0)
➕ tools/windows-tray/managed/requirements.txt (+1 -0)
➕ tools/windows-tray/managed/test_extension.py (+284 -0)
➕ tools/windows-tray/managed/test_managed.py (+405 -0)

...and 16 more files

📄 Description

Problem and result

Windows users need quick access to their local Strata server without keeping a console or browser open. This opt-in Tray adds a read-only client and a separately configured managed mode for model profiles, context, idle unload and explicit Preload/Unload. It is not installed or started by the default installer.

#2034. Continuation of #2035 after the tracker reset: GitHub refused to reopen the closed PR even after restoring its previous head, and the reset bot suggested a replacement. This candidate is rebased onto 0.2.0-beta main (e88ee39d). Ready for review. Scope agreement for the managed feature is still requested. The earlier issue proposed a narrower read-only client. No maintainer agreement on the expanded scope is assumed.

The separate Local Model Extension scope is #3369. This Tray provides its optional single-owner protocol; the Extension UI stays in #3373.

Approach

All files are isolated under tools/windows-tray/. Existing engine, server, frontend, setup and default installation files are byte-identical to the base revision (git diff e88ee39d -- . ':!tools/windows-tray' is empty). The Tray forwards client authentication unchanged and owns only the processes in its private Windows Job. Lifecycle changes close admission and drain admitted requests before acting; occupied ports are refused. Startup and restart stay lazy.

Managed mode uses the official context choices (8K, 32K, 64K, 128K, 200K, 256K, 384K, 512K), and Never/5/10/30-minute idle unload, preserving original profiles and saved settings. Selected/effective settings remain distinct. An optional desktop_app path adds Open Strata App and a separate App update metadata check using the official feed. App installation and signature verification stay in the App. Legacy engine staging is retained only for legacy assets; signed 0.2 component releases defer to the official component updater.

The current official desktop icon is embedded. Production menu construction is shared with a native fixture renderer so the examples below come from real WinForms controls, not a recreated mockup. No personal configuration, model ID, private path or original user screenshot is included. This generic candidate has no Codex dependency or client-capacity synchronization.

app_extension defaults to false and publishes no companion IPC files unless opted in. When enabled, it publishes fresh allowlisted owner metadata and claims one UUID/physical-model-bound context, idle, load or unload command into the existing serial worker. Identity is checked at execution. Durable terminal acknowledgments precede claim removal; interrupted claims are never replayed. The companion has no independent inference process or HTTP lifecycle bypass.

Examples

These are anonymous simulated menu states, rendered offscreen by the production ManagedMenu through WinForms DrawToBitmap. The fixture starts no Tray controller, server, App, updater or inference. Submenus are placed beside the main menu for readability. Captions and the official icon sit outside the controls. These images do not establish server health, installed updates or GPU behavior.

Managed Menu

Sanitized simulated managed Tray menu with official icon

Official Context Choices

Simulated Tray context submenu with all eight official choices

Idle Unload

Simulated Never, 5, 10 and 30-minute idle unload choices

Engine Updates — signed component installation belongs to the official updater.

Simulated Engine update submenu deferring to the official component updater

App Updates — checks App metadata and opens the App to install.

Simulated separate App update submenu

The added screenshots/README.md and MenuExamples.cs document reproducible generation. All five PNGs were visually inspected and have no text/EXIF metadata.

Validation

Windows 11 x64, installed 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 the tested inputs and distinguish the initial and follow-up runs. Current head 558013342d27bdde5e55ff05437369221d1e61b9 adds documentation only; tested Tray runtime remains ff69390e.

Passed:

  • 81 C# checks, all 16 managed Python cases (12 + 4 real mock-server cases), 15 IPC tests, 3 installed-App metadata checks. Executable SHA-256: 1d226b998942de822c5752caf74205266d0166da86a3b6dd40004f8fcb276e72.
  • Real lazy startup, preload/unload, terminal owner acknowledgments, Context 8K → 64K → 8K and Idle 300 through App/owner IPC; direct App reply OK with child-only STRATA_AGENT=off; actual 300-second automatic unload and lazy restart.
  • Actual physical menu rendering and Open Strata App: a human-assisted click in the public Tray started official App 0.2.2. App PID 16504 was a child of test Tray 29212; Host 2180 was its child. Health reported the managed 127.0.0.1:18148/v1 URL and 8K Context despite a deliberately unused inherited port19999. Native automation observed the rendered App; isolated WebView2 storage was confirmed. This run used no Extension launcher/preload.
  • 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.
  • Preservation: the 188 previously observed installed App/Host/Control files retained SHA-256; original profiles/settings and production listeners were preserved. The mutable production status file continued updating.
  • Default product paths remain byte-identical to base e88ee39d; diff checks passed.

Failed or limited:

  • The initial disposable expert-profile path was corrected after a terminal preload error.
  • The original default-agent 8K no-answer failure and first candidate's 104-token / OK result remain historical evidence. Separate #3684 is now Ready For Review at f273ef65: the final v2 patch passed full Harness build/deploy/staging (9 build gates), authenticated boot, 10 focused and 12 staged tests. Native App 0.2.2 completed a real read and displayed READY-3684 with wire caps 298 / 242; four additional real-model turns (two reads) all answered with stop, final context 7106 tokens. Its source-bound report separates native acceptance from scripted 16K compaction. Installed Harness and this Tray runtime remain unchanged; combined patched-Harness/portable-companion acceptance was not run.
  • The separate Extension's App 0.2.2 Storage duplication was fixed and rechecked in #3373.
  • The clean Open App profile's native picker remained empty; launch/backend handoff does not register or select the externally owned model.

Not run:

  • Reboot/autostart, monitor transitions, other GPU backends, larger-context allocation/inference, multiple-profile switching, auxiliary menu open/copy actions and live installer/signature/update/restart remain unrun. Combined patched-Harness/portable-companion acceptance and unbounded 8K tool/long-form stress remain unrun.

Limits

Managed scope still needs agreement in #2034; the updated issue comment requests that decision. The bounded App 0.2.2 run does not certify all Windows workflows or future releases. Signed component installation remains with the official updater. This is not a general plugin API or native prepared-model registration. Read-only mode accepts no API key. Optional companion IPC state must stay private; interrupted claims 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/3365 **Author:** [@medking82](https://github.com/medking82) **Created:** 10/20/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `codex/windows-tray-20261012` --- ### 📝 Commits (6) - [`d2303a5`](https://github.com/Niko1221/Strata/commit/d2303a53cabe09f23cd3d193daabdae7c7e2ba73) [GUI] Add Opt-In Windows Tray For Model Control On 0.2.0 - [`ff69390`](https://github.com/Niko1221/Strata/commit/ff69390ecaeb6e130cbe1939d78c64d6fa60a81b) Add sanitized native menu examples and opt-in App extension IPC - [`02bdf9a`](https://github.com/Niko1221/Strata/commit/02bdf9a20287c02a177e97ae64faa2d4416a5a01) docs: record portable Tray App 0.2.2 acceptance - [`b08ab08`](https://github.com/Niko1221/Strata/commit/b08ab08c221d84c2f5f646dff8931311ab7da8f2) docs: record native Tray launch and agent budget follow-up - [`42a1fe9`](https://github.com/Niko1221/Strata/commit/42a1fe92d6c3240d62c4afd154043b9305b844f0) docs: complete native Tray lifecycle acceptance - [`5580133`](https://github.com/Niko1221/Strata/commit/558013342d27bdde5e55ff05437369221d1e61b9) docs(tray): reconcile final staged agent acceptance ### 📊 Changes **36 files changed** (+4314 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `tools/windows-tray/.gitignore` (+3 -0) ➕ `tools/windows-tray/App.config` (+7 -0) ➕ `tools/windows-tray/AppUpdatePolicy.cs` (+118 -0) ➕ `tools/windows-tray/AssemblyInfo.cs` (+2 -0) ➕ `tools/windows-tray/Build.ps1` (+23 -0) ➕ `tools/windows-tray/ManagedMenu.cs` (+110 -0) ➕ `tools/windows-tray/ManagedTray.cs` (+262 -0) ➕ `tools/windows-tray/MenuExamples.cs` (+88 -0) ➕ `tools/windows-tray/ProcessJob.cs` (+72 -0) ➕ `tools/windows-tray/Program.cs` (+266 -0) ➕ `tools/windows-tray/README.md` (+251 -0) ➕ `tools/windows-tray/Strata.ico` (+0 -0) ➕ `tools/windows-tray/TrayTests.cs` (+151 -0) ➕ `tools/windows-tray/app.manifest` (+12 -0) ➕ `tools/windows-tray/managed/config.py` (+166 -0) ➕ `tools/windows-tray/managed/controller.py` (+395 -0) ➕ `tools/windows-tray/managed/extension.py` (+153 -0) ➕ `tools/windows-tray/managed/requirements.txt` (+1 -0) ➕ `tools/windows-tray/managed/test_extension.py` (+284 -0) ➕ `tools/windows-tray/managed/test_managed.py` (+405 -0) _...and 16 more files_ </details> ### 📄 Description ## Problem and result Windows users need quick access to their local Strata server without keeping a console or browser open. This opt-in Tray adds a read-only client and a separately configured managed mode for model profiles, context, idle unload and explicit Preload/Unload. It is not installed or started by the default installer. ## Related discussion #2034. Continuation of #2035 after the tracker reset: GitHub refused to reopen the closed PR even after restoring its previous head, and the reset bot suggested a replacement. This candidate is rebased onto 0.2.0-beta `main` (`e88ee39d`). **Ready for review. Scope agreement for the managed feature is still requested.** The earlier issue proposed a narrower read-only client. No maintainer agreement on the expanded scope is assumed. The separate Local Model Extension scope is #3369. This Tray provides its optional single-owner protocol; the Extension UI stays in #3373. ## Approach All files are isolated under `tools/windows-tray/`. Existing engine, server, frontend, setup and default installation files are byte-identical to the base revision (`git diff e88ee39d -- . ':!tools/windows-tray'` is empty). The Tray forwards client authentication unchanged and owns only the processes in its private Windows Job. Lifecycle changes close admission and drain admitted requests before acting; occupied ports are refused. Startup and restart stay lazy. Managed mode uses the official context choices (8K, 32K, 64K, 128K, 200K, 256K, 384K, 512K), and Never/5/10/30-minute idle unload, preserving original profiles and saved settings. Selected/effective settings remain distinct. An optional `desktop_app` path adds Open Strata App and a separate App update metadata check using the official feed. App installation and signature verification stay in the App. Legacy engine staging is retained only for legacy assets; signed 0.2 component releases defer to the official component updater. The current official desktop icon is embedded. Production menu construction is shared with a native fixture renderer so the examples below come from real WinForms controls, not a recreated mockup. No personal configuration, model ID, private path or original user screenshot is included. This generic candidate has no Codex dependency or client-capacity synchronization. `app_extension` defaults to false and publishes no companion IPC files unless opted in. When enabled, it publishes fresh allowlisted owner metadata and claims one UUID/physical-model-bound context, idle, load or unload command into the existing serial worker. Identity is checked at execution. Durable terminal acknowledgments precede claim removal; interrupted claims are never replayed. The companion has no independent inference process or HTTP lifecycle bypass. ## Examples **These are anonymous simulated menu states**, rendered offscreen by the production `ManagedMenu` through WinForms `DrawToBitmap`. The fixture starts no Tray controller, server, App, updater or inference. Submenus are placed beside the main menu for readability. Captions and the official icon sit outside the controls. These images do not establish server health, installed updates or GPU behavior. **Managed Menu** <img src="https://raw.githubusercontent.com/medking82/Strata/ff69390ecaeb6e130cbe1939d78c64d6fa60a81b/tools/windows-tray/screenshots/managed-menu.png" width="523" alt="Sanitized simulated managed Tray menu with official icon"> **Official Context Choices** <img src="https://raw.githubusercontent.com/medking82/Strata/ff69390ecaeb6e130cbe1939d78c64d6fa60a81b/tools/windows-tray/screenshots/context-menu.png" width="694" alt="Simulated Tray context submenu with all eight official choices"> **Idle Unload** <img src="https://raw.githubusercontent.com/medking82/Strata/ff69390ecaeb6e130cbe1939d78c64d6fa60a81b/tools/windows-tray/screenshots/idle-menu.png" width="742" alt="Simulated Never, 5, 10 and 30-minute idle unload choices"> **Engine Updates** — signed component installation belongs to the official updater. <img src="https://raw.githubusercontent.com/medking82/Strata/ff69390ecaeb6e130cbe1939d78c64d6fa60a81b/tools/windows-tray/screenshots/engine-update-menu.png" width="850" alt="Simulated Engine update submenu deferring to the official component updater"> **App Updates** — checks App metadata and opens the App to install. <img src="https://raw.githubusercontent.com/medking82/Strata/ff69390ecaeb6e130cbe1939d78c64d6fa60a81b/tools/windows-tray/screenshots/app-update-menu.png" width="850" alt="Simulated separate App update submenu"> The added `screenshots/README.md` and `MenuExamples.cs` document reproducible generation. All five PNGs were visually inspected and have no text/EXIF metadata. ## Validation Windows 11 x64, installed 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/558013342d27bdde5e55ff05437369221d1e61b9/tools/windows-tray/validation-app-0.2.2.md) and [sanitized receipt](https://github.com/medking82/Strata/blob/558013342d27bdde5e55ff05437369221d1e61b9/tools/windows-tray/validation-app-0.2.2.json) bind the tested inputs and distinguish the initial and follow-up runs. Current head `558013342d27bdde5e55ff05437369221d1e61b9` adds documentation only; tested Tray runtime remains `ff69390e`. **Passed:** - **81 C# checks, all 16 managed Python cases (12 + 4 real mock-server cases), 15 IPC tests, 3 installed-App metadata checks**. Executable SHA-256: `1d226b998942de822c5752caf74205266d0166da86a3b6dd40004f8fcb276e72`. - Real lazy startup, preload/unload, terminal owner acknowledgments, Context 8K → 64K → 8K and Idle 300 through App/owner IPC; direct App reply `OK` with child-only `STRATA_AGENT=off`; actual 300-second automatic unload and lazy restart. - **Actual physical menu rendering and Open Strata App:** a human-assisted click in the public Tray started official App 0.2.2. App PID 16504 was a child of test Tray 29212; Host 2180 was its child. Health reported the managed `127.0.0.1:18148/v1` URL and 8K Context despite a deliberately unused inherited port19999. Native automation observed the rendered App; isolated WebView2 storage was confirmed. This run used no Extension launcher/preload. - **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. - Preservation: the 188 previously observed installed App/Host/Control files retained SHA-256; original profiles/settings and production listeners were preserved. The mutable production status file continued updating. - Default product paths remain byte-identical to base `e88ee39d`; diff checks passed. **Failed or limited:** - The initial disposable expert-profile path was corrected after a terminal preload error. - The original default-agent 8K no-answer failure and first candidate's **104-token / OK** result remain historical evidence. Separate #3684 is now **Ready For Review** at `f273ef65`: the final v2 patch passed full Harness build/deploy/staging (9 build gates), authenticated boot, 10 focused and 12 staged tests. Native App 0.2.2 completed a real `read` and displayed **READY-3684** with wire caps **298 / 242**; four additional real-model turns (two reads) all answered with `stop`, final context 7106 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 this Tray runtime remain unchanged; combined patched-Harness/portable-companion acceptance was not run. - The separate Extension's App 0.2.2 Storage duplication was fixed and rechecked in #3373. - The clean Open App profile's native picker remained empty; launch/backend handoff does not register or select the externally owned model. **Not run:** - Reboot/autostart, monitor transitions, other GPU backends, larger-context allocation/inference, multiple-profile switching, auxiliary menu open/copy actions and live installer/signature/update/restart remain unrun. Combined patched-Harness/portable-companion acceptance and unbounded 8K tool/long-form stress remain unrun. ## Limits Managed scope still needs agreement in #2034; the updated issue comment requests that decision. The bounded App 0.2.2 run does not certify all Windows workflows or future releases. Signed component installation remains with the official updater. This is not a general plugin API or native prepared-model registration. Read-only mode accepts no API key. Optional companion IPC state must stay private; interrupted claims 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#4592
No description provided.