MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / failOpen

Function failOpen

apps/cloud/src/engine/execution-rate-limit.ts:123–139  ·  view source on GitHub ↗
(
  error: unknown,
  outcome: { readonly errorTag: string; readonly timedOut: boolean },
)

Source from the content-addressed store, hash-verified

121 * error reporter — see the call sites in `decide`.
122 */
123const failOpen = (
124 error: unknown,
125 outcome: { readonly errorTag: string; readonly timedOut: boolean },
126): Effect.Effect<GateDecision> =>
127 Effect.gen(function* () {
128 yield* Effect.annotateCurrentSpan({
129 "rate_limit.blocked": false,
130 "rate_limit.check.failed_open": true,
131 "rate_limit.check.timed_out": outcome.timedOut,
132 "rate_limit.check.error_tag": outcome.errorTag,
133 });
134 yield* Effect.sync(() => {
135 console.warn("[rate-limit] execution rate limit check failed open:", error);
136 });
137 if (!outcome.timedOut) yield* captureCauseEffect(error);
138 return { blocked: false } as const satisfies GateDecision;
139 });
140
141/** Internal sentinel for an exemption lookup that exceeded its time budget. */
142class ExemptionCheckTimeoutError extends Data.TaggedError("ExemptionCheckTimeoutError")<{

Callers 1

decideFunction · 0.85

Calls 3

captureCauseEffectFunction · 0.90
warnMethod · 0.80
syncMethod · 0.65

Tested by

no test coverage detected