mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #4435] [CLOSED] [Other] Follow this computer's proxy, and keep state intact across a crash #5046
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#5046
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/4435
Author: @xvcezrqpbxtpzblrt
Created: 10/28/2026
Status: ❌ Closed
Base:
main← Head:host/network-durability-027📝 Commits (3)
8769346[Host] Use this computer's proxy, and keep state intact across a crash18b406ehost: the network settings screen that writes the choice0801f56host: the tests that pin the proxy variables and the engine download📊 Changes
31 files changed (+2219 additions, -56 deletions)
View changed files
📝
apps/host/server/agent/harness-runtime.mjs(+10 -1)➕
apps/host/server/atomic-file.mjs(+174 -0)📝
apps/host/server/chat-uploads.mjs(+5 -2)📝
apps/host/server/cloudflared-install.mjs(+4 -1)📝
apps/host/server/control-runtime.mjs(+4 -1)➕
apps/host/server/disk-space.mjs(+56 -0)📝
apps/host/server/engine-install.mjs(+10 -2)📝
apps/host/server/image-models.mjs(+7 -6)📝
apps/host/server/index.mjs(+116 -6)➕
apps/host/server/keep-awake.mjs(+207 -0)➕
apps/host/server/log-files.mjs(+76 -0)📝
apps/host/server/model-providers.mjs(+2 -1)📝
apps/host/server/native-autotune.mjs(+3 -2)📝
apps/host/server/native-control.mjs(+26 -15)➕
apps/host/server/net.mjs(+613 -0)📝
apps/host/server/skill-files.mjs(+4 -3)📝
apps/host/server/store.mjs(+6 -5)📝
apps/host/server/updates.mjs(+2 -1)📝
apps/host/server/web-search-ddg.mjs(+2 -1)📝
apps/host/server/web-search-keyed.mjs(+7 -6)...and 11 more files
📄 Description
## Two problems, both in the host's own plumbing
1. Every outside request went straight out. Node's
fetchignores the proxy a Windows PC is set up to use, so on a machine behind Clash, a company proxy or an antivirus that scans HTTPS, downloads, update checks, model API calls and web search either failed or left without the proxy the person expected.server/net.mjsanswers one question - through which door does this request leave? - and then uses it: this computer's own addresses never go through a proxy; the saved choice (follow the system / direct / one address) comes next; following the system readsHTTPS_PROXY/NO_PROXY, then the Windows registry, then goes direct. The registry is read once per 30 s. A proxy that is set but does not answer is an error naming the proxy, never a quiet direct connection. Engine and connector downloads, model providers, the update check and web search all go through it.2. A power cut could truncate the small files the next start reads (job list, run configuration, workspaces, image models, upload index, skills, settings). They are now written to a temporary file, flushed, renamed, and a
.bakof the last good one is kept; a truncated file is never copied over that backup.Also in this branch, because they are the same layer: the host keeps the computer awake while a run, install or download is in progress (Windows
SetThreadExecutionState,caffeinate,systemd-inhibit;STRATA_NO_KEEP_AWAKE=1turns it off); a download refuses to start below 2 GiB free (and below the size of the model being installed); logs rotate at 64 MiB.Validation
node --test tests/net.test.mjs tests/offline-start.test.mjs tests/packaged-control.test.mjs tests/atomic-file.test.mjs tests/keep-awake.test.mjs tests/disk-space.test.mjs tests/log-files.test.mjs tests/durability.test.mjs→ 58 pass, 0 fail (this branch runs 27 of those files; the rest cover the same modules).On the machine used: the system proxy (
127.0.0.1:10090) is picked up, a real request through it answers,192.168.*/10.*/172.16-31.*are never sent to a proxy, and a truncated run configuration is reported with its line instead of starting an engine that dies on it.Limits
scutil); a PAC script is not executed - the setting says so.strata updatefrom the Terminal still uses its own proxy handling.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.