chenhg5/cc-connect · error

session not found: %s

Error message

session not found: %s

What it means

A sentinel from findCursorSessionDir: no directory named after the requested session ID exists in any of the workspace's known chats locations. It fires during DeleteSession when the ID is stale, already deleted, or belongs to a different workspace hash.

Source

Thrown at agent/cursor/cursor.go:399

	hash := workspaceHash(workDir)
	var dirs []string
	for _, base := range cursorChatsBaseDirs(homeDir) {
		dir := filepath.Join(base, hash)
		if info, err := os.Stat(dir); err == nil && info.IsDir() {
			dirs = append(dirs, dir)
		}
	}
	return dirs
}

func findCursorSessionDir(homeDir, workDir, sessionID string) (string, error) {
	for _, chatsDir := range workspaceChatsDirs(homeDir, workDir) {
		dir := filepath.Join(chatsDir, sessionID)
		if info, err := os.Stat(dir); err == nil && info.IsDir() {
			return dir, nil
		}
	}
	return "", fmt.Errorf("session not found: %s", sessionID)
}

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

	chatsDirs := workspaceChatsDirs(homeDir, workDir)
	if len(chatsDirs) == 0 {
		return nil, nil
	}

	byID := make(map[string]core.AgentSessionInfo)
	for _, chatsDir := range chatsDirs {
		entries, err := os.ReadDir(chatsDir)
		if err != nil {
			if os.IsNotExist(err) {

View on GitHub (pinned to 4000b2338a)

Solutions

  1. List sessions (/sessions) to get valid current IDs
  2. Confirm the cc-connect working directory matches the session's workspace
  3. Refresh — the session may have been deleted elsewhere
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at agent/cursor/cursor.go:399 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/498ba28955996854. Report an issue: GitHub.