A connector account moves to a machine, or connects there directly; managed grants move by delegation.
GitHub and Slack reach a box by polling the relay; subscriptions register with the cloud first.
Both relay test modules pinned SLACK_API_URL at http://127.0.0.1:9/ on the
stated assumption that lookups "fail instantly at a dead loopback port". That
holds on POSIX, where a refused connection returns in microseconds. It does
not hold on Windows, where refusing a loopback connect takes about 2.0s:
socket.create_connection(("127.0.0.1", 9)) median 2.033s over 5 trials
urllib.urlopen("http://127.0.0.1:9/...") median 2.032s over 3 trials
RelayHub._run only increments _dispatched after awaiting the frame handler,
and _dispatch_slack_event awaits both _display_name and _channel_name, so a
single frame cost roughly 4s against the 2.0s wait_dispatched budget. The
result was a deterministic "only 0 frames dispatched" across five tests,
reproduced identically on three consecutive runs.
Stub _slack_get, the single chokepoint both lookups go through, so the tests
are hermetic by construction rather than by depending on how fast the host OS
refuses a connection. SLACK_API_URL still points at the dead port as a
backstop so an unstubbed path can never reach slack.com.
The stub goes on the class, so the two tests that exercise real name mapping
keep working: they set _slack_get on the instance, which shadows it.
On Windows this takes the two modules from 5 failed / 29 passed in 21.2s to
34 passed in 10.2s. Linux is unaffected: 889 passed, 1 skipped.
Imported from andrewyng/aisuite@1b4bbf303e
(contents of its platform/ directory, hoisted to the repo root).
Development history prior to this commit lives in that repository.
Co-authored-by: Devika <devikaverma11@gmail.com>