{"record":{"id":"b7008e0289b8b59e","repo":"chenhg5/cc-connect","slug":"wps-agentspace-wps-sid-is-required","errorCode":null,"errorMessage":"wps-agentspace: wps_sid is required","messagePattern":"wps-agentspace: wps_sid is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"platform/wps-agentspace/wpsagentspace.go","lineNumber":177,"sourceCode":"\t\twpsSid:     wpsSid,\n\t\tdeviceUuid: deviceUuid,\n\t\tdeviceName: deviceName,\n\t\tbaseURL:    baseURL,\n\t}, nil\n}\n\n// Name returns the platform identifier.\nfunc (p *Platform) Name() string {\n\treturn \"wps-agentspace\"\n}\n\n// Start initializes the WebSocket connection and begins message processing.\nfunc (p *Platform) Start(handler core.MessageHandler) error {\n\tp.handler = handler\n\tp.writeCh = make(chan any, 64)\n\n\tif p.wpsSid == \"\" {\n\t\treturn fmt.Errorf(\"wps-agentspace: wps_sid is required\")\n\t}\n\n\tdecryptedSid, err := decryptWpsSid(p.wpsSid, p.appID)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"wps-agentspace: failed to decrypt wps_sid: %w\", err)\n\t}\n\tp.wpsSid = decryptedSid\n\tslog.Info(\"wps-agentspace: token loaded\", \"length\", len(p.wpsSid), \"has_colons\", strings.Contains(p.wpsSid, \":\"))\n\n\tif p.deviceUuid == \"\" {\n\t\tp.deviceUuid = generateUUID()\n\t}\n\n\tctx, cancel := context.WithCancel(context.Background())\n\tp.cancel = cancel\n\n\tgo p.connectLoop(ctx)\n\treturn nil","sourceCodeStart":159,"sourceCodeEnd":195,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/platform/wps-agentspace/wpsagentspace.go#L159-L195","documentation":"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.","triggerScenarios":"Thrown at platform/wps-agentspace/wpsagentspace.go:177 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set wps_sid in config.toml or the WPS_SID environment variable","If relying on auto-login, check why it did not populate the sid during New"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4000b2338aa6e850c99df54f8b0ed6ed7460b401","analyzedAt":"2026-09-06T11:45:09.575Z","contentChangedAt":"2026-09-06T11:45:09.575Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}