[PR #3347] [CLOSED] [GUI] Add Mac pairing, shared chats and remote model controls #4582

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

📋 Pull Request Information

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

Base: main ← Head: pr/mac-iphone-support


📝 Commits (6)

  • 818ecf4 [GUI] Add opt-in Mac support for paired iPhone conversations
  • ed35bd5 [GUI] Add remote model downloads and GGUF imports
  • 5aeb869 [GUI] Manage terminal server model files over configurable SSH
  • a2daa74 Add reviewed current-model Serving controls for saved Terminal APIs
  • 5754995 [GUI] Prepare and switch models on SSH servers
  • 50426b0 [GUI] Merge upstream 0.2.1 into Mac companion support

📊 Changes

77 files changed (+10701 additions, -74 deletions)

View changed files

📝 .gitignore (+4 -0)
➕ apps/companion-bridge/README.md (+104 -0)
➕ apps/companion-bridge/bridge.mjs (+843 -0)
➕ apps/companion-bridge/index.mjs (+42 -0)
➕ apps/companion-bridge/package.json (+7 -0)
➕ apps/companion-bridge/qr.swift (+16 -0)
➕ apps/companion-bridge/test/bridge.test.mjs (+349 -0)
➕ apps/companion-bridge/test/conversations.test.mjs (+223 -0)
➕ apps/companion-bridge/test/model-management.test.mjs (+210 -0)
➕ apps/desktop/PAIRING.md (+25 -0)
📝 apps/desktop/package.json (+2 -1)
➕ apps/desktop/scripts/stage-companion.mjs (+21 -0)
➕ apps/desktop/scripts/stage-remote-lifecycle.mjs (+31 -0)
➕ apps/desktop/src-tauri/resources/companion-bridge/.gitignore (+2 -0)
📝 apps/desktop/src-tauri/tauri.conf.json (+4 -0)
➕ apps/host/REMOTE-MODELS.md (+63 -0)
➕ apps/host/python/remote_model_lifecycle.py (+925 -0)
➕ apps/host/python/remote_model_manager.py (+669 -0)
📝 apps/host/server/agent/agent-bridge.mjs (+18 -3)
➕ apps/host/server/companion-routes.mjs (+47 -0)

...and 57 more files

📄 Description

Problem and result

Mac conversations cannot be continued securely from a native iPhone client, and saved model APIs do not provide a complete remote model workflow. This adds opt-in iPhone pairing, shared history/session continuation, Thinking and ordered progress, browser/tool activity, approvals and Stop. Saved Strata connections gain remote downloads/imports, current-model Serving controls, and Prepare & serve for SSH servers.

From Settings → Models → Manage models → Prepare & serve, a user can prepare supported downloaded/imported GGUFs, start a separate managed API, switch it between prepared profiles when idle, and save its connection for chat and Serving. Existing independently started APIs and other model services remain separate. New managed profiles are text-only and start unloaded.

Scope

Scope proposal: #3346; maintainer agreement remains pending, so this stays a draft. Native iPhone client: #3348. The client requires this Mac support at runtime. Defaults remain unchanged until the corresponding pairing or management option is enabled. No fork-specific C++/GPU backend source is changed.

Implementation

  • Pairing uses a narrow TLS bridge, pinned certificates, expiring one-use invitations and revocable token hashes. Shared chats inherit the Mac's model/workspace/permissions. Stable IDs, revisions, tombstones and turn-bound callbacks protect history; first-enable migration waits for an in-progress response to finish. Shared projections exclude provider credentials, raw runtime frames and tool arguments.
  • Desktop API file management needs a separate destination opt-in and API key. Terminal servers use configurable per-connection SSH host/alias, optional user/port and source folder, with system keys/agent and verified host keys. No fixed login or password is stored. Pinned downloads and inspected GGUF references use a private library with durable ownership and cancellation.
  • The new Mac-only SSH lifecycle packages a content-hashed source bundle and verifies cached files before use. Preparation uses an existing NVIDIA engine/Python environment, isolated settings/data and copied or reflinked inputs. Closed engine-option handling, canonical private asset paths, dependency identity checks and discarded external hooks/environment prevent reuse from modifying original profiles or weights. Pinned tokenizer/preparation tools may be acquired; engines and Python packages are not installed or updated.
  • A helper-owned lazy API has a separate key/port. Switching retains that endpoint/key and uses a private atomic idle claim plus source/config/model/owner/instance checks. Busy/queued work refuses switching; failed startup attempts rollback. Durable intent recovers a completed start after a worker crash. Cleanup can retire only a verified exited owned child, never a live or unknown process.
  • Connection receipts create/update one separate managed connection and refuse to overwrite user edits. Keys remain on the host/server. Loading checks selected-GPU free memory and never unloads another service to make room. Lifecycle routes are limited to the controlling Mac's own browser origin and excluded from phone, inference-sharing and tunnel surfaces.
  • Existing Serving → Destination Load/Unload controls apply only to that API's configured model. Unknown admission state stays read-only. Browser state aborts pending requests and polling when the target changes or the panel closes. Normal desktop builds stage the helpers, source archive and pairing resources.

Validation

Current upstream integration 50426b0b62 merges cbfd5b926b (Strata 0.2.1 / Control 0.1.46.2). Conflict resolutions keep the upstream task board and model checks alongside shared-chat migration, turn identity and management idle guards. Phone-started chats now appear on the task board and use the shared Stop path. Remote reuse applies upstream user engine options and MTP-off before canonical private path copying, then discards raw overrides. The new requirements file is staged through an exact filename allowance.

On this exact integrated public commit: 35/35 Node integration checks, 88/88 Python file/lifecycle/idle checks, type checking and normal desktop production UI/resource staging passed, without skips. The 424-file source archive matches the full fork byte-for-byte (SHA-256 44f81e3f3a5219e90a3e016738f24b58e697830feab9815a9f5f706976f54d35). Public-source review found no remaining P1/P2 findings. The corresponding merged full fork also passed 111/111 companion/host checks, 63/63 remote host/browser checks, 98/98 upstream board/native/settings/update checks, both isolated real-TLS iOS simulator workflows, and 38 iOS unit tests with one optional live-Mac TLS skip. Groups overlap; these are not a cumulative total. Core Python coverage had 87 pass, three platform skips and two previously observed macOS fake-NVIDIA fixture failures. Additional fake-NVIDIA setup cases pass with Linux explicitly mocked. Full native production inference remains untested.

Commands for the current integrated public checks (from the repo root; Node/Python are the installed app's bundled runtimes, and the UI build uses external Homebrew Node 26):

cd apps/host
/Applications/Strata.app/Contents/Resources/node/node --test tests/remote-lifecycle.test.mjs tests/conversation-migration.test.mjs tests/board.test.mjs
npm run typecheck
cd ../..
/Applications/Strata.app/Contents/Resources/control/python/bin/python3 -B -m unittest tests.terminal.test_remote_model_manager tests.terminal.test_remote_model_lifecycle tests.terminal.test_runtime_idle -q
PATH=/opt/homebrew/bin:/usr/bin:/bin npm --prefix apps/desktop run build:ui

The matching full fork was activated locally using the verified official 0.2.1 shell/Metal 0.1.46 components and complete merged Control sources over a verified 0.1.46.2 runtime. Installed resource hashes, recursive signatures, existing histories, pairings and connections passed after launch. This local evidence does not claim fresh Tauri distribution packaging, native inference or physical-phone interaction acceptance of this split revision. Private carrier scripts and local activation material remain excluded.

Earlier lifecycle increment: 5754995db4. Its 21 public source/test/doc blobs match full-fork 1f380a18; private carrier scripts and activation evidence are excluded. All 400 bundled source files match, and the normal production build produces source archive SHA-256 7ad071052fd70f748a6f0b53fe2a582f6e312d24968cab0bd2025d92a86badad.

On that exact public commit:

  • 14/14 lifecycle Node/backend/bootstrap checks passed.
  • 2/2 production React browser workflows passed, covering preparation/cancel/retry, start/connection/switch reviews, disk/expiry/busy/unknown gates, target changes and polling cleanup.
  • 84/84 focused Python checks passed: 37 file-management, 32 lifecycle, 15 runtime-idle. Real disposable processes exercise prepare/start/switch, stable endpoint/key, failed first-start retry, crash-before-publish recovery, receipts and zero generation.
  • Type checking, normal desktop resource staging and production UI build passed; Vite's existing chunk-size warning remains. Worktree dependencies were provided from the existing lock-matched install and the temporary link was removed.

The matching full fork also passed 91/91 focused host/bridge checks and the existing Serving browser workflow. Independent final helper/runtime, UI, packaging and publication reviews found zero remaining P1/P2 issues. Core runtime/readiness/drain coverage ran 59 tests: 56 passed, 3 platform skips. A broader model/no-acquisition/identity/isolation run had 30 pass, 2 fail; both macOS test_no_acquisition setup-selection failures reproduced on pre-increment a2daa747 and are not counted as passing.

Real strict-key SSH snapshots and preparation previews passed on two existing Linux NVIDIA servers using their complete two-shard imported GGUFs. No large copies, production start/switch/load/unload or inference were performed. The full fork's local Mac activation retained all six complete chat histories, both paired devices and all saved connections; 162 installed resource hashes and recursive signatures passed. This is bounded local evidence, not native inference or distribution acceptance of this split revision.

Earlier companion/pairing, shared-history and Thinking simulator/device validation remains documented in apps/desktop/PAIRING.md and the client PR. This increment does not change the iOS source or claim new physical-phone acceptance.

Limits

The GUI SSH preparation workflow currently supports recognized complete Strata GGUFs on Linux NVIDIA servers, with a working existing engine and Python 3.10+/Jinja2/NumPy environment. New profiles are text-only. Imports reference files already on the destination. Password prompts, Windows SSH servers and arbitrary model URL imports are unsupported. Existing external APIs cannot be adopted or switched by this workflow. Startup remains lazy, and actual engine/model compatibility must be established when loaded. Full host suite, large transfers/preparation, production native inference, fresh Tauri installers, Developer ID distribution signing and notarization were not run for this increment.

Setup and trust boundaries: apps/host/REMOTE-MODELS.md, apps/desktop/PAIRING.md.


🔄 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/3347 **Author:** [@jorge123255](https://github.com/jorge123255) **Created:** 10/20/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `pr/mac-iphone-support` --- ### 📝 Commits (6) - [`818ecf4`](https://github.com/Niko1221/Strata/commit/818ecf4c0896009a8a4420f5bd89675ff68bcd58) [GUI] Add opt-in Mac support for paired iPhone conversations - [`ed35bd5`](https://github.com/Niko1221/Strata/commit/ed35bd50415f93f4e04873f6a85cdf0a57e12e8a) [GUI] Add remote model downloads and GGUF imports - [`5aeb869`](https://github.com/Niko1221/Strata/commit/5aeb869a56d8697e4fecfd711cd26b01789fb3a1) [GUI] Manage terminal server model files over configurable SSH - [`a2daa74`](https://github.com/Niko1221/Strata/commit/a2daa7479f6a544a96bcd2b785b6426445dff773) Add reviewed current-model Serving controls for saved Terminal APIs - [`5754995`](https://github.com/Niko1221/Strata/commit/5754995db4fbed175656ea397d9c81eba121054e) [GUI] Prepare and switch models on SSH servers - [`50426b0`](https://github.com/Niko1221/Strata/commit/50426b0b6269bca82b9b6efc2fe4431d5de02168) [GUI] Merge upstream 0.2.1 into Mac companion support ### 📊 Changes **77 files changed** (+10701 additions, -74 deletions) <details> <summary>View changed files</summary> 📝 `.gitignore` (+4 -0) ➕ `apps/companion-bridge/README.md` (+104 -0) ➕ `apps/companion-bridge/bridge.mjs` (+843 -0) ➕ `apps/companion-bridge/index.mjs` (+42 -0) ➕ `apps/companion-bridge/package.json` (+7 -0) ➕ `apps/companion-bridge/qr.swift` (+16 -0) ➕ `apps/companion-bridge/test/bridge.test.mjs` (+349 -0) ➕ `apps/companion-bridge/test/conversations.test.mjs` (+223 -0) ➕ `apps/companion-bridge/test/model-management.test.mjs` (+210 -0) ➕ `apps/desktop/PAIRING.md` (+25 -0) 📝 `apps/desktop/package.json` (+2 -1) ➕ `apps/desktop/scripts/stage-companion.mjs` (+21 -0) ➕ `apps/desktop/scripts/stage-remote-lifecycle.mjs` (+31 -0) ➕ `apps/desktop/src-tauri/resources/companion-bridge/.gitignore` (+2 -0) 📝 `apps/desktop/src-tauri/tauri.conf.json` (+4 -0) ➕ `apps/host/REMOTE-MODELS.md` (+63 -0) ➕ `apps/host/python/remote_model_lifecycle.py` (+925 -0) ➕ `apps/host/python/remote_model_manager.py` (+669 -0) 📝 `apps/host/server/agent/agent-bridge.mjs` (+18 -3) ➕ `apps/host/server/companion-routes.mjs` (+47 -0) _...and 57 more files_ </details> ### 📄 Description ## Problem and result Mac conversations cannot be continued securely from a native iPhone client, and saved model APIs do not provide a complete remote model workflow. This adds opt-in iPhone pairing, shared history/session continuation, Thinking and ordered progress, browser/tool activity, approvals and Stop. Saved Strata connections gain remote downloads/imports, current-model Serving controls, and **Prepare & serve** for SSH servers. From **Settings → Models → Manage models → Prepare & serve**, a user can prepare supported downloaded/imported GGUFs, start a separate managed API, switch it between prepared profiles when idle, and save its connection for chat and Serving. Existing independently started APIs and other model services remain separate. New managed profiles are text-only and start unloaded. ## Scope Scope proposal: #3346; maintainer agreement remains pending, so this stays a draft. Native iPhone client: #3348. The client requires this Mac support at runtime. Defaults remain unchanged until the corresponding pairing or management option is enabled. No fork-specific C++/GPU backend source is changed. ## Implementation - Pairing uses a narrow TLS bridge, pinned certificates, expiring one-use invitations and revocable token hashes. Shared chats inherit the Mac's model/workspace/permissions. Stable IDs, revisions, tombstones and turn-bound callbacks protect history; first-enable migration waits for an in-progress response to finish. Shared projections exclude provider credentials, raw runtime frames and tool arguments. - Desktop API file management needs a separate destination opt-in and API key. Terminal servers use configurable per-connection SSH host/alias, optional user/port and source folder, with system keys/agent and verified host keys. No fixed login or password is stored. Pinned downloads and inspected GGUF references use a private library with durable ownership and cancellation. - The new Mac-only SSH lifecycle packages a content-hashed source bundle and verifies cached files before use. Preparation uses an existing NVIDIA engine/Python environment, isolated settings/data and copied or reflinked inputs. Closed engine-option handling, canonical private asset paths, dependency identity checks and discarded external hooks/environment prevent reuse from modifying original profiles or weights. Pinned tokenizer/preparation tools may be acquired; engines and Python packages are not installed or updated. - A helper-owned lazy API has a separate key/port. Switching retains that endpoint/key and uses a private atomic idle claim plus source/config/model/owner/instance checks. Busy/queued work refuses switching; failed startup attempts rollback. Durable intent recovers a completed start after a worker crash. Cleanup can retire only a verified exited owned child, never a live or unknown process. - Connection receipts create/update one separate managed connection and refuse to overwrite user edits. Keys remain on the host/server. Loading checks selected-GPU free memory and never unloads another service to make room. Lifecycle routes are limited to the controlling Mac's own browser origin and excluded from phone, inference-sharing and tunnel surfaces. - Existing **Serving → Destination** Load/Unload controls apply only to that API's configured model. Unknown admission state stays read-only. Browser state aborts pending requests and polling when the target changes or the panel closes. Normal desktop builds stage the helpers, source archive and pairing resources. ## Validation Current upstream integration **50426b0b6269bca82b9b6efc2fe4431d5de02168** merges **cbfd5b926b794b356195d3cb600191b0c3567540** (Strata 0.2.1 / Control 0.1.46.2). Conflict resolutions keep the upstream task board and model checks alongside shared-chat migration, turn identity and management idle guards. Phone-started chats now appear on the task board and use the shared Stop path. Remote reuse applies upstream user engine options and MTP-off before canonical private path copying, then discards raw overrides. The new requirements file is staged through an exact filename allowance. On this exact integrated public commit: **35/35** Node integration checks, **88/88** Python file/lifecycle/idle checks, type checking and normal desktop production UI/resource staging passed, without skips. The **424-file** source archive matches the full fork byte-for-byte (SHA-256 `44f81e3f3a5219e90a3e016738f24b58e697830feab9815a9f5f706976f54d35`). Public-source review found no remaining P1/P2 findings. The corresponding merged full fork also passed **111/111** companion/host checks, **63/63** remote host/browser checks, **98/98** upstream board/native/settings/update checks, both isolated real-TLS iOS simulator workflows, and 38 iOS unit tests with one optional live-Mac TLS skip. Groups overlap; these are not a cumulative total. Core Python coverage had 87 pass, three platform skips and two previously observed macOS fake-NVIDIA fixture failures. Additional fake-NVIDIA setup cases pass with Linux explicitly mocked. Full native production inference remains untested. Commands for the current integrated public checks (from the repo root; Node/Python are the installed app's bundled runtimes, and the UI build uses external Homebrew Node 26): ```sh cd apps/host /Applications/Strata.app/Contents/Resources/node/node --test tests/remote-lifecycle.test.mjs tests/conversation-migration.test.mjs tests/board.test.mjs npm run typecheck cd ../.. /Applications/Strata.app/Contents/Resources/control/python/bin/python3 -B -m unittest tests.terminal.test_remote_model_manager tests.terminal.test_remote_model_lifecycle tests.terminal.test_runtime_idle -q PATH=/opt/homebrew/bin:/usr/bin:/bin npm --prefix apps/desktop run build:ui ``` The matching full fork was activated locally using the verified official 0.2.1 shell/Metal 0.1.46 components and complete merged Control sources over a verified 0.1.46.2 runtime. Installed resource hashes, recursive signatures, existing histories, pairings and connections passed after launch. This local evidence does not claim fresh Tauri distribution packaging, native inference or physical-phone interaction acceptance of this split revision. Private carrier scripts and local activation material remain excluded. Earlier lifecycle increment: **5754995db4fbed175656ea397d9c81eba121054e**. Its 21 public source/test/doc blobs match full-fork **1f380a18**; private carrier scripts and activation evidence are excluded. All 400 bundled source files match, and the normal production build produces source archive SHA-256 `7ad071052fd70f748a6f0b53fe2a582f6e312d24968cab0bd2025d92a86badad`. On that exact public commit: - **14/14** lifecycle Node/backend/bootstrap checks passed. - **2/2** production React browser workflows passed, covering preparation/cancel/retry, start/connection/switch reviews, disk/expiry/busy/unknown gates, target changes and polling cleanup. - **84/84** focused Python checks passed: 37 file-management, 32 lifecycle, 15 runtime-idle. Real disposable processes exercise prepare/start/switch, stable endpoint/key, failed first-start retry, crash-before-publish recovery, receipts and zero generation. - Type checking, normal desktop resource staging and production UI build passed; Vite's existing chunk-size warning remains. Worktree dependencies were provided from the existing lock-matched install and the temporary link was removed. The matching full fork also passed **91/91** focused host/bridge checks and the existing Serving browser workflow. Independent final helper/runtime, UI, packaging and publication reviews found zero remaining P1/P2 issues. Core runtime/readiness/drain coverage ran **59 tests: 56 passed, 3 platform skips**. A broader model/no-acquisition/identity/isolation run had **30 pass, 2 fail**; both macOS `test_no_acquisition` setup-selection failures reproduced on pre-increment **a2daa747** and are not counted as passing. Real strict-key SSH snapshots and preparation previews passed on two existing Linux NVIDIA servers using their complete two-shard imported GGUFs. No large copies, production start/switch/load/unload or inference were performed. The full fork's local Mac activation retained all six complete chat histories, both paired devices and all saved connections; 162 installed resource hashes and recursive signatures passed. This is bounded local evidence, not native inference or distribution acceptance of this split revision. Earlier companion/pairing, shared-history and Thinking simulator/device validation remains documented in `apps/desktop/PAIRING.md` and the client PR. This increment does not change the iOS source or claim new physical-phone acceptance. ## Limits The GUI SSH preparation workflow currently supports recognized complete Strata GGUFs on Linux NVIDIA servers, with a working existing engine and Python 3.10+/Jinja2/NumPy environment. New profiles are text-only. Imports reference files already on the destination. Password prompts, Windows SSH servers and arbitrary model URL imports are unsupported. Existing external APIs cannot be adopted or switched by this workflow. Startup remains lazy, and actual engine/model compatibility must be established when loaded. Full host suite, large transfers/preparation, production native inference, fresh Tauri installers, Developer ID distribution signing and notarization were not run for this increment. Setup and trust boundaries: `apps/host/REMOTE-MODELS.md`, `apps/desktop/PAIRING.md`. --- <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:37 +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#4582
No description provided.