chenhg5/cc-connect · error

acp: unknown permission request %q

Error message

acp: unknown permission request %q

What it means

A sentinel guard in acpSession.RespondPermission: the requestID does not exist in the permByID tracking map (either never seen or already answered and deleted). It fires when a permission response arrives twice for the same request, arrives after the session forgot it, or uses a stale/wrong ID.

Source

Thrown at agent/acp/session.go:682

	if prompt == "" {
		prompt = "User sent image(s)."
	}
	return prompt + "\n\n(Image files saved locally: " + strings.Join(paths, ", ") + ")"
}

func (s *acpSession) RespondPermission(requestID string, result core.PermissionResult) error {
	if !s.alive.Load() {
		return fmt.Errorf("acp: session closed")
	}

	s.permMu.Lock()
	st, ok := s.permByID[requestID]
	if ok {
		delete(s.permByID, requestID)
	}
	s.permMu.Unlock()
	if !ok {
		return fmt.Errorf("acp: unknown permission request %q", requestID)
	}

	allow := strings.EqualFold(result.Behavior, "allow")
	optID := pickPermissionOptionID(allow, st.Options)
	if allow && optID == "" {
		slog.Warn("acp: allow requested but agent sent no options", "request_id", requestID)
		return s.tr.respondError(st.RPCID, -32603, "no permission options from agent")
	}
	res := buildPermissionResult(allow, optID)

	slog.Debug("acp: permission response", "request_id", requestID, "allow", allow, "option_id", optID)
	return s.tr.respondSuccess(st.RPCID, res)
}

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

View on GitHub (pinned to 4000b2338a)

Solutions

  1. Avoid sending duplicate responses for the same permission card/button
  2. Discard stale permission prompts from older sessions instead of answering them
  3. Restart the turn to obtain a fresh permission request if one is genuinely pending
Defensive patterns

Strategy: validation

When it happens

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