chenhg5/cc-connect · error

platform %q does not support proactive messaging

Error message

platform %q does not support proactive messaging

What it means

For proactive sends (session key with no live interactive state), the engine falls back to reconstructing reply context from the session key. If the resolved target platform does not implement the optional ReplyContextReconstructor interface, proactive messaging is impossible on that platform and this error is returned.

Source

Thrown at core/engine.go:11420

			if candidate.Name() == platformName {
				targetPlatform = candidate
				break
			}
		}
		if targetPlatform == nil {
			for _, candidate := range e.platforms {
				needle := ":" + candidate.Name() + ":"
				if idx := strings.Index(strippedKey, needle); idx >= 0 {
					targetPlatform = candidate
					strippedKey = strippedKey[idx+1:]
					break
				}
			}
		}
		if targetPlatform != nil {
			rc, ok := targetPlatform.(ReplyContextReconstructor)
			if !ok {
				return sendTarget{}, fmt.Errorf("platform %q does not support proactive messaging", targetPlatform.Name())
			}
			reconstructed, err := rc.ReconstructReplyCtx(strippedKey)
			if err != nil {
				return sendTarget{}, fmt.Errorf("reconstruct reply context: %w", err)
			}
			p = targetPlatform
			replyCtx = reconstructed
			resolvedSessionKey = strippedKey
		}
	}

	return sendTarget{
		state:      state,
		platform:   p,
		replyCtx:   replyCtx,
		sessionKey: resolvedSessionKey,
	}, nil
}

View on GitHub (pinned to 4000b2338a)

Solutions

  1. Use a platform that implements ReplyContextReconstructor for proactive messaging
  2. Implement ReconstructReplyCtx on the platform adapter (persist reply context at message-receive time)
  3. Change the flow to reply inside an existing session instead of initiating proactively

Example fix

// before
func (p *Platform) Name() string { return "mini" } // no ReconstructReplyCtx
// after
func (p *Platform) ReconstructReplyCtx(key string) (any, error) {
    return p.loadReplyCtx(key)
}
Defensive patterns

Strategy: type-guard

Validate before calling

if _, ok := platform.(core.ReplyContextReconstructor); !ok {
    return fmt.Errorf("proactive messaging unavailable on %s", platform.Name())
}

Type guard

func supportsProactive(p core.Platform) bool { _, ok := p.(core.ReplyContextReconstructor); return ok }

Try / catch

if err := engine.SendToSession(...); err != nil {
    if errors.Is(err, core.ErrNotSupported) { log.Warn("platform cannot message proactively; scheduling inside session instead") }
}

Prevention

When it happens

Trigger: Sending to a stripped session key whose platform is resolved via registry lookup, where the platform adapter lacks ReconstructReplyCtx — e.g. a minimal or older adapter.

Common situations: Timer/cron-driven outbound messages to platforms without proactive support; adapters that only reply within existing event-driven conversations; platform swapped in config to one without the capability.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of chenhg5/cc-connect@4000b2338a (2026-09-06). Data as JSON: /api/errors/2eb158a02dba6b4a. Report an issue: GitHub.