Skip to content

V2: simplify plugin tool definitions and remove LM leakage from plugin package #36189

Closed

Description

@opencode-agent

Problem

The V2 plugin surface currently has a few API/packaging seams that make simple plugins harder than they should be and can leak internal package boundaries.

Decided direction

  • @opencode/plugin should not depend on or expose @opencode/lm internals.
  • Drop or defer the session request intercept hook if it is the only reason for the LM dependency.
  • If that hook returns later, expose session-shaped messages rather than LM provider-shaped messages.
  • tools.add should accept plain object tool definitions; plugin authors should not need tool.make ceremony.
  • Tool input/output should support JSON Schema / standard schema where appropriate.
  • Keep documented imports for now; no-import/global plugin API can be revisited later.

Source discussion: https://slack.com/archives/C0BE69AHCQP/p1783640722114279

Activity

  1. neriousy commented on Oct 21, 2026

    @neriousy
    Member

    Partly done: plugin tools are now plain objects with no tool.make, and accept Effect Schema, Standard Schema or JSON Schema (packages/schema/src/tool.ts). @opencode/plugin still depends on @opencode/ai, and the session hooks still expose provider-shaped messages. Closing this tracker. The dependency cleanup can be tracked separately if it's still wanted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions