{"record":{"id":"dbfe42c40adbd251","repo":"paperclipai/paperclip","slug":"native-runner-authority-unavailable","errorCode":null,"errorMessage":"native_runner_authority_unavailable","messagePattern":"native_runner_authority_unavailable","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/paperclip-runner/src/live/runnerd-codex-transport.ts","lineNumber":3563,"sourceCode":"        consecutiveReadyProbes += 1;\n        // A second barrier prevents a provider frame emitted immediately after\n        // its terminal notification from racing the authority rotation. Each\n        // snapshot wakes runnerd, polls the provider, and drains the preceding\n        // durable event prefix before the next probe.\n        if (consecutiveReadyProbes >= 2) return;\n      } else {\n        consecutiveReadyProbes = 0;\n      }\n      await new Promise<void>((resolveWait) => setTimeout(resolveWait, 25));\n    }\n    throw new Error(\n      `native_runner_warm_attachment_not_quiescent: ${JSON.stringify(lastBlockers)}`,\n    );\n  }\n\n  async #awaitWarmRunnerConnection(deadline: number): Promise<void> {\n    const core = this.#core;\n    if (core === null) throw new Error(\"native_runner_authority_unavailable\");\n    let reportedReconnectWait = false;\n    while (Date.now() < deadline) {\n      this.#throwIfFailed();\n      const connectionCount = core.activeRunnerConnectionCount();\n      if (connectionCount === 1) {\n        if (reportedReconnectWait) {\n          this.#diagnostic(\n            \"warm runner re-authenticated before authority rotation\",\n          );\n        }\n        return;\n      }\n      if (connectionCount > 1) {\n        throw new Error(\n          `native_runner_warm_attachment_ambiguous: expected one authenticated runner, found ${connectionCount}`,\n        );\n      }\n      if (!reportedReconnectWait) {","sourceCodeStart":3545,"sourceCodeEnd":3581,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/packages/paperclip-runner/src/live/runnerd-codex-transport.ts#L3545-L3581","documentation":"The warm runner connection awaiter requires a live runner core ('authority') instance. If the transport's internal #core reference is null — meaning no native runner core has been started or it was torn down — it throws this error instead of waiting for a connection that can never arrive.","triggerScenarios":"Calling #awaitWarmRunnerConnection (e.g. via attachRun or warm recovery) after the runner core has been disposed, or before startup created it; a failed startup leaving #core null.","commonSituations":"Calling attach during transport shutdown; startup crashed earlier so the core never initialized; lifecycle races where stop() ran concurrently with warm attachment.","solutions":["Ensure the transport is fully started (startupComplete) before attempting warm attachment","Check startup logs for an earlier failure that prevented core creation","Re-create/restart the transport if the core was disposed","Guard callers with an isStarted/core-present check before invoking rotation paths"],"exampleFix":"// before\nawait transport.attachRun({ runId, turnId, itemId });\n// after\nif (!transport.isStarted) throw new Error('start transport before attachRun');\nawait transport.attachRun({ runId, turnId, itemId });","handlingStrategy":"type-guard","validationCode":"if (transport.getCore?.() == null) throw new Error('runner core not initialized');","typeGuard":"function hasCore(t) {\n  return t != null && typeof t.getCore === 'function' && t.getCore() !== null;\n}","tryCatchPattern":"try {\n  await transport.attachRun(input);\n} catch (e) {\n  if (e.message === 'native_runner_authority_unavailable') {\n    await transport.start();\n    await transport.attachRun(input);\n  } else throw e;\n}","preventionTips":["Always await transport startup before warm attachment or rotation","Track transport lifecycle (started/stopped) in a state machine in your code","Never call attach paths after stop() or disposal"],"tags":["codex","native-runner","lifecycle","null-core"],"backgroundTag":"resource-not-found","analyzedSha":"01ad8584922b5d85292b1723cae71fa0d9b07a19","analyzedAt":"2026-09-10T03:14:50.855Z","contentChangedAt":"2026-09-10T03:14:50.855Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}