Skip to content

pr-review plugin: agent_script.py should use Plugin.load() instead of manual skill loading #136

@xingyaoww

Description

@xingyaoww

Problem

The pr-review plugin's agent_script.py loads skills manually via load_project_skills() and passes them directly to AgentContext:

project_skills = load_project_skills(cwd)
agent_context = AgentContext(load_public_skills=True, skills=project_skills)
agent = Agent(llm=llm, tools=tools, agent_context=agent_context, ...)
conversation = Conversation(agent=agent, workspace=cwd, secrets=secrets)

This bypasses the SDK's Plugin system, which provides a proper way to load bundled skills, hooks, and MCP config together via Plugin.load():

from openhands.sdk.plugin import Plugin

plugin = Plugin.load('/path/to/plugin')
agent_context = AgentContext(skills=plugin.skills)
agent = Agent(llm=llm, tools=tools, mcp_config=plugin.mcp_config or {}, agent_context=agent_context)
conversation = Conversation(agent=agent, hook_config=plugin.hooks)

Impact

  • The pr-review plugin's skills/ directory (which contains symlinks to codereview-roasted and github-pr-review) is never loaded via the Plugin system.
  • Any hooks or MCP config added to the plugin in the future would be silently ignored.
  • The plugin directory also lacks a .plugin/plugin.json manifest, which is required by Plugin.load().

Suggested Fix

  1. Add .plugin/plugin.json manifest to plugins/pr-review/
  2. Update agent_script.py to use Plugin.load() for the pr-review plugin itself
  3. Combine plugin skills with project skills before passing to AgentContext
  4. Pass plugin.hooks and plugin.mcp_config to Conversation and Agent respectively

The new qa-changes plugin (#135) already follows this pattern and can be used as a reference.

This issue was created by an AI assistant (OpenHands).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions