{"record":{"id":"28fef78b547ce264","repo":"deepseek-ai/deepseek-harness","slug":"workspace-attach-failed","errorCode":"workspace-attach-failed","errorMessage":"session \"${sessionId}\" was created but could not attach to workspace \"${workspace.id}\": ${String(error)}","messagePattern":"session \"(.+?)\" was created but could not attach to workspace \"(.+?)\": (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/host/apiproxy/src/api-proxy.ts","lineNumber":2134,"sourceCode":"                requestedCwd: error.requestedCwd,\n                ...error.existingCwd === undefined ? {} : { existingCwd: error.existingCwd },\n              },\n            })\n          }\n          if (error instanceof SubagentSessionOwnership) {\n            return err(request, subagentOwnershipError(error.sessionId))\n          }\n          return err(request, {\n            code: 'internal',\n            message: `failed to create session \"${sessionId}\": ${String(error)}`,\n            details: {},\n          })\n        }\n        if (workspace !== undefined) {\n          try {\n            await workspace.attachSession(sessionId)\n          } catch (error: unknown) {\n            return err(request, {\n              code: 'workspace-attach-failed',\n              message: `session \"${sessionId}\" was created but could not attach to workspace \"${workspace.id}\": ${String(error)}`,\n              details: { sessionId, workspaceId: workspace.id },\n            })\n          }\n        }\n        // Echo the composition the session RUNS so a client can label it\n        // without waiting for the next list refresh — the create is the commit\n        // point that knows it (a caller that named none gets the default).\n        // Resolved from the log for the same reason `sessionListFields()` is:\n        // this handler also adopts an already-live session, and one that\n        // switched while blank runs a preset its header no longer names, so\n        // echoing the header would contradict both the adoption this call just\n        // allowed and the row `session.list` serves for the same session.\n        const created = ctx.agents.get(sessionId)\n        const createdPreset = created === undefined ? undefined : resolveSessionPreset(created.session)\n        return ok(request, { sessionId, ...createdPreset === undefined ? {} : { agentPreset: createdPreset } })\n      },","sourceCodeStart":2116,"sourceCodeEnd":2152,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/host/apiproxy/src/api-proxy.ts#L2116-L2152","documentation":"Error \"session \"${sessionId}\" was created but could not attach to workspace \"${workspace.id}\": ${String(error)}\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/host/apiproxy/src/api-proxy.ts:2134 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the session/workspace attach failure named in the embedded error (cwd outside workspace, missing header), then attach or recreate the session."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}