(graceMs: number)
| 5071 | // swallows its scan errors the same way each rebuild already swallows its |
| 5072 | // own. |
| 5073 | const awaitStaleSyncWithinGrace = (graceMs: number) => |
| 5074 | Effect.gen(function* () { |
| 5075 | const fiber = yield* Effect.forkDetach( |
| 5076 | syncStaleConnectionTools.pipe( |
| 5077 | Effect.catch((error) => |
| 5078 | Effect.logWarning("executor stale tool sync scan failed", { |
| 5079 | error: describeSyncFailure(error), |
| 5080 | }), |
| 5081 | ), |
| 5082 | ), |
| 5083 | ); |
| 5084 | // On hosts that cancel request-scoped I/O once the response settles |
| 5085 | // (Cloudflare Workers), hand the host the rebuilds' completion so the |
| 5086 | // catalog still converges after the read stops waiting. |
| 5087 | config.waitUntil?.( |
| 5088 | new Promise<void>((resolve) => fiber.addObserver(() => resolve(undefined))), |
| 5089 | ); |
| 5090 | yield* Fiber.await(fiber).pipe(Effect.timeoutOption(graceMs), Effect.asVoid); |
| 5091 | }); |
| 5092 | |
| 5093 | const toolsList = (filter?: ToolListFilter): Effect.Effect<readonly Tool[], StorageFailure> => |
| 5094 | Effect.gen(function* () { |
no test coverage detected