{"record":{"id":"c3f3a8d2cc4191a7","repo":"chenhg5/cc-connect","slug":"cursor-read-chats-dir-s-w","errorCode":null,"errorMessage":"cursor: read chats dir %s: %w","messagePattern":"cursor: read chats dir (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agent/cursor/cursor.go","lineNumber":420,"sourceCode":"func listCursorSessions(workDir string) ([]core.AgentSessionInfo, error) {\n\thomeDir, err := os.UserHomeDir()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"cursor: cannot determine home dir: %w\", err)\n\t}\n\n\tchatsDirs := workspaceChatsDirs(homeDir, workDir)\n\tif len(chatsDirs) == 0 {\n\t\treturn nil, nil\n\t}\n\n\tbyID := make(map[string]core.AgentSessionInfo)\n\tfor _, chatsDir := range chatsDirs {\n\t\tentries, err := os.ReadDir(chatsDir)\n\t\tif err != nil {\n\t\t\tif os.IsNotExist(err) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\treturn nil, fmt.Errorf(\"cursor: read chats dir %s: %w\", chatsDir, err)\n\t\t}\n\n\t\tfor _, entry := range entries {\n\t\t\tif !entry.IsDir() {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tsessionID := entry.Name()\n\t\t\tdbPath := filepath.Join(chatsDir, sessionID, \"store.db\")\n\t\t\tif _, err := os.Stat(dbPath); err != nil {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tinfo, err := entry.Info()\n\t\t\tif err != nil {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tmeta := readSessionMeta(dbPath)","sourceCodeStart":402,"sourceCodeEnd":438,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/agent/cursor/cursor.go#L402-L438","documentation":"Wraps a failed os.ReadDir of a Cursor chats directory during session listing. Missing directories are skipped; this error fires only on other IO failures such as permission denial while scanning one of the known chats locations for the workspace.","triggerScenarios":"Thrown at agent/cursor/cursor.go:420 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix read permissions on the Cursor chats directories","Check for filesystem errors on the affected path","Retry /sessions after repair"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4000b2338aa6e850c99df54f8b0ed6ed7460b401","analyzedAt":"2026-09-06T11:45:09.575Z","contentChangedAt":"2026-09-06T11:45:09.575Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}