MCPcopy Index your code
hub / github.com/coder/mux / dispatchHeartbeatMessage

Method dispatchHeartbeatMessage

src/node/services/workspaceService.ts:9303–9330  ·  view source on GitHub ↗
(
    workspaceId: string,
    heartbeatRequest: HeartbeatExecutionRequest
  )

Source from the content-addressed store, hash-verified

9301 }
9302
9303 private async dispatchHeartbeatMessage(
9304 workspaceId: string,
9305 heartbeatRequest: HeartbeatExecutionRequest
9306 ): Promise<void> {
9307 const sendResult = await this.sendMessage(
9308 workspaceId,
9309 heartbeatRequest.heartbeatPrompt,
9310 {
9311 ...heartbeatRequest.sendOptions,
9312 muxMetadata: heartbeatRequest.muxMetadata,
9313 },
9314 {
9315 // Heartbeats run in background; avoid mutating auto-resume counters.
9316 skipAutoResumeReset: true,
9317 // Backend-initiated maintenance turn: do not treat as explicit user re-engagement.
9318 synthetic: true,
9319 // If the workspace became active after eligibility checks, skip instead of queueing
9320 // stale maintenance work for later.
9321 requireIdle: true,
9322 }
9323 );
9324
9325 if (!sendResult.success) {
9326 throw new Error(
9327 `Failed to execute heartbeat: ${this.formatSendMessageError(sendResult.error)}`
9328 );
9329 }
9330 }
9331
9332 private async dispatchHeartbeatCompactionRequest(
9333 workspaceId: string,

Callers 1

executeHeartbeatMethod · 0.95

Calls 2

sendMessageMethod · 0.95

Tested by

no test coverage detected