Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

PeerLinks.test.ts

582 lines23.0 KB

1import { NodeHttpServer } from "@effect/platform-node";
2import { type ExecutionEnvironmentDescriptor, OrchestratorMcpFailure } from "@t3tools/contracts";
3import { expect, it } from "@effect/vitest";
4import * as Context from "effect/Context";
5import * as Deferred from "effect/Deferred";
6import * as Duration from "effect/Duration";
7import * as Effect from "effect/Effect";
8import * as Fiber from "effect/Fiber";
9import * as Layer from "effect/Layer";
10import * as Option from "effect/Option";
11import * as Ref from "effect/Ref";
12import * as Schema from "effect/Schema";
13import * as HttpRouter from "effect/http/HttpRouter";
14import * as SqlClient from "effect/sql/SqlClient";
15import * as TestClock from "effect/testing/TestClock";
16import { Tool, Toolkit } from "effect/ai";
17import {
18 FetchHttpClient,
19 HttpClient,
20 HttpServer,
21 HttpServerRequest,
22 HttpServerResponse,
23} from "effect/http";
24​
25import * as ServerSecretStore from "../auth/ServerSecretStore.ts";
26import * as McpHttpServer from "../mcp/McpHttpServer.ts";
27import * as McpInvocationContext from "../mcp/McpInvocationContext.ts";
28import * as McpToolAccess from "../mcp/McpToolAccess.ts";
29import * as PeerLinks from "./PeerLinks.ts";
30import * as ServerSettings from "../serverSettings.ts";
31import {
32 descriptorOf,
33 layerLinkingEnvironment,
34 servePeer,
35 type ServedPeer,
36} from "./PeerLinks.testkit.ts";
37import * as PeerMcpClient from "./PeerMcpClient.ts";
38​
39/** What B's probe saw: the calling client and the modes it may start work with. */
40const Probe = Schema.Struct({ caller: Schema.String, modes: Schema.String });
41​
42const ProbeToolkit = Toolkit.make(
43 Tool.make("probe", {
44 description: "Reports the calling client and the modes it may start work with.",
45 success: Probe,
46 failure: OrchestratorMcpFailure,
47 failureMode: "return",
48 dependencies: [McpInvocationContext.McpInvocationContext],
49 }),
50 Tool.make("refuse", {
51 description: "Always refuses.",
52 success: Probe,
53 failure: OrchestratorMcpFailure,
54 failureMode: "return",
55 }),
56);
57​
58const probeHandlers = McpToolAccess.toLayer(ProbeToolkit, {
59 probe: McpToolAccess.reads(() =>
60 McpInvocationContext.McpInvocationContext.pipe(
61 Effect.map((scope) => {
62 const modes = McpInvocationContext.clientModeCeiling(scope.client);
63 return {
64 caller: scope.client?.label ?? "none",
65 modes: `${modes.runtimeMode}/${modes.interactionMode}`,
66 };
67 }),
68 ),
69 ),
70 refuse: McpToolAccess.reads(() =>
71 Effect.fail(
72 new OrchestratorMcpFailure({ code: "thread_not_found", message: "No such thread." }),
73 ),
74 ),
75});
76​
77const serveB = (descriptor: ExecutionEnvironmentDescriptor) =>
78 servePeer(descriptor, McpHttpServer.toolkitRegistration(ProbeToolkit, probeHandlers));
79​
80/** Environment A, which links to B. */
81const makeA = (
82 descriptor: ExecutionEnvironmentDescriptor,
83 secrets?: typeof ServerSecretStore.layer,
84) =>
85 layerLinkingEnvironment(descriptor, secrets).pipe(
86 Layer.build,
87 Effect.map((context) => ({
88 links: Context.get(context, PeerLinks.PeerLinks),
89 peer: Context.get(context, PeerMcpClient.PeerMcpClient),
90 sql: Context.get(context, SqlClient.SqlClient),
91 settings: Context.get(context, ServerSettings.ServerSettingsService),
92 })),
93 );
94​
95const laptop = descriptorOf("environment-laptop", "Laptop");
96const box = descriptorOf("environment-box", "Box");
97const probe = (
98 a: Effect.Success<ReturnType<typeof makeA>>,
99 limits: PeerMcpClient.PeerCallLimits = { runtimeMode: "full-access", interactionMode: "default" },
100 tool = "probe",
101) =>
102 a.peer.call({
103 environmentId: box.environmentId,
104 tool,
105 arguments: {},
106 limits,
107 success: Probe,
108 });
109​
110const linkedSessions = (b: ServedPeer) => b.linkedSessions;
111​
112/** Another environment on a socket of its own, answering as `descriptor`. */
113const serveApart = (descriptor: ExecutionEnvironmentDescriptor) =>
114 Layer.build(Layer.fresh(NodeHttpServer.layerTest)).pipe(
115 Effect.flatMap((server) => serveB(descriptor).pipe(Effect.provideContext(server))),
116 );
117​
118it.effect("links with a pairing code, and the peer holds its agents to the limits they carry", () =>
119 Effect.scoped(
120 Effect.gen(function* () {
121 const b = yield* serveB(box);
122 const a = yield* makeA(laptop);
123​
124 const refused = yield* a.links
125 .link({ url: b.url, pairingCode: "not-a-code", access: "auto" })
126 .pipe(Effect.flip);
127 expect(refused.reason).toBe("pairing_rejected");
128 expect(yield* linkedSessions(b)).toEqual([]);
129​
130 const pairing = yield* b.auth.issuePairingCredential();
131 const linked = yield* a.links.link({
132 url: b.url,
133 pairingCode: pairing.credential,
134 access: "auto",
135 });
136 expect(linked).toMatchObject({
137 environmentId: box.environmentId,
138 label: "Box",
139 urls: [b.url],
140 access: "auto",
141 });
142 // B lists the link under A's name, where it can be revoked.
143 expect((yield* linkedSessions(b)).map((session) => session.client.label)).toEqual([
144 "T3 Code · Laptop",
145 ]);
146 expect(
147 (yield* a.links.list).map(({ environmentId, status }) => [environmentId, status]),
148 ).toEqual([[box.environmentId, "reachable"]]);
149​
150 // The caller's limits narrow the link's access; they never widen it.
151 expect(
152 yield* probe(a, { runtimeMode: "approval-required", interactionMode: "plan" }),
153 ).toEqual({ caller: "T3 Code · Laptop", modes: "approval-required/plan" });
154 expect(yield* probe(a)).toEqual({ caller: "T3 Code · Laptop", modes: "auto/default" });
155​
156 // A refusal keeps the peer's reason.
157 const notFound = yield* probe(a, undefined, "refuse").pipe(Effect.flip);
158 expect(notFound).toMatchObject({ code: "thread_not_found", message: "No such thread." });
159 }),
160 ).pipe(Effect.provide(NodeHttpServer.layerTest)),
161);
162​
163it.effect(
164 "each machine's Linked environments beta gates links, and a link waits while it is off",
165 () =>
166 Effect.scoped(
167 Effect.gen(function* () {
168 const b = yield* serveB(box);
169 const a = yield* makeA(laptop);
170 const pairing = yield* b.auth.issuePairingCredential();
171 const link = a.links.link({ url: b.url, pairingCode: pairing.credential, access: "auto" });
172​
173 yield* a.settings.updateSettings({ linkedEnvironmentsEnabled: false });
174 expect(yield* link.pipe(Effect.flip)).toMatchObject({
175 reason: "disabled",
176 message: PeerLinks.LINKED_ENVIRONMENTS_OFF,
177 });
178 expect(yield* Ref.get(b.bearers)).toEqual([]);
179​
180 yield* a.settings.updateSettings({ linkedEnvironmentsEnabled: true });
181 yield* b.settings.updateSettings({ linkedEnvironmentsEnabled: false });
182 const refusedThere = yield* link.pipe(Effect.flip);
183 expect(refusedThere.reason).toBe("pairing_rejected");
184 expect(refusedThere.message).toContain("Linked environments is off on that machine");
185 expect(yield* linkedSessions(b)).toEqual([]);
186​
187 yield* b.settings.updateSettings({ linkedEnvironmentsEnabled: true });
188 yield* link;
189 yield* b.settings.updateSettings({ linkedEnvironmentsEnabled: false });
190 // Not final, so a task already running there picks up again once it is back on.
191 const waiting = yield* probe(a).pipe(Effect.flip);
192 expect(waiting.code).toBe("orchestration_error");
193 expect(waiting.message).toContain("has Linked environments turned off");
194 yield* b.settings.updateSettings({ linkedEnvironmentsEnabled: true });
195 expect(yield* probe(a)).toEqual({ caller: "T3 Code · Laptop", modes: "auto/default" });
196 }),
197 ).pipe(Effect.provide(NodeHttpServer.layerTest)),
198);
199​
200it.effect("a link whose row cannot be stored keeps none of its token", () =>
201 Effect.scoped(
202 Effect.gen(function* () {
203 const b = yield* serveB(box);
204 const held = yield* Ref.make<ReadonlySet<string>>(new Set());
205 const noted = Layer.effect(
206 ServerSecretStore.ServerSecretStore,
207 Effect.map(ServerSecretStore.make, (store) =>
208 ServerSecretStore.ServerSecretStore.of({
209 ...store,
210 set: (name, value) =>
211 store
212 .set(name, value)
213 .pipe(Effect.andThen(Ref.update(held, (names) => new Set([...names, name])))),
214 remove: (name) =>
215 store
216 .remove(name)
217 .pipe(
218 Effect.andThen(
219 Ref.update(held, (names) => new Set([...names].filter((at) => at !== name))),
220 ),
221 ),
222 }),
223 ),
224 );
225 const a = yield* makeA(laptop, noted);
226 yield* a.sql`
227 CREATE TRIGGER refuse_link BEFORE INSERT ON peer_environment_links
228 BEGIN SELECT RAISE(ABORT, 'database or disk is full'); END
229 `;
230 const pairing = yield* b.auth.issuePairingCredential();
231 const failed = yield* a.links
232 .link({ url: b.url, pairingCode: pairing.credential, access: "auto" })
233 .pipe(Effect.flip);
234 expect(failed.reason).toBe("storage");
235 expect(yield* Ref.get(held)).toEqual(new Set());
236 }),
237 ).pipe(Effect.provide(NodeHttpServer.layerTest)),
238);
239​
240it.effect("two links racing to one peer leave the stored access matching the token", () =>
241 Effect.scoped(
242 Effect.gen(function* () {
243 const b = yield* serveB(box);
244 const a = yield* makeA(laptop);
245 const [first, second] = yield* Effect.all(
246 [b.auth.issuePairingCredential(), b.auth.issuePairingCredential()],
247 { concurrency: 2 },
248 );
249 yield* Effect.all(
250 [
251 a.links.link({ url: b.url, pairingCode: first.credential, access: "read-only" }),
252 a.links.link({ url: b.url, pairingCode: second.credential, access: "full-access" }),
253 ],
254 { concurrency: 2 },
255 );
256 const [stored] = yield* a.links.list;
257 // The token sent is the one issued with the access the row records.
258 const { modes } = yield* probe(a);
259 expect(modes).toBe(
260 stored!.access === "read-only" ? "approval-required/default" : "full-access/default",
261 );
262 }),
263 ).pipe(Effect.provide(NodeHttpServer.layerTest)),
264);
265​
266/** A bare HTTP server on a socket of its own, answering with `handle`. */
267const serveRaw = <E, R>(
268 handle: (
269 request: HttpServerRequest.HttpServerRequest,
270 ) => Effect.Effect<HttpServerResponse.HttpServerResponse, E, R>,
271) =>
272 Layer.build(Layer.fresh(NodeHttpServer.layerTest)).pipe(
273 Effect.flatMap((server) =>
274 Effect.gen(function* () {
275 yield* HttpServer.serve(Effect.flatMap(HttpServerRequest.HttpServerRequest, handle)).pipe(
276 Layer.build,
277 );
278 const address = (yield* HttpServer.HttpServer).address;
279 if (address._tag === "UnixPathAddress") return yield* Effect.die("expected a TCP address");
280 return `http://127.0.0.1:${address.port}`;
281 }).pipe(Effect.provideContext(server)),
282 ),
283 );
284​
285it.effect("never follows a peer's redirect with the pairing code", () =>
286 Effect.scoped(
287 Effect.gen(function* () {
288 const b = yield* serveB(box);
289 const received = yield* Ref.make<ReadonlyArray<string>>([]);
290 const elsewhere = yield* serveRaw((request) =>
291 Ref.update(received, (seen) => [...seen, `${request.method} ${request.url}`]).pipe(
292 Effect.as(HttpServerResponse.empty({ status: 404 })),
293 ),
294 );
295 // Answers as B, then sends every linking request on to another address.
296 const front = yield* serveRaw((request) =>
297 request.url.startsWith("/.well-known/t3/environment")
298 ? HttpClient.get(`${b.url}${request.url}`).pipe(
299 Effect.flatMap((response) => response.text),
300 Effect.map((body) =>
301 HttpServerResponse.text(body, { contentType: "application/json" }),
302 ),
303 Effect.provide(FetchHttpClient.layer),
304 Effect.orDie,
305 )
306 : Effect.succeed(
307 HttpServerResponse.empty({
308 status: 307,
309 headers: { location: `${elsewhere}${request.url}` },
310 }),
311 ),
312 );
313 const a = yield* makeA(laptop);
314 const pairing = yield* b.auth.issuePairingCredential();
315 yield* a.links
316 .link({ url: front, pairingCode: pairing.credential, access: "auto" })
317 .pipe(Effect.flip);
318 expect(yield* Ref.get(received)).toEqual([]);
319 expect(yield* a.links.list).toEqual([]);
320 }),
321 ).pipe(Effect.provide(NodeHttpServer.layerTest)),
322);
323​
324it.effect("never sends a link's token to an address that stops answering as that peer", () =>
325 Effect.scoped(
326 Effect.gen(function* () {
327 const b = yield* serveB(box);
328 const a = yield* makeA(laptop);
329 const pairing = yield* b.auth.issuePairingCredential();
330 yield* a.links.link({ url: b.url, pairingCode: pairing.credential, access: "auto" });
331 yield* probe(a);
332 expect((yield* Ref.get(b.bearers)).length).toBeGreaterThan(0);
333​
334 // The address now answers as another environment, as a reused LAN address would.
335 yield* Ref.set(b.descriptor, descriptorOf("environment-impostor", "Impostor"));
336 yield* Ref.set(b.bearers, []);
337 const failed = yield* probe(a).pipe(Effect.flip);
338 expect(failed.message).toContain("Box did not answer");
339 expect(yield* Ref.get(b.bearers)).toEqual([]);
340 expect((yield* a.links.list).map((link) => link.status)).toEqual(["unreachable"]);
341 }),
342 ).pipe(Effect.provide(NodeHttpServer.layerTest)),
343);
344​
345it.effect("cancelling a descriptor probe aborts its request and leaves later resolves fresh", () =>
346 Effect.scoped(
347 Effect.gen(function* () {
348 const hold = yield* Ref.make(false);
349 const requests = yield* Ref.make(0);
350 const entered = yield* Deferred.make<void>();
351 const interrupted = yield* Deferred.make<void>();
352 const holdDescriptor = HttpRouter.middleware(
353 (httpEffect) =>
354 Effect.gen(function* () {
355 const request = yield* HttpServerRequest.HttpServerRequest;
356 if (request.url.startsWith("/.well-known/t3/environment")) {
357 yield* Ref.update(requests, (count) => count + 1);
358 if (yield* Ref.get(hold)) {
359 return yield* Deferred.succeed(entered, undefined).pipe(
360 Effect.andThen(Effect.never),
361 Effect.onInterrupt(() =>
362 Deferred.succeed(interrupted, undefined).pipe(Effect.asVoid),
363 ),
364 Effect.interruptible,
365 );
366 }
367 }
368 return yield* httpEffect;
369 }),
370 { global: true },
371 );
372 const b = yield* servePeer(
373 box,
374 Layer.merge(McpHttpServer.toolkitRegistration(ProbeToolkit, probeHandlers), holdDescriptor),
375 );
376 const a = yield* makeA(laptop);
377 const pairing = yield* b.auth.issuePairingCredential();
378 yield* a.links.link({ url: b.url, pairingCode: pairing.credential, access: "auto" });
379 yield* Ref.set(b.bearers, []);
380 yield* Ref.set(requests, 0);
381 yield* Ref.set(hold, true);
382​
383 const resolving = yield* a.links.resolve(box.environmentId).pipe(Effect.forkScoped);
384 yield* Deferred.await(entered);
385 yield* Fiber.interrupt(resolving);
386 yield* Deferred.await(interrupted);
387​
388 yield* Ref.set(hold, false);
389 expect((yield* a.links.resolve(box.environmentId)).url).toBe(b.url);
390 expect(yield* Ref.get(requests)).toBe(2);
391 expect(yield* Ref.get(b.bearers)).toEqual([]);
392 }),
393 ).pipe(Effect.provide(NodeHttpServer.layerTest)),
394);
395​
396it.effect("reads one stored link without asking the peer", () =>
397 Effect.scoped(
398 Effect.gen(function* () {
399 const b = yield* serveB(box);
400 const a = yield* makeA(laptop);
401 const pairing = yield* b.auth.issuePairingCredential();
402 yield* a.links.link({ url: b.url, pairingCode: pairing.credential, access: "auto" });
403 yield* Ref.set(b.probes, 0);
404​
405 const stored = yield* a.links.get(box.environmentId);
406 expect(Option.map(stored, (link) => link.label)).toEqual(Option.some("Box"));
407 expect(Option.isNone(yield* a.links.get(laptop.environmentId))).toBe(true);
408 expect(yield* Ref.get(b.probes)).toBe(0);
409 }),
410 ).pipe(Effect.provide(NodeHttpServer.layerTest)),
411);
412​
413it.effect("tells the agent to link again once the peer revokes the link or it expires", () =>
414 Effect.scoped(
415 Effect.gen(function* () {
416 const b = yield* serveB(box);
417 const a = yield* makeA(laptop);
418 const pairing = yield* b.auth.issuePairingCredential();
419 yield* a.links.link({ url: b.url, pairingCode: pairing.credential, access: "auto" });
420 yield* probe(a);
421​
422 const [session] = yield* linkedSessions(b);
423 yield* b.auth.revokeSession(session!.sessionId);
424 const revoked = yield* probe(a).pipe(Effect.flip);
425 expect(revoked.code).toBe("capability_denied");
426 expect(revoked.message).toContain("revoked there");
427​
428 yield* a.links.link({
429 url: b.url,
430 pairingCode: (yield* b.auth.issuePairingCredential()).credential,
431 access: "auto",
432 });
433 // A link made with a peer that later answers without the fence, as
434 // one made before the fence or a peer moved back to such a version.
435 yield* Ref.set(b.descriptor, descriptorOf("environment-box", "Box", { linkFence: false }));
436 yield* Ref.set(b.bearers, []);
437 const unfenced = yield* probe(a).pipe(Effect.flip);
438 expect(unfenced.code).toBe("capability_denied");
439 expect(unfenced.message).toContain("cannot keep a linked agent's limits");
440 expect(yield* Ref.get(b.bearers)).toEqual([]);
441 yield* Ref.set(b.descriptor, box);
442​
443 // A link stored before links were marked: its session there is not a
444 // link's, so the peer would not fence its work even though it can.
445 yield* a.sql`UPDATE peer_environment_links SET fenced = 0`;
446 // Linking again is its only way back, as for an expired link.
447 expect((yield* a.links.list).map((link) => link.status)).toEqual(["expired"]);
448 const legacy = yield* probe(a).pipe(Effect.flip);
449 expect(legacy.code).toBe("capability_denied");
450 expect(legacy.message).toContain("Link it again");
451 expect(yield* Ref.get(b.bearers)).toEqual([]);
452 yield* a.links.link({
453 url: b.url,
454 pairingCode: (yield* b.auth.issuePairingCredential()).credential,
455 access: "auto",
456 });
457 yield* probe(a);
458​
459 yield* TestClock.adjust(Duration.days(31));
460 expect((yield* a.links.list).map((link) => link.status)).toEqual(["expired"]);
461 yield* Ref.set(b.bearers, []);
462 const expired = yield* probe(a).pipe(Effect.flip);
463 expect(expired.code).toBe("capability_denied");
464 expect(expired.message).toContain("expired");
465 expect(yield* Ref.get(b.bearers)).toEqual([]);
466 }),
467 ).pipe(Effect.provide(NodeHttpServer.layerTest)),
468);
469​
470it.effect(
471 "refuses to link itself, plain http off this machine and the tailnet, or a peer that cannot hold a linked agent to its limits",
472 () =>
473 Effect.scoped(
474 Effect.gen(function* () {
475 const b = yield* serveB(
476 descriptorOf("environment-box", "Box", { mcpModeLimitHeader: false }),
477 );
478 const a = yield* makeA(laptop);
479 const pairing = yield* b.auth.issuePairingCredential();
480 const older = yield* a.links
481 .link({ url: b.url, pairingCode: pairing.credential, access: "auto" })
482 .pipe(Effect.flip);
483 expect(older.reason).toBe("incompatible");
484 // Nor one whose link's work could reach the user's own threads there.
485 yield* Ref.set(b.descriptor, descriptorOf("environment-box", "Box", { linkFence: false }));
486 const unfenced = yield* a.links
487 .link({ url: b.url, pairingCode: pairing.credential, access: "auto" })
488 .pipe(Effect.flip);
489 expect(unfenced.reason).toBe("incompatible");
490​
491 // Plain http to a LAN address would carry the code and token in clear.
492 const lan = yield* a.links
493 .link({
494 url: "http://192.168.1.20:3773",
495 pairingCode: pairing.credential,
496 access: "auto",
497 })
498 .pipe(Effect.flip);
499 expect(lan.message).toContain("plain http");
500 const lanAlternate = yield* a.links
501 .link({
502 url: b.url,
503 alternateUrls: ["http://192.168.1.20:3773"],
504 pairingCode: pairing.credential,
505 access: "auto",
506 })
507 .pipe(Effect.flip);
508 expect(lanAlternate.message).toContain("plain http");
509​
510 yield* Ref.set(b.descriptor, laptop);
511 const self = yield* a.links
512 .link({ url: b.url, pairingCode: pairing.credential, access: "auto" })
513 .pipe(Effect.flip);
514 expect(self.reason).toBe("self");
515 // Neither attempt spent the pairing code on a session.
516 expect(yield* linkedSessions(b)).toEqual([]);
517 }),
518 ).pipe(Effect.provide(NodeHttpServer.layerTest)),
519);
520​
521it.effect(
522 "linking a picked machine skips an address that answers as another, and never signs in there",
523 () =>
524 Effect.scoped(
525 Effect.gen(function* () {
526 const impostor = yield* serveApart(descriptorOf("environment-impostor", "Impostor"));
527 const b = yield* serveB(box);
528 const a = yield* makeA(laptop);
529 const pairing = yield* b.auth.issuePairingCredential();
530 const linked = yield* a.links.link({
531 url: impostor.url,
532 alternateUrls: [b.url],
533 pairingCode: pairing.credential,
534 access: "auto",
535 expectedEnvironmentId: box.environmentId,
536 });
537 expect(linked).toMatchObject({ environmentId: box.environmentId, urls: [b.url] });
538 yield* probe(a);
539 expect(yield* linkedSessions(impostor)).toEqual([]);
540 expect(yield* Ref.get(impostor.bearers)).toEqual([]);
541 expect((yield* linkedSessions(b)).length).toBe(1);
542 }),
543 ).pipe(Effect.provide(NodeHttpServer.layerTest)),
544);
545​
546it.effect("linking a picked machine that answers nowhere names it and links nothing", () =>
547 Effect.scoped(
548 Effect.gen(function* () {
549 const impostor = yield* serveApart(descriptorOf("environment-impostor", "Impostor"));
550 const a = yield* makeA(laptop);
551 const failed = yield* a.links
552 .link({
553 url: impostor.url,
554 alternateUrls: ["http://192.168.1.20:3773"],
555 pairingCode: "unused",
556 access: "auto",
557 expectedEnvironmentId: box.environmentId,
558 expectedLabel: "Box",
559 })
560 .pipe(Effect.flip);
561 expect(failed.reason).toBe("unreachable");
562 expect(failed.message).toBe(
563 `This environment could not reach Box at ${impostor.url}, http://192.168.1.20:3773.`,
564 );
565 expect(yield* a.links.list).toEqual([]);
566 expect(yield* linkedSessions(impostor)).toEqual([]);
567​
568 // Every address refused: the message says why.
569 const refused = yield* a.links
570 .link({
571 url: "http://192.168.1.20:3773",
572 pairingCode: "unused",
573 access: "auto",
574 expectedEnvironmentId: box.environmentId,
575 expectedLabel: "Box",
576 })
577 .pipe(Effect.flip);
578 expect(refused.message).toContain("could not reach Box");
579 expect(refused.message).toContain("plain http");
580 }),
581 ).pipe(Effect.provide(NodeHttpServer.layerTest)),
582);