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

Function annotateHealthVerdict

packages/core/sdk/src/executor.ts:5114–5132  ·  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

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

Callers 1

connectionCheckHealthFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected