Skip to content

feat(memory-islands): rewrite plugin with modular mixin architecture and OWUI compatibility fixes - #13

Open
skorphil wants to merge 3 commits into
trunkfrom
feat/memory-islands-modular-rewrite
Open

feat(memory-islands): rewrite plugin with modular mixin architecture and OWUI compatibility fixes#13
skorphil wants to merge 3 commits into
trunkfrom
feat/memory-islands-modular-rewrite

Conversation

@skorphil

@skorphil skorphil commented Aug 17, 2026

Copy link
Copy Markdown
Member

Summary

Complete rewrite of the Memory Islands plugin following the repo's modular mixin architecture and fixing OWUI compatibility blockers from the previous incomplete attempt.

Changes

src/ — Modular mixin layout (built by build.py)

  • meta.py — metadata frontmatter; requirements updated to pydantic, httpx
  • _valves.py — admin Valves reduced to the four real settings (ISOLATE_BY_DEFAULT, AUTO_LEARN_MEMORIES, ENABLE_UPDATE_NOTIFICATIONS, CHECK_PREVIEW_RELEASES); removed dead PRIORITY and INHERIT_FROM_PARENT
  • _database.py (new) — DatabaseMixin with all SQLite helpers, now persisted under a stable DATA_DIR (defaults to ~/.openwebui/memory-islands/) instead of the plugin directory
  • _filters.py (new) — FilterMixin with inlet/outlet, payload-first folder resolution with Chats model fallback, memory learning and injection
  • _commands.py (new) — CommandsMixin slash-command handler (/island-*)
  • _updates.py — background update check mixin with memory-islands/ release tag prefix
  • main.pyFilter entry point inheriting all mixins

OWUI compatibility fixes

  • Folder resolution now reads folder_id from the filter payload first (modern OWUI), falling back to the Chats model instead of directly scraping webui.db (which broke under the new OWUI DB layout)
  • DB is created under DATA_DIR (respected by OWUI deployments) rather than the read-only plugin install path
  • Memory learning deduplicates facts and caps at _MAX_FACTS

Tests

  • tests/test_memory_islands.py — module-level pytestmark = pytest.mark.unit; DATA_DIR pointed at tmp_path in fixtures so the real home dir is never touched; TestFolderResolution rewritten for the new async payload/Chats-fallback API; async _resolve_folder patched with AsyncMock; valve references updated to UPPER_SNAKE names
  • tests/test_integration.py — valve spec/update assertions updated to the four real UPPER_SNAKE valve names

Verification

  • uv run python build.py — passes (ruff check, format, unit tests, merge, integration skip)
  • uv run pytest plugins/memory-islands/tests/ -m unit -v28 passed, 1 skipped
  • uv run pytest plugins/memory-islands/tests/ -v28 passed, 1 skipped (integration module-skips without container)

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.

1 participant