{"record":{"id":"7442dbfed79e8f0d","repo":"chenhg5/cc-connect","slug":"s-s","errorCode":null,"errorMessage":"%s: %s","messagePattern":"%s: %s","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agent/codex/session.go","lineNumber":756,"sourceCode":"\n\t\tvar probe map[string]json.RawMessage\n\t\tif err := json.Unmarshal(bytes.TrimSpace(line), &probe); err != nil {\n\t\t\tcontinue\n\t\t}\n\t\tif _, ok := probe[\"id\"]; !ok {\n\t\t\tcontinue\n\t\t}\n\n\t\tvar resp rpcResponseEnvelope\n\t\tif err := json.Unmarshal(bytes.TrimSpace(line), &resp); err != nil {\n\t\t\tcontinue\n\t\t}\n\t\trespID, ok := rpcIDToInt64(resp.ID)\n\t\tif !ok || respID != id {\n\t\t\tcontinue\n\t\t}\n\t\tif resp.Error != nil {\n\t\t\treturn fmt.Errorf(\"%s: %s\", method, strings.TrimSpace(resp.Error.Message))\n\t\t}\n\t\tif out != nil {\n\t\t\tif err := json.Unmarshal(resp.Result, out); err != nil {\n\t\t\t\treturn fmt.Errorf(\"%s decode response: %w\", method, err)\n\t\t\t}\n\t\t}\n\t\treturn nil\n\t}\n}\n\nfunc rpcNotifyOverIO(stdin io.Writer, method string, params any) error {\n\tpayload := map[string]any{\n\t\t\"jsonrpc\": \"2.0\",\n\t\t\"method\":  method,\n\t\t\"params\":  params,\n\t}\n\treturn writeRPCMessage(stdin, payload)\n}","sourceCodeStart":738,"sourceCodeEnd":774,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/agent/codex/session.go#L738-L774","documentation":"rpcRequestOverIO matched the JSON-RPC response to its request id, but the response carried a non-null `error` field; the server-side error message is returned prefixed with the RPC method name. This is an application-level error reported by the codex app-server itself for the requested method.","triggerScenarios":"A JSON-RPC response with matching id contains resp.Error != nil; the trimmed Error.Message is surfaced as `\"<method>: <message>\"` to the caller (loadCodexRuntimeConfig).","commonSituations":"Calling an RPC method unsupported by the installed codex version (method-not-found style errors); the app-server rejects the initialize params (bad protocol version, malformed capabilities); auth/quota errors returned over RPC.","solutions":["Read the embedded message after the method prefix — it states exactly why the server rejected the call.","Update the Codex CLI so the app-server supports the RPC methods/params the connector sends.","Re-authenticate (`codex login`) if the message indicates missing or expired credentials.","Retry later for rate-limit/quota-style messages.","Check the app-server's stderr logs for the full error context around the failing method."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// check version compatibility before RPC\ncodecVersion := queryCodexVersion(cfg.Command) // `codex --version`\nif semver.Compare(codecVersion, minSupported) < 0 {\n    return fmt.Errorf(\"codex %s too old for app-server RPC; need >= %s\", codecVersion, minSupported)\n}","typeGuard":null,"tryCatchPattern":"err := rpcRequestOverIO(stdin, stdout, ctx, \"initialize\", params, &out)\nif err != nil && isMethodLevelError(err) {\n    // message after the method prefix explains the server-side rejection\n    slog.Warn(\"app-server rejected method\", \"detail\", err)\n    // fallback: use defaults instead of runtime config\n}","preventionTips":["Keep codex and cc-connect versions in sync (both upgrade together)","Read the embedded server message — it names the exact rejection reason","Fall back to default runtime config when the RPC is rejected so the session can still start","Re-authenticate when the message references credentials or quotas"],"tags":["codex","json-rpc","rpc-error","upstream"],"backgroundTag":"upstream-api-error","analyzedSha":"4000b2338aa6e850c99df54f8b0ed6ed7460b401","analyzedAt":"2026-09-06T11:45:09.575Z","contentChangedAt":"2026-09-06T11:45:09.575Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}