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

Function annotateHealthVerdict

packages/core/sdk/src/executor.ts:5106–5124  ·  view source on GitHub ↗
(
      source: "cache" | "dead_grant" | "no_capability" | "credential_only" | "probe",
      result: HealthCheckResult,
      previous: HealthCheckResult | null,
    )

Source from the content-addressed store, hash-verified

5104 * the enumerable failure mechanism (`HealthCheckReason`); free-text
5105 * `detail` still never goes on a span. */
5106 const annotateHealthVerdict = (
5107 source: "cache" | "dead_grant" | "no_capability" | "credential_only" | "probe",
5108 result: HealthCheckResult,
5109 previous: HealthCheckResult | null,
5110 ): Effect.Effect<void> =>
5111 Effect.annotateCurrentSpan({
5112 "executor.health.status": result.status,
5113 "executor.health.source": source,
5114 ...(result.httpStatus !== undefined
5115 ? { "executor.health.http_status": result.httpStatus }
5116 : {}),
5117 ...(result.reason !== undefined ? { "executor.health.reason": result.reason } : {}),
5118 ...(previous !== null
5119 ? {
5120 "executor.health.previous_status": previous.status,
5121 "executor.health.changed": result.status !== previous.status,
5122 }
5123 : {}),
5124 });
5125
5126 /** Persist a probe verdict unless the grant died while the probe was in
5127 * flight: a concurrent refresh discovering invalid_grant writes the

Callers 1

connectionCheckHealthFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected