Skip to content

feat(plugins): entry-point plugin architecture for tasks and agents (#59)#84

Open
trixy-the-ai-bot wants to merge 3 commits into
mainfrom
feat/plugin-architecture-59
Open

feat(plugins): entry-point plugin architecture for tasks and agents (#59)#84
trixy-the-ai-bot wants to merge 3 commits into
mainfrom
feat/plugin-architecture-59

Conversation

@trixy-the-ai-bot
Copy link
Copy Markdown
Collaborator

Summary

Implements the plugin architecture described in #59 using Python's importlib.metadata entry points.

  • loony_dev/plugins/base.pyTaskPlugin and AgentPlugin ABCs plus PluginConflictError
  • loony_dev/plugins/loader.py — discovers plugins from entry point groups loony_dev.task_plugins and loony_dev.agent_plugins; isolates per-plugin load failures; raises loudly on name or task-type conflicts
  • loony_dev/tasks/plugins.pyGithubTaskPlugin wrapping all six built-in task classes
  • loony_dev/agents/plugins.pyClaudeAgentPlugin wrapping NullAgent, CodingAgent, PlanningAgent
  • orchestrator.pyOrchestrator now accepts an injected task_classes list; hard-coded TASK_CLASSES removed
  • cli.pyworker command calls load_task_plugins() / load_agent_plugins() instead of hard-coded lists
  • pyproject.toml — registers built-in github and claude plugins under the new entry point groups

Plugin authoring workflow

  1. Create a package with pyproject.toml declaring the entry point group
  2. Subclass Task/Agent from loony_dev
  3. Wrap in TaskPlugin or AgentPlugin
  4. uv pip install -e . — the loony-dev worker command auto-discovers it

For iteration without reinstalling: set LOONY_DEV_EXTRA_PLUGINS=module:ClassName.

Test plan

  • load_task_plugins() returns all six built-in task classes in priority order
  • load_agent_plugins() returns NullAgent, CodingAgent, PlanningAgent
  • TaskPlugin and AgentPlugin ABCs enforce name and primary method as abstract
  • PluginConflictError is an Exception subclass
  • uv pip install -e . registers entry points; verified with live importlib.metadata.entry_points()

Closes #59

🤖 Generated with Claude Code

…ts (#59)

Replaces hard-coded TASK_CLASSES and agents lists with a dynamic plugin
discovery system using importlib.metadata entry points.

New modules:
- loony_dev/plugins/base.py: TaskPlugin and AgentPlugin ABCs, PluginConflictError
- loony_dev/plugins/loader.py: entry-point discovery with per-plugin failure
  isolation and loud conflict detection (name clashes, duplicate task_type)
- loony_dev/tasks/plugins.py: GithubTaskPlugin wrapping all six built-in task classes
- loony_dev/agents/plugins.py: ClaudeAgentPlugin wrapping NullAgent, CodingAgent, PlanningAgent

Modified:
- orchestrator.py: accepts injected task_classes list; removed hard-coded TASK_CLASSES
- cli.py: calls load_task_plugins() / load_agent_plugins() instead of hard-coded lists
- pyproject.toml: registers loony_dev.task_plugins and loony_dev.agent_plugins entry point groups

Third-party plugin authors can now add tasks and agents by declaring entry
points in their own pyproject.toml and running pip install -e . For local
development without reinstalling, set LOONY_DEV_EXTRA_PLUGINS=module:Class.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@trixy-the-ai-bot
Copy link
Copy Markdown
Collaborator Author

Merge conflicts resolved.

A merge conflict in loony_dev/cli.py was resolved by combining changes from two branches: the detect_default_branch() logic and default_branch parameter from PR #85 (main), and the dynamic load_task_plugins() / load_agent_plugins() calls from the plugin branch. The resolved merge commit was pushed to feat/plugin-architecture-59.

@trixy-the-ai-bot
Copy link
Copy Markdown
Collaborator Author

Merge conflicts resolved.

The merge conflict in loony_dev/orchestrator.py was resolved by reconciling two diverging import strategies. The branch's plugin architecture removes direct task class imports in favor of injected task_classes, while main had added new direct imports including RateLimitedError. The resolution kept RateLimitedError (still needed in dispatch()) and dropped the direct task class imports, with the merge commit pushed to feat/plugin-architecture-59.

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.

plugin architecture

2 participants