{"record":{"id":"cb687ca84bd95425","repo":"paperclipai/paperclip","slug":"sandbox-callback-bridge-response-write-wrote-inval","errorCode":null,"errorMessage":"Sandbox callback bridge response write wrote invalid result JSON: ${error instanceof Error ? error.message : String(error)}","messagePattern":"Sandbox callback bridge response write wrote invalid result JSON: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/adapter-utils/src/sandbox-callback-bridge.ts","lineNumber":766,"sourceCode":"          \"  exit 0\",\n          \"fi\",\n          \"cat > \\\"$temp_path\\\"\",\n          \"mv \\\"$temp_path\\\" \\\"$response_path\\\"\",\n          \"printf '{\\\"wrote\\\":true}\\\\n'\",\n        ].join(\"\\n\"),\n        timeoutMs,\n        shellCommand,\n        body,\n      );\n      requireSuccessfulResult(`write bridge response ${responsePath}`, result);\n      try {\n        return {\n          wrote: JSON.parse(result.stdout.trim())?.wrote === true,\n        };\n      } catch (error) {\n        throw new Error(\n          `Sandbox callback bridge response write wrote invalid result JSON: ${error instanceof Error ? error.message : String(error)}`,\n        );\n      }\n    },\n    rename: async (fromPath, toPath) => {\n      await runChecked(\n        `rename ${fromPath}`,\n        `mkdir -p ${shellQuote(path.posix.dirname(toPath))} && mv ${shellQuote(fromPath)} ${shellQuote(toPath)}`,\n      );\n    },\n    remove: async (remotePath) => {\n      await runChecked(`remove ${remotePath}`, `rm -rf ${shellQuote(remotePath)}`);\n    },\n  };\n}\n\nasync function writeBridgeResponse(\n  client: SandboxCallbackBridgeQueueClient,\n  requestPath: string,\n  responsePath: string,","sourceCodeStart":748,"sourceCodeEnd":784,"githubUrl":"https://github.com/paperclipai/paperclip/blob/3f1d897a7c018d76563a21c6e39c3c9b03933622/packages/adapter-utils/src/sandbox-callback-bridge.ts#L748-L784","documentation":"Protocol-parsing failure when writing a bridge response: the atomic write shell script succeeded, but its stdout ('{\"wrote\":...}') failed to parse as JSON — the remote shell produced unexpected output — so the write result cannot be confirmed.","triggerScenarios":"Thrown at packages/adapter-utils/src/sandbox-callback-bridge.ts:677 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the write error and retry; the result JSON write failed.","Check disk space and permissions in the bridge queue directory."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3f1d897a7c018d76563a21c6e39c3c9b03933622","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}