Skip to content

Conversation

@jpshackelford
Copy link
Contributor

Summary

Add documentation for the recommended pattern of loading plugins via AgentContext.plugin_source. This documents the new example at examples/05_skills_and_plugins/03_plugin_via_agent_context/main.py in the agent-sdk repository.

Changes

  • Add "Recommended: Plugin Loading via AgentContext" section to sdk/guides/plugins.mdx
  • Rename existing "Loading Plugins" section to "Manual Plugin Loading"
  • Add notes explaining when to use each approach:
    • Recommended (via AgentContext): Simpler, consistent with agent-server API, automatic handling of all plugin components
    • Manual (via Plugin.load()): For advanced use cases requiring fine-grained control

The Recommended Pattern

# Create AgentContext with plugin source
agent_context = AgentContext(
    plugin_source="github:owner/repo",  # or local path
    plugin_ref="v1.0.0",  # optional
    plugin_path="plugins/sub",  # optional
)

# Create Agent - MCP config is merged automatically
agent = Agent(
    llm=llm,
    tools=[...],
    agent_context=agent_context,
)

# Create Conversation - hooks are extracted automatically
conversation = Conversation(
    agent=agent,
    workspace="./workspace",
)

Related

@jpshackelford can click here to continue refining the PR

Add documentation for the recommended pattern of loading plugins via
AgentContext.plugin_source. This pattern:
- Is consistent with the agent-server API
- Automatically handles all plugin components (skills, MCP config, hooks)
- Reduces boilerplate code

The existing Plugin.load() pattern is now documented as 'Manual Plugin Loading'
for advanced use cases requiring fine-grained control.

Related to: OpenHands/software-agent-sdk#1651

Co-authored-by: openhands <openhands@all-hands.dev>
@openhands-ai
Copy link

openhands-ai bot commented Jan 18, 2026

Looks like there are a few issues preventing this PR from being merged!

  • GitHub Actions are failing:
    • .github/workflows/sync-docs-code-blocks.yml
    • .github/workflows/sync-agent-sdk-openapi.yml

If you'd like me to help, just leave a comment, like

@OpenHands please fix the failing actions on PR #265 at branch `feat/plugin-via-agent-context-example`

Feel free to include any additional details that might help me get this PR into a better state.

You can manage your notification settings

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.

3 participants