chenhg5/cc-connect · error

cursorSession: start: %w

Error message

cursorSession: start: %w

What it means

Wraps a failed cmd.Start() in cursorSession.Send: the Cursor CLI could not be spawned for this turn. Fires on missing/non-executable binary at spawn time, invalid workDir, or OS exec refusal; the stdin pipe is closed and the turn aborted.

Source

Thrown at agent/cursor/session.go:160

	stdout, err := cmd.StdoutPipe()
	if err != nil {
		return fmt.Errorf("cursorSession: stdout pipe: %w", err)
	}

	// Set up a stdin pipe so we can write interaction_query responses back to Cursor.
	// Without a connected stdin, Cursor gets EOF and auto-rejects all permission requests.
	stdin, err := cmd.StdinPipe()
	if err != nil {
		return fmt.Errorf("cursorSession: stdin pipe: %w", err)
	}

	var stderrBuf bytes.Buffer
	cmd.Stderr = &stderrBuf

	if err := cmd.Start(); err != nil {
		_ = stdin.Close()
		return fmt.Errorf("cursorSession: start: %w", err)
	}

	cs.stdinMu.Lock()
	cs.stdin = stdin
	cs.stdinMu.Unlock()

	cs.wg.Add(1)
	go cs.readLoop(cmd, stdout, &stderrBuf)

	return nil
}

func (cs *cursorSession) readLoop(cmd *exec.Cmd, stdout io.ReadCloser, stderrBuf *bytes.Buffer) {
	defer cs.wg.Done()
	defer func() {
		// Close stdin so Cursor knows the input stream is finished.
		cs.stdinMu.Lock()
		if cs.stdin != nil {

View on GitHub (pinned to 4000b2338a)

Solutions

  1. Verify the cursor-agent binary is installed and executable
  2. Check the session workDir exists
  3. Read the wrapped error for the exec failure cause
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at agent/cursor/session.go:160 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/161e0d69cf2a856c. Report an issue: GitHub.