feat(zotero): multi-library support + empty-content-skip - #1
Merged
Merged
Conversation
Embed an optional numeric library ID in the source string to allow
multiple Zotero libraries to be synced from a single daemon instance:
source: "zotero:123456:" # all collections in library 123456
source: "zotero:123456:Research%%ML" # specific collection
When a library ID is present the connector resolves credentials from
per-library env vars before falling back to the global defaults:
ZOTERO_API_KEY_<library_id> → ZOTERO_API_KEY
ZOTERO_LIBRARY_TYPE_<library_id> → ZOTERO_LIBRARY_TYPE
Existing source strings ("zotero:" or "zotero:Collection%%Sub") are
fully backward-compatible — collection names are not purely numeric so
there is no ambiguity when parsing.
Introduce _zotero_env(key, library_id, default) which checks
ZOTERO_<KEY>_<library_id> before falling back to ZOTERO_<KEY>. Apply
it uniformly to every configurable setting so that each source entry
in .oikb.yaml can be tuned independently when multiple libraries are
in use:
ZOTERO_CHECKSUM_<id> overrides ZOTERO_CHECKSUM
ZOTERO_INCLUDE_NOTES_<id> ZOTERO_INCLUDE_NOTES
ZOTERO_INCLUDE_ANNOTATIONS_<id> ZOTERO_INCLUDE_ANNOTATIONS
ZOTERO_LIBRARY_TYPE_<id> ZOTERO_LIBRARY_TYPE
ZOTERO_EXCLUDE_<id> ZOTERO_EXCLUDE
ZOTERO_UNFILED_DIR_<id> ZOTERO_UNFILED_DIR
ZOTERO_WEBDAV_{URL,USER,PASSWORD}_<id> ZOTERO_WEBDAV_*
Single-library setups are unaffected — the helper falls through to the
global vars unchanged.
Files with no extractable text (e.g. Zotero items with no fulltext and no downloadable PDF) were uploaded as zero-byte payloads, causing Open WebUI to reject them with EMPTY_CONTENT errors on every sync cycle. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Collaborator
Author
|
Also cherry-picked upstream open-webui#109 (@naamval — selective Zotero collection sync fix) onto this branch:
Attribution preserved via cherry-pick. |
psuckrow-routine
force-pushed
the
feat/multi-library-zotero
branch
from
September 1, 2026 15:47
1693f5b to
3decf23
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Continued from open-webui#93 — moved into the routinelabs org for compliance.
Summary
Three commits (unchanged from open-webui#93):
zotero:<library_id>:source URIs so one daemon can sync multiple Zotero libraries into different Knowledge Bases._zotero_envhelper — looks upZOTERO_API_KEY_<library_id>,ZOTERO_LIBRARY_TYPE_<library_id>, etc., falling back to the unsuffixed defaults.Context
Pinned in downstream via
pip install git+https://github.com/routinelabs/oikb@8c38d57(Dockerfile.oikb). Bothroutinelabsclients today rely on this fork for multi-library and empty-content-skip behavior.Upstream
Upstream PR still open at open-webui#93 for eventual merge back — this internal PR exists so we can iterate + carry the fork in-house without depending on the upstream review cadence.