{"record":{"id":"0652120ef5ad5e8d","repo":"paperclipai/paperclip","slug":"paperclip-sandbox-callback-bridge-failed-to-abor","errorCode":null,"errorMessage":"[paperclip] sandbox callback bridge failed to abort queued requests after worker failure: ${failPendingError instanceof Error ? failPendingError.message : String(failPendingError)}","messagePattern":"\\[paperclip\\] sandbox callback bridge failed to abort queued requests after worker failure: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/adapter-utils/src/sandbox-callback-bridge.ts","lineNumber":1417,"sourceCode":"              `Sandbox callback bridge process request ${fileName}`,\n            );\n            lastSuccessfulIterationAt = Date.now();\n          } finally {\n            inFlight -= 1;\n          }\n        }\n        lastSuccessfulIterationAt = Date.now();\n        if (stopping && Date.now() >= stopDeadline) {\n          break;\n        }\n      }\n    } catch (error) {\n      const message = buildWorkerFailureMessage(error);\n      await surfaceRunError(new Error(message));\n      try {\n        await failPendingRequests(message, { abandonInFlight: true });\n      } catch (failPendingError) {\n        console.warn(\n          `[paperclip] sandbox callback bridge failed to abort queued requests after worker failure: ${failPendingError instanceof Error ? failPendingError.message : String(failPendingError)}`,\n        );\n      }\n    } finally {\n      clearInterval(watchdogTimer);\n      settled = true;\n      if (settleResolve) {\n        settleResolve();\n      }\n    }\n  })());\n\n  void loop;\n\n  return {\n    stop: async (options = {}) => {\n      stopping = true;\n      const drainMs = normalizeTimeoutMs(options.drainTimeoutMs, DEFAULT_BRIDGE_STOP_TIMEOUT_MS);","sourceCodeStart":1399,"sourceCodeEnd":1435,"githubUrl":"https://github.com/paperclipai/paperclip/blob/a7e689b3c35347b529cb9f54c9b9a8575a3dcab6/packages/adapter-utils/src/sandbox-callback-bridge.ts#L1399-L1435","documentation":"The bridge worker loop caught a fatal error (e.g. per-iteration timeout while listing or processing request files), surfaced it as a run-trace span via surfaceRunError, then called failPendingRequests(message, { abandonInFlight: true }) to abort queued requests with 503s. That abort itself threw — so this warning reports the cleanup failure. Queued request files may remain, and their sandbox callers stay pending until their own deadlines; the run has already recorded the primary worker failure.","triggerScenarios":"Sandbox channel dies while requests are queued: the loop's listJsonFiles or a request write times out (worker failure), and the subsequent recovery sweep that writes 503 responses fails again on the same dead channel.","commonSituations":"Sandbox killed mid-run; shared storage unmounted; severe host I/O contention making every channel operation time out in sequence.","solutions":["Find the primary failure first: the run trace now contains the surfaced worker-failure span (surfaceRunError) — read it to see the root timeout/error.","Verify and restore sandbox/storage health, then stop and re-run the affected agent turn so a fresh bridge drains or 503s leftover requests.","Do not retry the run against the same sandbox until the channel responds (a quick list/write probe against the shared dir is a good smoke test).","Report with run logs if recovery keeps failing on a healthy channel — that combination indicates a defect."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"const probe = await withTimeout(input.client.listJsonFiles(directories.requestsDir), iterationTimeoutMs, \"probe\");\n// channel answers => safe to attempt failPendingRequests; otherwise expect stranded queue","typeGuard":null,"tryCatchPattern":"try {\n  await failPendingRequests(message, { abandonInFlight: true });\n} catch (failPendingError) {\n  // Best-effort cleanup failed on the same dead channel. The primary failure was\n  // already surfaced to the run trace — log and let callers hit their own deadlines.\n  console.warn(`[paperclip] sandbox callback bridge failed to abort queued requests: ${String(failPendingError)}`);\n}","preventionTips":["Surface the primary worker error to the run trace (surfaceRunError) so cleanup failure never hides the root cause.","Stop and re-run the agent turn after restoring sandbox health so a fresh bridge drains leftover requests.","Proactively probe the channel before recovery sweeps when a timeout just occurred.","Alert on this warn in run telemetry — it predicts stranded sandbox callers."],"tags":["sandbox","callback-bridge","worker-failure","recovery","cleanup"],"backgroundTag":"queued-request-abort-failed","analyzedSha":"a7e689b3c35347b529cb9f54c9b9a8575a3dcab6","analyzedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}