{"record":{"id":"105881a25ea197a3","repo":"router-for-me/CLIProxyAPI","slug":"invalid-request-105881","errorCode":"invalid_request","errorMessage":"failed to read Realtime client secret request: %w","messagePattern":"failed to read Realtime client secret request: %w","errorType":"http","errorClass":null,"httpStatus":400,"severity":"error","filePath":"internal/client/codex/live/client_secret.go","lineNumber":166,"sourceCode":"\t}\n\treturn time.Now()\n}\n\nfunc (s *clientSecretStore) removeExpiredLocked(now time.Time) {\n\tfor token, entry := range s.entries {\n\t\tif !entry.expiresAt.After(now) {\n\t\t\tdelete(s.entries, token)\n\t\t}\n\t}\n}\n\nfunc readClientSecretBody(body io.Reader) ([]byte, error) {\n\tif body == nil {\n\t\treturn nil, nil\n\t}\n\tpayload, errRead := io.ReadAll(io.LimitReader(body, clientSecretMaxBodySize+1))\n\tif errRead != nil {\n\t\treturn nil, fmt.Errorf(\"failed to read Realtime client secret request: %w\", errRead)\n\t}\n\tif len(payload) > clientSecretMaxBodySize {\n\t\treturn nil, errBodyTooLarge\n\t}\n\treturn payload, nil\n}\n\nfunc randomRealtimeID(prefix string, size int) (string, error) {\n\tpayload := make([]byte, size)\n\tif _, errRead := rand.Read(payload); errRead != nil {\n\t\treturn \"\", fmt.Errorf(\"generate Realtime identifier: %w\", errRead)\n\t}\n\treturn prefix + base64.RawURLEncoding.EncodeToString(payload), nil\n}\n\n// AuthenticateClientSecret validates a local ephemeral key when the request carries one.\nfunc (h *Handler) AuthenticateClientSecret(request *http.Request) (ClientSecretAuthorization, bool, error) {\n\ttoken := bearerToken(request)","sourceCodeStart":148,"sourceCodeEnd":184,"githubUrl":"https://github.com/router-for-me/CLIProxyAPI/blob/78f0c4079e3e6273d65d03b5549cffc898703264/internal/client/codex/live/client_secret.go#L148-L184","documentation":"Error \"failed to read Realtime client secret request: %w\" thrown in router-for-me/CLIProxyAPI.","triggerScenarios":"Thrown at internal/client/codex/live/client_secret.go:166 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the request body is readable and within the allowed size limit.","Check the wrapped error for body read failures (truncated or aborted request)."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"78f0c4079e3e6273d65d03b5549cffc898703264","analyzedAt":"2026-08-15T12:26:37.444Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}