OpenViking icon indicating copy to clipboard operation
OpenViking copied to clipboard

[Bug]: not confirm empty message.jsonl state before commit return

Open wychosenone opened this issue 7 months ago • 1 comments

Bug Description

so right now when archive finished, .done will determine completed archive. however sometimes the live service will cause root live empty operation not actually in the disk, causing later /context still regard old messages as active messages to insert.

Steps to Reproduce

official behavior:

  1. commit Phase 1 empty root live
  2. write archive/messages.jsonl
  3. Phase 2 generate .abstract.md
  4. Phase 2 generate .overview.md
  5. Phase 2 write .meta.json
  6. finally write .done

Expected Behavior

might need check:

archive_xxx/messages.jsonl exists archive_xxx/.done exists archive_xxx/.abstract.md exists archive_xxx/.overview.md exists root/messages.jsonl already empty or left out later added messages already empty or left out after commit messages .meta.json message_count and root , have same rows.

Actual Behavior

old messages being inserted to active messages

Minimal Reproducible Example


Error Logs


OpenViking Version

0.3.8

Python Version

3.10

Operating System

Linux

Model Backend

None

Additional Context

No response

wychosenone avatar Apr 16 '26 07:04 wychosenone

Thanks for reporting this! The commit path has changed since v0.3.8. It now reloads the live messages under the Session lock, waits for the retained messages.jsonl and metadata writes, and only then publishes the Phase 1 ready marker and returns. Interrupted Phase 1 recovery checks the persisted message IDs before allowing background extraction to proceed.

This behavior was introduced in #3380. The current tests for concurrent commits, root-write failures, and recovery before/after the root rewrite all pass. Closing this as resolved in the current implementation.

qin-ctx avatar Oct 15 '26 13:10 qin-ctx