Skip to content

[tech-debt] plugins: consolidate three competing architectures + dedupe Structured (defined 7 times with drift) #8559

Closed

Description

@Git-on-my-level

Problem

plugins/ hosts three competing plugin architectures with no shared contract:

  1. Legacy monolith in plugins/main.py — 8 routers (_multion, basic, oauth, zapier, chatgpt, subscription, notifications/hey_omi, iq_rating). Half the imports commented out with # @DEPRECATED. _mem0/ and _multion/ only contain a single router.py each — scaffolding, not plugins.
  2. Per-app FastAPI services — 28 omi-*-app/ directories, each with own Dockerfile/Procfile/railway.toml, deployed separately. NOT registered in plugins/main.py. Storage layer inconsistent: some use simple_storage.py, some use db.py+models.py.
  3. plugins/apps-js/ — a Node.js app (OmiSend: email + presentations + Gmail + Supabase + SlidesGPT) in a completely different stack.

Symptom: the Structured conversation shape is defined 7 separate times with field drift:

  • plugins/models.py:8
  • plugins/omi-linear-app/models.py:140
  • plugins/omi-shopify-app/models.py:166
  • plugins/omi-hive-app/models.py:140
  • plugins/omi-shipbob-app/models.py:108
  • plugins/omi-dropbox-app/models.py:50 (already drifted: adds action_items: List[ActionItem] = [] that the others don't)
  • backend/models/structured.py:76 (source of truth)

Same pattern for ActionItem, Event, ConversationPhoto.

Evidence

$ ls plugins/ | grep -c "omi-.*-app"
28

$ grep -rln "^class Structured" plugins/
plugins/models.py
plugins/omi-linear-app/models.py
plugins/omi-shopify-app/models.py
plugins/omi-hive-app/models.py
plugins/omi-shipbob-app/models.py
plugins/omi-dropbox-app/models.py

Scope of this PR (one coherent change — single large refactor)

  • Extract a shared omi-plugin-sdk Python package (models, storage interface, auth helper, webhook sender) and have all Python omi-*-app/ plugins depend on it via path or git dependency.
  • Replace the 7 Structured copies with imports from the SDK; fix the dropbox drift.
  • Delete the legacy monolith (plugins/main.py) and scaffolding dirs (_mem0/, _multion/) once confirmed unused — verify against actual deploy targets first.
  • Decide explicitly whether apps-js/ stays Node.js (and gets its own typed contract) or gets ported.

Acceptance criteria

  • class Structured is defined exactly once (in backend/models/ or the new SDK).
  • All Python plugins consume the shared SDK; storage layer is consistent.
  • Legacy monolith is removed or explicitly documented as kept.

Out of scope


Part of a tech-debt / agent-friendliness audit. Filed via Claude Code.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions