feat: validate plugin config schema#22
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 50453f1682
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| payload = json.loads(config_path.read_text(encoding="utf-8")) | ||
| if not isinstance(payload, dict): | ||
| raise ValueError("Plugin config must be a JSON object.") | ||
| validate_plugin_config_payload(payload) |
There was a problem hiding this comment.
Avoid hard-failing plugin config when jsonschema is absent
This unconditional call introduces a runtime regression for plugin discovery: any user with a plugin_config.json (or POP_PLUGIN_CONFIG_FILE) now fails immediately if jsonschema is not installed, even though jsonschema is only an optional extra dependency. In a default environment, this blocks all file-based plugin loading paths that previously worked, so discovery should either gracefully skip schema validation when the extra is missing or make the dependency mandatory for this workflow.
Useful? React with 👍 / 👎.
Summary
plugin_config.schema.jsonand validate file-based plugin config during discovery loadingpop-persona[schema]requirement for config validation in the README and example configValidation
python3 -m compileall demos/discovery.py demos/task_registry.py demos/persona_workflow_demo.pypython3 - <<'PY' ... load_plugin_config("plugin_config.example.json") ... PYpython3 - <<'PY' ... load_plugin_config("/tmp/invalid_plugin_config.json") ... PYpython3 demos/persona_workflow_demo.pyPOP_PLUGIN_CONFIG_FILE=/tmp/pop_demo_plugins/plugin_config.json python3 demos/persona_workflow_demo.py --task-input /tmp/content_strategy_task.json