{"record":{"id":"56d407eaf2306099","repo":"router-for-me/CLIProxyAPI","slug":"failed-to-decode-codex-live-response-w","errorCode":null,"errorMessage":"failed to decode Codex live response: %w","messagePattern":"failed to decode Codex live response: %w","errorType":"http","errorClass":null,"httpStatus":502,"severity":"error","filePath":"internal/client/codex/live/live.go","lineNumber":745,"sourceCode":"\tif errMarshal != nil {\n\t\treturn nil, \"\", fmt.Errorf(\"failed to encode Codex live SDP offer: %w\", errMarshal)\n\t}\n\tpayload[\"sdp\"] = encodedSDP\n\tencoded, errMarshal := json.Marshal(payload)\n\tif errMarshal != nil {\n\t\treturn nil, \"\", fmt.Errorf(\"failed to encode Codex live call request: %w\", errMarshal)\n\t}\n\treturn encoded, \"application/json\", nil\n}\n\nfunc callResponseSDP(body []byte, contentType string) (string, error) {\n\tmediaType, _, errMediaType := mime.ParseMediaType(contentType)\n\tif errMediaType == nil && strings.EqualFold(mediaType, \"application/json\") {\n\t\tvar payload struct {\n\t\t\tSDP string `json:\"sdp\"`\n\t\t}\n\t\tif errUnmarshal := json.Unmarshal(body, &payload); errUnmarshal != nil {\n\t\t\treturn \"\", fmt.Errorf(\"failed to decode Codex live response: %w\", errUnmarshal)\n\t\t}\n\t\tif strings.TrimSpace(payload.SDP) == \"\" {\n\t\t\treturn \"\", errors.New(\"Codex live response requires an SDP answer\")\n\t\t}\n\t\treturn payload.SDP, nil\n\t}\n\tif strings.TrimSpace(string(body)) == \"\" {\n\t\treturn \"\", errors.New(\"Codex live response requires an SDP answer\")\n\t}\n\treturn string(body), nil\n}\n\nfunc modelFromJSON(body []byte) string {\n\tvar payload struct {\n\t\tModel   string `json:\"model\"`\n\t\tSession struct {\n\t\t\tModel string `json:\"model\"`\n\t\t} `json:\"session\"`","sourceCodeStart":727,"sourceCodeEnd":763,"githubUrl":"https://github.com/router-for-me/CLIProxyAPI/blob/78f0c4079e3e6273d65d03b5549cffc898703264/internal/client/codex/live/live.go#L727-L763","documentation":"Error \"failed to decode Codex live response: %w\" thrown in router-for-me/CLIProxyAPI.","triggerScenarios":"Thrown at internal/client/codex/live/live.go:745 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the upstream Codex live response is valid JSON.","Inspect the wrapped decode error and the raw upstream body."],"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-15T17:31:12.345Z"}