memorize(): make delivery resumable per memcell so retries and replays are idempotent
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
Research direction
Start with service/memorize.py and service/_boundary.py, then trace markdown entry ID generation and OME dispatch. The issue describes the pending per-memcell delivery state, resume path, deterministic downstream IDs, event deduplication, and retry changes needed. Done means retries resume pending memcells without duplicating entries or events; the suggested boundary-call retry is only a smaller first step.
Written by the indexing model from the issue text.
Description
Why
memorize() is not atomic: boundary detection writes the memcell and consumes
the session buffer, then episode extraction and the OME pipelines run. A
failure after that point cannot be retried safely today:
- re-running an
/addcuts a second memcell from the same messages; - re-running a
/flushfinds an empty buffer and does nothing, leaving the
memcell without its episode.
This is why the async_mode queue (branch feat/memorize-async-mode, PR to follow) ships with max_attempts = 1 and
documents crash recovery as at-least-once. The same limitation applies to
synchronous clients that retry a 5xx.
What the cloud engine does
Replays are idempotent there because three things line up:
- the unit of retry is the memcell, not the add request: the memcell is
persisted with a "not yet dispatched" marker and an orphan re-dispatch
sweep resumes from it instead of re-running boundary detection; - downstream ids are deterministic (
entry_id = <prefix>_<memcell_id>_<subject>_<idx>
with a unique index; cluster ids are hashes), so a replay overwrites
instead of appending; - OME runs at-least-once on top of 1 and 2.
What EverOS would need
- a per-memcell delivery state on
memcell(written with the memcell, cleared
when every pipeline finished) and a resume entry point that runs only the
pipelines for memcells still marked pending; - episode / derived-entry ids derived from the memcell (today
ep_<date>_<seq>),
or a "memcell already has its entry" check in the markdown writer; - OME event dedup keyed by memcell id;
- the queue (and the sync path's error mapping) switched to "retry = resume
pending memcells" instead of "re-run the request".
Touches service/memorize.py, service/_boundary.py, the markdown entry id
scheme and OME dispatch; larger than the queue feature itself, so a separate
change.
Possible first step (small)
Retry only failures that happen before anything is written: wrap the boundary
LLM call (_boundary.py, the _detect call) in a typed error, let the queue
retry only that type (max_attempts back to 3 for it), and map it to 503 on
the sync path. Covers the most common failure (LLM down / rate-limited)
without any duplication risk. Roughly a dozen lines.
- Dominant language
- Python
- Stars
- 13.3k
- Forks
- 926
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 57
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from EverMind-AI/EverOS
-
Difficulty 2/5 Half a day Newbie friendliness 62/100
EverMind-AI/EverOS#414 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 18/100
EverMind-AI/EverOS#629 · 1 comment ·
Maintainers usually reply within 1 day
-
[Bug] _validate rejects LLM replies wrapped in a markdown code fence; json_object/prompt_only unusable with fence-emitting modelsPossibly taken @2030XiaoGe claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 22/100
EverMind-AI/EverOS#627 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
EverMind-AI/EverOS#558 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
EverMind-AI/EverOS#485 ·
Maintainers usually reply within 1 day
All issues in EverMind-AI/EverOS
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
ActivityWatch/docs#223 ·
-
[Bug]: OpenCode v2 skips an assistant message that gains text after an earlier capturePossibly taken @jianyx1 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
volcengine/OpenViking#8354 ·
Maintainers usually reply within 1 day
-
comp/tools P2 tool/skills type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
NousResearch/hermes-agent#159541 ·
Maintainers usually reply within 1 day
-
bot-triaged module: correctness (silent) module: cpu module: empty tensor module: loss triage review
Difficulty 1/5 Under an hour Newbie friendliness 80/100
Maintainers usually reply within 1 day
-
request-theme
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
LizardByte/ThemerrDB#10167 · 1 comment ·