(graceMs: number)
| 5543 | // swallows its scan errors the same way each rebuild already swallows its |
| 5544 | // own. |
| 5545 | const awaitStaleSyncWithinGrace = (graceMs: number) => |
| 5546 | Effect.gen(function* () { |
| 5547 | const fiber = yield* Effect.forkDetach( |
| 5548 | syncStaleConnectionTools.pipe( |
| 5549 | Effect.catch((error) => |
| 5550 | Effect.logWarning("executor stale tool sync scan failed", { |
| 5551 | error: describeSyncFailure(error), |
| 5552 | }), |
| 5553 | ), |
| 5554 | ), |
| 5555 | ); |
| 5556 | // On hosts that cancel request-scoped I/O once the response settles |
| 5557 | // (Cloudflare Workers), hand the host the rebuilds' completion so the |
| 5558 | // catalog still converges after the read stops waiting. |
| 5559 | config.waitUntil?.( |
| 5560 | new Promise<void>((resolve) => fiber.addObserver(() => resolve(undefined))), |
| 5561 | ); |
| 5562 | yield* Fiber.await(fiber).pipe(Effect.timeoutOption(graceMs), Effect.asVoid); |
| 5563 | }); |
| 5564 | |
| 5565 | const toolsList = (filter?: ToolListFilter): Effect.Effect<readonly Tool[], StorageFailure> => |
| 5566 | Effect.gen(function* () { |
no test coverage detected