Skip to content

feat: validate plugin config schema#22

Merged
joy7758 merged 2 commits intoplugin-config-filefrom
plugin-config-schema
Mar 15, 2026
Merged

feat: validate plugin config schema#22
joy7758 merged 2 commits intoplugin-config-filefrom
plugin-config-schema

Conversation

@joy7758
Copy link
Owner

@joy7758 joy7758 commented Mar 15, 2026

Summary

  • add plugin_config.schema.json and validate file-based plugin config during discovery loading
  • surface clearer config errors with schema paths instead of failing later during plugin import
  • document the schema and pop-persona[schema] requirement for config validation in the README and example config

Validation

  • python3 -m compileall demos/discovery.py demos/task_registry.py demos/persona_workflow_demo.py
  • python3 - <<'PY' ... load_plugin_config("plugin_config.example.json") ... PY
  • python3 - <<'PY' ... load_plugin_config("/tmp/invalid_plugin_config.json") ... PY
  • python3 demos/persona_workflow_demo.py
  • POP_PLUGIN_CONFIG_FILE=/tmp/pop_demo_plugins/plugin_config.json python3 demos/persona_workflow_demo.py --task-input /tmp/content_strategy_task.json

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@joy7758 joy7758 merged commit 715a914 into plugin-config-file Mar 15, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant