Skip to content

[Other] Follow this computer's proxy, and keep state intact across a crash - #4435

Open
xvcezrqpbxtpzblrt wants to merge 3 commits into
Niko1221:mainfrom
xvcezrqpbxtpzblrt:host/network-durability-027
Open

xvcezrqpbxtpzblrt wants to merge 3 commits into
Niko1221:mainfrom
xvcezrqpbxtpzblrt:host/network-durability-027

Conversation

@xvcezrqpbxtpzblrt

Copy link
Copy Markdown
Contributor

Two problems, both in the host's own plumbing

1. Every outside request went straight out. Node's fetch ignores 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.mjs answers 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 reads HTTPS_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 .bak of 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=1 turns 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

  • macOS and Linux read the environment only (no scutil); a PAC script is not executed - the setting says so.
  • The Python Control process has its own downloader and does not read this file; strata update from the Terminal still uses its own proxy handling.
  • Logs written by a running engine or the desktop shell cannot be rotated while their handle is open.
  • The keep-awake behaviour is tested with a fake child process, not by a machine actually going to sleep.

@github-actions github-actions Bot added the needs-format Title or template does not follow CONTRIBUTING.md yet label Oct 28, 2026
@github-actions

Copy link
Copy Markdown

Thanks for the pull request. To keep the tracker readable, every item needs an area prefix in the title and the parts of the pull request template filled in. This one is missing:

  • Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other], then a short description. Example: "[Engine] fix decode stop on long prompts".
  • Fill in "Problem and result": what triggered the change, and how it behaves before and after.

Edit the pull request (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment /reopen.

Details: CONTRIBUTING.md

@xvcezrqpbxtpzblrt xvcezrqpbxtpzblrt changed the title [Host] Follow this computer's proxy, and keep state intact across a crash [Other] Follow this computer's proxy, and keep state intact across a crash Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-format Title or template does not follow CONTRIBUTING.md yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant