chenhg5/cc-connect · error

acp: transport not available

Error message

acp: transport not available

What it means

A sentinel guard in acpSession.CancelTurn: the session holds no live RPC transport (nil or closed). It fires when /stop is used after the session was closed or the transport never came up, making it impossible to deliver a session/cancel notification.

Source

Thrown at agent/acp/session.go:715

func (s *acpSession) Events() <-chan core.Event {
	return s.events
}

func (s *acpSession) CurrentSessionID() string {
	return s.currentACPSessionID()
}

// CancelTurn sends an ACP session/cancel notification to abort the current
// turn while keeping the session alive. The agent should cancel the active
// LLM request and persist state, then wait for the next user message on the
// same connection. This is used by /stop instead of Close().
func (s *acpSession) CancelTurn() error {
	sid := s.currentACPSessionID()
	if sid == "" {
		return fmt.Errorf("acp: no active session to cancel")
	}
	if s.tr == nil {
		return fmt.Errorf("acp: transport not available")
	}
	slog.Debug("acp: cancelling current turn", "session_id", sid)
	return s.tr.sendNotification("session/cancel", map[string]any{
		"sessionId": sid,
	})
}

func (s *acpSession) Alive() bool {
	return s.alive.Load()
}

func (s *acpSession) Close() error {
	s.alive.Store(false)
	s.cancel()
	if s.cmd != nil && s.cmd.Process != nil {
		_ = s.cmd.Process.Kill()
	}
	done := make(chan struct{})

View on GitHub (pinned to 4000b2338a)

Solutions

  1. Start a new session — the current one has no live agent connection
  2. Check earlier errors for why the transport died
  3. Treat /stop on a dead session as a no-op
Defensive patterns

Strategy: validation

When it happens

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