{"record":{"id":"a2101e2b5b06081f","repo":"router-for-me/CLIProxyAPI","slug":"codex-live-media-relay-cannot-set-both-allow-priva","errorCode":null,"errorMessage":"codex.live-media-relay cannot set both allow-private-remote-ips and disable-private-remote-ips","messagePattern":"codex\\.live-media-relay cannot set both allow-private-remote-ips and disable-private-remote-ips","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/config/codex_live.go","lineNumber":47,"sourceCode":"\t\t\tkey := value.Content[index].Value\n\t\t\tswitch key {\n\t\t\tcase \"allow-private-remote-ips\":\n\t\t\t\tvar setting bool\n\t\t\t\tif errDecode := value.Content[index+1].Decode(&setting); errDecode != nil {\n\t\t\t\t\treturn fmt.Errorf(\"decode codex.live-media-relay.allow-private-remote-ips: %w\", errDecode)\n\t\t\t\t}\n\t\t\t\tallowPrivate = &setting\n\t\t\tcase \"disable-private-remote-ips\":\n\t\t\t\tvar setting bool\n\t\t\t\tif errDecode := value.Content[index+1].Decode(&setting); errDecode != nil {\n\t\t\t\t\treturn fmt.Errorf(\"decode codex.live-media-relay.disable-private-remote-ips: %w\", errDecode)\n\t\t\t\t}\n\t\t\t\tdisablePrivate = &setting\n\t\t\t}\n\t\t}\n\t}\n\tif allowPrivate != nil && disablePrivate != nil {\n\t\treturn errors.New(\"codex.live-media-relay cannot set both allow-private-remote-ips and disable-private-remote-ips\")\n\t}\n\tif allowPrivate != nil {\n\t\tdecoded.DisablePrivateRemoteIPs = !*allowPrivate\n\t\tlog.Warn(\"codex.live-media-relay.allow-private-remote-ips is deprecated; use disable-private-remote-ips with the inverse value\")\n\t}\n\t*c = CodexLiveMediaRelayConfig(decoded)\n\treturn nil\n}\n\n// EffectiveMaxSessions returns the configured media session limit.\nfunc (c CodexLiveMediaRelayConfig) EffectiveMaxSessions() int {\n\tif c.MaxSessions > 0 {\n\t\treturn c.MaxSessions\n\t}\n\treturn DefaultCodexLiveMediaMaxSessions\n}\n\n// Validate verifies the Codex Live media relay configuration.","sourceCodeStart":29,"sourceCodeEnd":65,"githubUrl":"https://github.com/router-for-me/CLIProxyAPI/blob/78f0c4079e3e6273d65d03b5549cffc898703264/internal/config/codex_live.go#L29-L65","documentation":"Configuration decode error for codex.live-media-relay: both the deprecated allow-private-remote-ips key and its replacement disable-private-remote-ips were present in the same relay block. Because one is the boolean inverse of the other, setting both is ambiguous, so the decoder rejects the combination instead of guessing precedence.","triggerScenarios":"A config.yaml (or KDL config) codex.live-media-relay map containing both allow-private-remote-ips: <bool> and disable-private-remote-ips: <bool>.","commonSituations":"Migrating an old config to the new key name and forgetting to delete the deprecated line; merging config templates where both keys survived.","solutions":["Open the config file, find the codex.live-media-relay block, and delete allow-private-remote-ips","Keep disable-private-remote-ips with the inverse boolean value of the old key (allow-private: true becomes disable-private: false)","Reload/restart the server and confirm the deprecation warning no longer appears"],"exampleFix":"# before\ncodex:\n  live-media-relay:\n    allow-private-remote-ips: false\n    disable-private-remote-ips: true\n# after\ncodex:\n  live-media-relay:\n    disable-private-remote-ips: true","handlingStrategy":"validation","validationCode":"# Pre-flight config check before starting the server\ngrep -n 'allow-private-remote-ips' config.yaml && grep -n 'disable-private-remote-ips' config.yaml && echo \"ERROR: both keys set\" || echo OK","typeGuard":null,"tryCatchPattern":"// If loading config programmatically:\nif err := cfg.Codex.LiveMediaRelay.UnmarshalKDL(node); err != nil {\n    if strings.Contains(err.Error(), \"cannot set both allow-private-remote-ips and disable-private-remote-ips\") {\n        log.Fatal(\"remove the deprecated allow-private-remote-ips key from codex.live-media-relay\")\n    }\n    return err\n}","preventionTips":["Finish deprecation migrations in one commit: add the new key, delete the old one","Lint config files for known-deprecated keys in CI","Note the inversion: allow-private-remote-ips: false equals disable-private-remote-ips: true"],"tags":["config","codex","media-relay","deprecation"],"backgroundTag":null,"analyzedSha":"78f0c4079e3e6273d65d03b5549cffc898703264","analyzedAt":"2026-08-15T12:26:37.444Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}