chenhg5/cc-connect · error

acp: start %s: %w

Error message

acp: start %s: %w

What it means

Raised in newACPSession when cmd.Start() fails to launch the configured agent command. The %s names the binary that could not be executed. It fires when the binary path is wrong, lacks execute permission, or the OS refuses to spawn it — distinct from a CLI-not-found config error, which is checked earlier at agent creation.

Source

Thrown at agent/acp/session.go:119

	stdin, err := cmd.StdinPipe()
	if err != nil {
		cancel()
		return nil, fmt.Errorf("acp: stdin pipe: %w", err)
	}
	stdout, err := cmd.StdoutPipe()
	if err != nil {
		cancel()
		return nil, fmt.Errorf("acp: stdout pipe: %w", err)
	}
	var stderrBuf bytes.Buffer
	cmd.Stderr = io.MultiWriter(&stderrBuf, os.Stderr)

	s.cmd = cmd
	s.tr = newTransport(stdout, stdin, s.onNotification, s.onServerRequest)

	if err := cmd.Start(); err != nil {
		cancel()
		return nil, fmt.Errorf("acp: start %s: %w", cfg.command, err)
	}

	s.wg.Add(1)
	go func() {
		defer s.wg.Done()
		s.tr.readLoop(sessionCtx)
		waitErr := cmd.Wait()
		if waitErr != nil {
			msg := stderrBuf.String()
			if msg != "" {
				slog.Error("acp: process exited", "error", waitErr, "stderr", msg)
				s.emit(core.Event{Type: core.EventError, Error: fmt.Errorf("%s", strings.TrimSpace(msg))})
			} else {
				slog.Debug("acp: process exited", "error", waitErr)
			}
		}
		s.alive.Store(false)
	}()

View on GitHub (pinned to 4000b2338a)

Solutions

  1. Verify the configured command path exists and is executable
  2. Check for architecture or permission problems on the binary
  3. If using run_as_user, confirm the target user may execute the command
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at agent/acp/session.go:119 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/c7331762c49f2c00. Report an issue: GitHub.