{"record":{"id":"2bfa45dd90beaa40","repo":"router-for-me/CLIProxyAPI","slug":"decode-codex-live-media-relay-disable-private-remo","errorCode":null,"errorMessage":"decode codex.live-media-relay.disable-private-remote-ips: %w","messagePattern":"decode codex\\.live-media-relay\\.disable-private-remote-ips: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/config/codex_live.go","lineNumber":40,"sourceCode":"\tif errDecode := value.Decode(&decoded); errDecode != nil {\n\t\treturn errDecode\n\t}\n\tvar allowPrivate *bool\n\tvar disablePrivate *bool\n\tif value.Kind == yaml.MappingNode {\n\t\tfor index := 0; index+1 < len(value.Content); index += 2 {\n\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 {","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/router-for-me/CLIProxyAPI/blob/78f0c4079e3e6273d65d03b5549cffc898703264/internal/config/codex_live.go#L22-L58","documentation":"Same decode step for the current key disable-private-remote-ips: its YAML value is not a boolean. Note the decoder is strict — YAML 1.1-style truthiness like 'yes'/'no'/'on' is not accepted as bool by gopkg.in/yaml.v3.","triggerScenarios":"codex.live-media-relay.disable-private-remote-ips is set to a non-bool (string 'true', 1, list, map), so value.Content[index+1].Decode(&setting) fails.","commonSituations":"Quoted '\"false\"' from env-substituted templates; using yes/no expecting YAML 1.1 coercion; indentation mistake nesting another key under it.","solutions":["Use a bare boolean: disable-private-remote-ips: false.","Remove quotes introduced by env interpolation (e.g. ${VAR:-false} rendering as a string).","Validate the rendered config YAML with a schema or 'go run' dry-load before starting the server."],"exampleFix":"# before\ndisable-private-remote-ips: \"true\"\n\n# after\ndisable-private-remote-ips: true","handlingStrategy":"validation","validationCode":"# Render template then check the value is a bool\npython3 -c \"import yaml,sys; v=yaml.safe_load(open('config.yaml'))['codex']['live-media-relay']['disable-private-remote-ips']; assert isinstance(v,bool), type(v)\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["yaml.v3 is strict: yes/no/on/off are strings, not booleans — always write true/false.","Avoid quoting values that come from env interpolation."],"tags":["config","yaml","codex-live","type-error"],"backgroundTag":null,"analyzedSha":"78f0c4079e3e6273d65d03b5549cffc898703264","analyzedAt":"2026-08-15T12:26:37.444Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}