{"record":{"id":"ee24613ffae36f8c","repo":"chenhg5/cc-connect","slug":"iflow-read-sessions-dir-w","errorCode":null,"errorMessage":"iflow: read sessions dir: %w","messagePattern":"iflow: read sessions dir: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agent/iflow/iflow.go","lineNumber":351,"sourceCode":"\t\tContent any    `json:\"content\"`\n\t} `json:\"message\"`\n}\n\nfunc listIFlowSessions(workDir string) ([]core.AgentSessionInfo, error) {\n\thomeDir, err := os.UserHomeDir()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"iflow: cannot determine home dir: %w\", err)\n\t}\n\n\tabsDir := iflowResolvedWorkDir(workDir)\n\n\tsessionDir := filepath.Join(homeDir, \".iflow\", \"projects\", iflowProjectKey(absDir))\n\tentries, err := os.ReadDir(sessionDir)\n\tif err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\treturn nil, nil\n\t\t}\n\t\treturn nil, fmt.Errorf(\"iflow: read sessions dir: %w\", err)\n\t}\n\n\tvar sessions []core.AgentSessionInfo\n\tfor _, e := range entries {\n\t\tif e.IsDir() {\n\t\t\tcontinue\n\t\t}\n\t\tname := e.Name()\n\t\tif !strings.HasPrefix(name, \"session-\") || !strings.HasSuffix(name, \".jsonl\") {\n\t\t\tcontinue\n\t\t}\n\n\t\tpath := filepath.Join(sessionDir, name)\n\t\tsid, summary, msgCount, modifiedAt := parseIFlowSessionFile(path)\n\t\tif sid == \"\" {\n\t\t\tsid = strings.TrimSuffix(name, \".jsonl\")\n\t\t}\n\t\tif summary == \"\" {","sourceCodeStart":333,"sourceCodeEnd":369,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/agent/iflow/iflow.go#L333-L369","documentation":"Wraps a failed os.ReadDir of the iFlow project session directory (~/.iflow/projects/<key>) during listing. Not-exist yields an empty list; this error fires only on other IO failures such as permission denial while scanning.","triggerScenarios":"Thrown at agent/iflow/iflow.go:351 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix read permissions on ~/.iflow/projects","Check the path is a real directory (not a broken symlink)","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"}