{"record":{"id":"99a734edba201dba","repo":"chenhg5/cc-connect","slug":"iflow-cannot-determine-home-dir-w","errorCode":null,"errorMessage":"iflow: cannot determine home dir: %w","messagePattern":"iflow: cannot determine home dir: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agent/iflow/iflow.go","lineNumber":182,"sourceCode":"\n\treturn newIFlowSession(ctx, cmd, extraArgs, workDir, model, mode, sessionID, extraEnv, toolTimeoutSec)\n}\n\nfunc (a *Agent) ListSessions(_ context.Context) ([]core.AgentSessionInfo, error) {\n\ta.mu.RLock()\n\tworkDir := a.workDir\n\ta.mu.RUnlock()\n\treturn listIFlowSessions(workDir)\n}\n\nfunc (a *Agent) DeleteSession(_ context.Context, sessionID string) error {\n\tif sessionID == \"\" {\n\t\treturn fmt.Errorf(\"session id is required\")\n\t}\n\n\thomeDir, err := os.UserHomeDir()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"iflow: cannot determine home dir: %w\", err)\n\t}\n\n\ta.mu.RLock()\n\tworkDir := a.workDir\n\ta.mu.RUnlock()\n\tabsDir := iflowResolvedWorkDir(workDir)\n\n\tcandidates := []string{\n\t\tfilepath.Join(homeDir, \".iflow\", \"projects\", iflowProjectKey(absDir), sessionID+\".jsonl\"),\n\t}\n\tfor _, p := range candidates {\n\t\tif _, err := os.Stat(p); err == nil {\n\t\t\treturn os.Remove(p)\n\t\t}\n\t}\n\n\tmatches, _ := filepath.Glob(filepath.Join(homeDir, \".iflow\", \"projects\", \"*\", sessionID+\".jsonl\"))\n\tif len(matches) == 0 {","sourceCodeStart":164,"sourceCodeEnd":200,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/agent/iflow/iflow.go#L164-L200","documentation":"Wraps a failed os.UserHomeDir() inside iflow Agent.DeleteSession. iFlow stores session transcripts under ~/.iflow/projects/...; without a home directory the path cannot be constructed and deletion aborts.","triggerScenarios":"Thrown at agent/iflow/iflow.go:182 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set HOME in the cc-connect environment","Verify the daemon user has a valid home","Retry /delete after the fix"],"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-14T00:17:10.932Z"}