{"record":{"id":"b6feead86e25a30b","repo":"chenhg5/cc-connect","slug":"wps-agentspace-failed-to-decrypt-wps-sid-w","errorCode":null,"errorMessage":"wps-agentspace: failed to decrypt wps_sid: %w","messagePattern":"wps-agentspace: failed to decrypt wps_sid: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"platform/wps-agentspace/wpsagentspace.go","lineNumber":182,"sourceCode":"}\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\n}\n\n// Reply sends a reply to a specific message.\nfunc (p *Platform) Reply(ctx context.Context, replyCtx any, content string) error {\n\trc, ok := replyCtx.(*replyContext)","sourceCodeStart":164,"sourceCodeEnd":200,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/platform/wps-agentspace/wpsagentspace.go#L164-L200","documentation":"Start could not decrypt the stored wps_sid with decryptWpsSid(wpsSid, appID) — the sid is persisted in encrypted form (auto-saved after auto-login) and decryption failed, meaning the value is not valid ciphertext for the current app_id (wrong app, corrupted entry, or a plaintext sid passed where encrypted was expected).","triggerScenarios":"Thrown at platform/wps-agentspace/wpsagentspace.go:182 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the app_id used at decryption matches the one used when the encrypted wps_sid was saved","Re-run auto-login or paste a fresh encrypted sid to replace a corrupted stored value","If passing a plaintext sid, use the config path that skips decryption"],"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"}