chenhg5/cc-connect · error

wps-agentspace: wps_sid is required

Error message

wps-agentspace: wps_sid is required

What it means

Start was called on a platform whose wps_sid is empty after construction — every path that could supply it (config, env, auto-login) produced nothing, so there is no credential to open the WebSocket session.

Source

Thrown at platform/wps-agentspace/wpsagentspace.go:177

		wpsSid:     wpsSid,
		deviceUuid: deviceUuid,
		deviceName: deviceName,
		baseURL:    baseURL,
	}, nil
}

// Name returns the platform identifier.
func (p *Platform) Name() string {
	return "wps-agentspace"
}

// Start initializes the WebSocket connection and begins message processing.
func (p *Platform) Start(handler core.MessageHandler) error {
	p.handler = handler
	p.writeCh = make(chan any, 64)

	if p.wpsSid == "" {
		return fmt.Errorf("wps-agentspace: wps_sid is required")
	}

	decryptedSid, err := decryptWpsSid(p.wpsSid, p.appID)
	if err != nil {
		return fmt.Errorf("wps-agentspace: failed to decrypt wps_sid: %w", err)
	}
	p.wpsSid = decryptedSid
	slog.Info("wps-agentspace: token loaded", "length", len(p.wpsSid), "has_colons", strings.Contains(p.wpsSid, ":"))

	if p.deviceUuid == "" {
		p.deviceUuid = generateUUID()
	}

	ctx, cancel := context.WithCancel(context.Background())
	p.cancel = cancel

	go p.connectLoop(ctx)
	return nil

View on GitHub (pinned to 4000b2338a)

Solutions

  1. Set wps_sid in config.toml or the WPS_SID environment variable
  2. If relying on auto-login, check why it did not populate the sid during New
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at platform/wps-agentspace/wpsagentspace.go:177 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/b7008e0289b8b59e. Report an issue: GitHub.