MCPcopy Create free account
hub / github.com/openai/plugins / lookup_config_value

Function lookup_config_value

plugins/codex-security/scripts/config_preflight.py:293–310  ·  view source on GitHub ↗
(
    path: str,
    *,
    config_layers: list[tuple[Path, dict[str, Any]]],
    effective_config: dict[str, Any],
    config_profile: str | None,
    default: Any = None,
    has_default: bool = False,
)

Source from the content-addressed store, hash-verified

291
292
293def lookup_config_value(
294 path: str,
295 *,
296 config_layers: list[tuple[Path, dict[str, Any]]],
297 effective_config: dict[str, Any],
298 config_profile: str | None,
299 default: Any = None,
300 has_default: bool = False,
301) -> tuple[bool, Any, str | None]:
302 if path in effective_config:
303 return True, effective_config[path], "effective-config"
304 for source, config in iter_config_views(config_layers, config_profile):
305 found, actual = lookup_dotted(config, path)
306 if found:
307 return True, actual, source
308 if has_default:
309 return True, default, "documented-default"
310 return False, None, None
311
312
313def resolve_active_config_profile(

Callers 3

evaluate_requirementFunction · 0.85

Calls 2

iter_config_viewsFunction · 0.85
lookup_dottedFunction · 0.85

Tested by

no test coverage detected