chenhg5/cc-connect · error

session file not found: %s

Error message

session file not found: %s

What it means

A sentinel from iflow DeleteSession: neither the exact project-keyed path nor a glob across all projects found a session file matching the requested ID. The session was already deleted, never existed, or lives under a different ID.

Source

Thrown at agent/iflow/iflow.go:201

	}

	a.mu.RLock()
	workDir := a.workDir
	a.mu.RUnlock()
	absDir := iflowResolvedWorkDir(workDir)

	candidates := []string{
		filepath.Join(homeDir, ".iflow", "projects", iflowProjectKey(absDir), sessionID+".jsonl"),
	}
	for _, p := range candidates {
		if _, err := os.Stat(p); err == nil {
			return os.Remove(p)
		}
	}

	matches, _ := filepath.Glob(filepath.Join(homeDir, ".iflow", "projects", "*", sessionID+".jsonl"))
	if len(matches) == 0 {
		return fmt.Errorf("session file not found: %s", sessionID)
	}
	return os.Remove(matches[0])
}

func (a *Agent) Stop() error { return nil }

// -- ModeSwitcher --

func (a *Agent) SetMode(mode string) {
	a.mu.Lock()
	defer a.mu.Unlock()
	a.mode = normalizeMode(mode)
	slog.Info("iflow: mode changed", "mode", a.mode)
}

func (a *Agent) GetMode() string {
	a.mu.Lock()
	defer a.mu.Unlock()

View on GitHub (pinned to 4000b2338a)

Solutions

  1. List sessions (/sessions) to confirm current IDs
  2. Verify the ID is not truncated or mistyped
  3. Refresh the list if deletion happened concurrently
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at agent/iflow/iflow.go:201 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/7986ec46b8d40a09. Report an issue: GitHub.