Skip to content

feat(sharing): make share-all / batch-share caps configurable#23

Merged
yhyyz merged 1 commit into
ourmem:mainfrom
doctatortot:feat/lift-share-caps
May 21, 2026
Merged

feat(sharing): make share-all / batch-share caps configurable#23
yhyyz merged 1 commit into
ourmem:mainfrom
doctatortot:feat/lift-share-caps

Conversation

@doctatortot
Copy link
Copy Markdown
Contributor

Problem

share-all / share-all-to-user cap at 5000 memories per call and batch-share / org-publish at 500, as hardcoded hard rejects. For larger spaces you must split into multiple calls.

Finding

Both paths already process via bounded-concurrency streams (buffer_unordered(10)), and share-all loads all candidates via list_all_active() regardless of the cap. So the caps are arbitrary count limits, not load protection.

Change

Make them configurable (matching the existing config.rs env-var convention):

  • OMEM_SHARE_ALL_MAX (default 5000) — share-all + share-all-to-user
  • OMEM_BATCH_SHARE_MAX (default 500) — batch-share + org/publish
  • 0 = unlimited.

No default behavior change — defaults equal the previous hardcoded values; operators raise/disable as needed. Concurrency stays bounded by buffer_unordered(10).

Docs

.env.example + docs/SHARING.md (the two limitation entries now read "configurable").

Tests

config_defaults_are_valid asserts the new defaults; full suite green (388 passed); fmt + clippy clean (no new warnings).

The 5000 (share-all, share-all-to-user) and 500 (batch-share, org/publish)
per-call caps were hardcoded hard rejects. Both paths already process via
bounded-concurrency streams (buffer_unordered(10)), and share-all loads all
candidates via list_all_active() regardless of the cap -- so the caps are
arbitrary count limits, not load protection.

Make them configurable: OMEM_SHARE_ALL_MAX (default 5000) and
OMEM_BATCH_SHARE_MAX (default 500); 0 = unlimited. Defaults equal the previous
hardcoded values, so there is no default behavior change -- operators can raise
or disable the caps for larger spaces.

Docs: .env.example + docs/SHARING.md updated.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@yhyyz yhyyz merged commit 6b8a87d into ourmem:main May 21, 2026
1 check passed
@yhyyz
Copy link
Copy Markdown
Contributor

yhyyz commented May 21, 2026

Merged — thanks! Clean and uncontroversial. 👍

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.

2 participants