harness-multitool

0027 — Windows talk to the daemon over a local socket

Why

Windows and the daemon got in each other's way for two reasons.

  1. HTTP and polling. A window sent its operations as HTTP requests and fetched its events with long polls: one held request per tab and one per window, and a new request after every event.

    While the daemon served from a fixed pool of threads, held polls queued every other operation for seconds.

  2. The contract was the binary. A window worked with a daemon only if both came from the same file: same size, same modification time.

    After any rebuild, a window that found a daemon busy with another window's run went on without it, Local, without the daemon's modes, agent tools or reload, and a reload waited until every other window's run had ended.

Decision

Transport

The transport is the socket2 crate on every OS, so there is one code path.

Compatibility

Failure and reconnection

Changeover

The old HTTP window API goes in one step: windows still open on older builds have to be reopened once. The owner warned the agent of the other project that shares this daemon first.

This page's source