Skip to content

Move the remote gateway onto undici and one Hono route table - #949

Open
thesiti92 wants to merge 2 commits into
remote/9-source-windowsfrom
remote/10-gateway-transport
Open

thesiti92 wants to merge 2 commits into
remote/9-source-windowsfrom
remote/10-gateway-transport

Conversation

@thesiti92

@thesiti92 thesiti92 commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #942. Cleans up the gateway's networking at the top of the stack, so no lower PR needs a rebase.

Read it commit by commit:

  1. One reconnect loop. The remote streams and the laptop stream share it. No change in behavior.
  2. One route table on Hono. It replaces the three lists of regular expressions for remote routes. No change in behavior.
  3. undici for remote requests. Each request sets its own timeouts, so the hand-written timers go. Long-lived streams have no idle limit. The one retry of a closed, kept-alive connection from Run the review server headless and route remote reviews through a gateway #935 stays.

Node's built-in fetch and Electron's net were not used. fetch cuts streams that are idle for five minutes. net allows only six connections for each host and does not run in plain Node.

Tests: the gateway and relay suites pass. Lint and typecheck are clean.

@thesiti92
thesiti92 force-pushed the remote/10-gateway-transport branch from da41167 to 39bfb47 Compare October 5, 2026 23:27
@thesiti92
thesiti92 force-pushed the remote/10-gateway-transport branch from 39bfb47 to a611e9e Compare October 6, 2026 03:46
@thesiti92
thesiti92 added this pull request to stack #943 October 6, 2026 13:09
@thesiti92
thesiti92 force-pushed the remote/10-gateway-transport branch 2 times, most recently from 09ab700 to cff15cc Compare October 6, 2026 16:06
@thesiti92
thesiti92 force-pushed the remote/10-gateway-transport branch from cff15cc to 6bd9583 Compare October 6, 2026 16:16
Agent-Session: 459ae7ec-7302-42c5-b473-4e315a7e4e19
Agent-Session: 96eed70a-4af6-4249-a91d-8064746610b6
Agent-Session: a5134983-fbca-42d2-ac6c-fe14cf3ce20e
Agent-Session: 01a0fd55-7d25-70c3-bf87-46cdb881d91e
Agent-Session: 9c8a2d13-4198-4d4b-bf1d-4de6fccd0f19
Agent-Session: 99df4638-b570-4eeb-b115-0311294ee04d
Agent-Session: c155cff4-ccd6-416d-a2e3-f65113f2d163
Agent-Session: edffabb0-c704-439a-bf69-7b366f2f332d
Agent-Session: 13cd2035-0029-45cb-a2c9-65f0c01b6460
Agent-Session: e9b9e23e-de55-4291-9391-cd234f736397
Agent-Session: 5368a6f5-df0c-4411-8eec-4b9cccbfbef0
Agent-Session: f086ac47-f054-41fb-8279-be4df7aa2dee
Agent-Session: 7633c50b-998d-4b1e-8ca2-ffb350a26066
Agent-Session: 3a3376c5-3f72-46df-930c-a66d5c3bcce5
Each request sets its own first-byte and idle timeouts, so the hand-written
timers go. Streams have no idle limit. Each host keeps its own pool.

undici reports a closed connection as UND_ERR_SOCKET. Restart detection and
the one retry of a closed connection now check for it. As before, a request
is sent again only when it has no body or its socket had already served a
response, so a request the host may have run is not repeated.

Agent-Session: 459ae7ec-7302-42c5-b473-4e315a7e4e19
Agent-Session: 96eed70a-4af6-4249-a91d-8064746610b6
Agent-Session: a5134983-fbca-42d2-ac6c-fe14cf3ce20e
Agent-Session: 01a0fd55-7d25-70c3-bf87-46cdb881d91e
Agent-Session: 9c8a2d13-4198-4d4b-bf1d-4de6fccd0f19
Agent-Session: 99df4638-b570-4eeb-b115-0311294ee04d
Agent-Session: c155cff4-ccd6-416d-a2e3-f65113f2d163
Agent-Session: edffabb0-c704-439a-bf69-7b366f2f332d
Agent-Session: 13cd2035-0029-45cb-a2c9-65f0c01b6460
Agent-Session: e9b9e23e-de55-4291-9391-cd234f736397
Agent-Session: 5368a6f5-df0c-4411-8eec-4b9cccbfbef0
Agent-Session: f086ac47-f054-41fb-8279-be4df7aa2dee
Agent-Session: 7633c50b-998d-4b1e-8ca2-ffb350a26066
Agent-Session: 3a3376c5-3f72-46df-930c-a66d5c3bcce5
@thesiti92
thesiti92 force-pushed the remote/10-gateway-transport branch from 6bd9583 to f036686 Compare October 6, 2026 17:10

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant