chenhg5/cc-connect · error

acp: stdout pipe: %w

Error message

acp: stdout pipe: %w

What it means

Raised in newACPSession when exec.Cmd.StdoutPipe() fails while wiring pipes to the agent command. Like the stdin variant, it fires before process start and signals OS-level pipe allocation failure (typically fd exhaustion), not an agent problem.

Source

Thrown at agent/acp/session.go:109

		toolInputByID: make(map[string]string),
		acpSessID:     cfg.resumeSessionID,
		callbacks:     cfg.callbacks,
	}
	s.alive.Store(true)

	cmd := exec.CommandContext(sessionCtx, cfg.command, cfg.args...)
	cmd.Dir = absWorkDir
	cmd.Env = core.MergeEnv(os.Environ(), cfg.extraEnv)

	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 {

View on GitHub (pinned to 4000b2338a)

Solutions

  1. Raise the file-descriptor limit on the host
  2. Lower the count of parallel ACP sessions
  3. Investigate fd leaks in long-running cc-connect daemons
Defensive patterns

Strategy: try-catch

When it happens

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