Skip to content

chore: remove plugin system divergence with upstream #391

@randomm

Description

@randomm

What

Restore upstream's complete plugin system and remove our simplified fork variant.

Why

Our fork stripped out 6 plugin files (~1505 lines) to simplify the plugin loading system. This divergence:

  • Is NOT tracked in .fork-features/manifest.json
  • Provides no value to our fork (removed plugins are for Poe/Cloudflare which we don't use)
  • Causes pain during every upstream sync (merge conflicts, manual reconciliation)
  • Violates our principle: "Keep divergence only in areas where there is value"

Scope

Restore these deleted files:

  • packages/opencode/src/plugin/cloudflare.ts (67 lines)
  • packages/opencode/src/plugin/install.ts (439 lines)
  • packages/opencode/src/plugin/loader.ts (174 lines)
  • packages/opencode/src/plugin/meta.ts (188 lines)
  • packages/opencode/src/plugin/shared.ts (323 lines)
  • packages/opencode/src/plugin/github-copilot/models.ts (144 lines)

Restore directory structure:

  • packages/opencode/src/plugin/github-copilot/ directory with copilot.ts and models.ts

Update these files to match upstream:

  • packages/opencode/src/plugin/index.ts (currently 138 lines vs upstream ~290)
  • packages/opencode/src/plugin/codex.ts
  • packages/opencode/src/plugin/copilot.ts

No dependency changes required:

  • Neither fork uses effect as a direct package.json dependency
  • All required packages already present

Acceptance Criteria

  • All 6 deleted files restored from upstream anomalyco/dev
  • Plugin directory structure matches upstream (9 files total)
  • plugin/index.ts restored to upstream version
  • All existing auth flows still work (Codex, Copilot, GitLab)
  • bun test passes (plugin-related tests)
  • .fork-features/manifest.json does NOT need an entry (divergence removed, not added)
  • git diff anomalyco/dev -- packages/opencode/src/plugin/ shows minimal/no differences

Out of Scope

  • Adding new plugins (Poe, Cloudflare) — we're just restoring infrastructure, not enabling unused features
  • Changing plugin loading behavior — should match upstream exactly
  • User-facing changes — this is internal refactoring

Definition of Done

  • Code restored and matches upstream
  • Tests passing
  • No new fork divergence introduced
  • Upstream sync pain point eliminated for this module

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions