{"record":{"id":"97358443e9d45a3b","repo":"paperclipai/paperclip","slug":"fake-setup-session-cannot-be-captured-from-status","errorCode":null,"errorMessage":"Fake setup session cannot be captured from status ${state.status}.","messagePattern":"Fake setup session cannot be captured from status (.+?)\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/plugins/paperclip-plugin-fake-sandbox/src/plugin.ts","lineNumber":431,"sourceCode":"        metadata: {\n          provider: \"fake-plugin\",\n          found: false,\n        },\n      };\n    }\n    return presentSetupSession(state, { includeConnectionPayload: params.includeConnectionPayload === true });\n  },\n\n  async onEnvironmentCaptureTemplate(\n    params: PluginEnvironmentCaptureTemplateParams,\n  ): Promise<PluginEnvironmentCaptureTemplateResult> {\n    const config = parseConfig(params.config);\n    const state = params.providerLeaseId ? setupSessions.get(params.providerLeaseId) : undefined;\n    if (!state) {\n      throw new Error(\"Fake setup session not found.\");\n    }\n    if (state.status === \"cancelled\" || state.status === \"timed_out\" || state.status === \"failed\") {\n      throw new Error(`Fake setup session cannot be captured from status ${state.status}.`);\n    }\n\n    state.status = \"capturing\";\n    const templateRef = buildTemplateRef(state.environmentId, state.sessionId);\n    const template: FakeTemplateState = {\n      templateRef,\n      environmentId: state.environmentId,\n      sessionId: state.sessionId,\n      image: config.image,\n      sourceTemplateRef: params.sourceTemplateRef ?? state.sourceTemplateRef,\n      previousTemplateRef: params.previousTemplateRef ?? null,\n      deleted: false,\n    };\n    templates.set(templateRef, template);\n    state.status = \"promoted\";\n    state.capturedTemplateRef = templateRef;\n    await removeLease(state.providerLeaseId);\n","sourceCodeStart":413,"sourceCodeEnd":449,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/packages/plugins/paperclip-plugin-fake-sandbox/src/plugin.ts#L413-L449","documentation":"Error \"Fake setup session cannot be captured from status ${state.status}.\" thrown in paperclipai/paperclip.","triggerScenarios":"Thrown at packages/plugins/paperclip-plugin-fake-sandbox/src/plugin.ts:431 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Wait until the fake setup session reaches a capturable status, then capture the template."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"120ae5428fa29bee300bcf806491cd4d965fbb7c","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}