MCPcopy
hub / github.com/openai/plugins / capability_preflight_input

Function capability_preflight_input

plugins/codex-security/scripts/workbench_db.py:639–650  ·  view source on GitHub ↗
(value: str | None, path: Path | None)

Source from the content-addressed store, hash-verified

637
638
639def capability_preflight_input(value: str | None, path: Path | None) -> str | None:
640 if path is None:
641 return value
642 try:
643 if path.stat().st_size > MAX_CAPABILITY_PREFLIGHT_INPUT_JSON_BYTES:
644 raise SystemExit(
645 "Capability preflight must be no larger than "
646 f"{MAX_CAPABILITY_PREFLIGHT_INPUT_JSON_BYTES} bytes."
647 )
648 return path.read_text(encoding="utf-8")
649 except (OSError, UnicodeError) as exc:
650 raise SystemExit("Capability preflight JSON file could not be read as UTF-8.") from exc
651
652
653def _require_object_keys(

Callers 2

create_workspaceFunction · 0.85
set_capability_preflightFunction · 0.85

Calls 1

statMethod · 0.80

Tested by

no test coverage detected