chenhg5/cc-connect · error

iflow: read sessions dir: %w

Error message

iflow: read sessions dir: %w

What it means

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.

Source

Thrown at agent/iflow/iflow.go:351

		Content any    `json:"content"`
	} `json:"message"`
}

func listIFlowSessions(workDir string) ([]core.AgentSessionInfo, error) {
	homeDir, err := os.UserHomeDir()
	if err != nil {
		return nil, fmt.Errorf("iflow: cannot determine home dir: %w", err)
	}

	absDir := iflowResolvedWorkDir(workDir)

	sessionDir := filepath.Join(homeDir, ".iflow", "projects", iflowProjectKey(absDir))
	entries, err := os.ReadDir(sessionDir)
	if err != nil {
		if os.IsNotExist(err) {
			return nil, nil
		}
		return nil, fmt.Errorf("iflow: read sessions dir: %w", err)
	}

	var sessions []core.AgentSessionInfo
	for _, e := range entries {
		if e.IsDir() {
			continue
		}
		name := e.Name()
		if !strings.HasPrefix(name, "session-") || !strings.HasSuffix(name, ".jsonl") {
			continue
		}

		path := filepath.Join(sessionDir, name)
		sid, summary, msgCount, modifiedAt := parseIFlowSessionFile(path)
		if sid == "" {
			sid = strings.TrimSuffix(name, ".jsonl")
		}
		if summary == "" {

View on GitHub (pinned to 4000b2338a)

Solutions

  1. Fix read permissions on ~/.iflow/projects
  2. Check the path is a real directory (not a broken symlink)
  3. Retry /sessions after repair
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at agent/iflow/iflow.go:351 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of chenhg5/cc-connect@4000b2338a (2026-09-06). Data as JSON: /api/errors/ee24613ffae36f8c. Report an issue: GitHub.