Skip to content

Bug: Session Compressor continuously retries orphaned memory references (File not found) #1048

Closed

Description

@samuelleung1009

Environment:

  • OpenViking version: 0.2.9
  • Python 3.12
  • Local backend (vectordb + queue.fs)
  • OS: Ubuntu

Problem Description:

The session.compressor continuously logs errors for memory files that no longer exist. These orphaned references cause infinite retries.

Error Log (repeats every few minutes):

2026-03-28 08:56:47,907 - openviking.session.compressor - ERROR - Failed to merge memory viking://user/ClaudeCode/memories/entities/mem_5c5dde86-1ab3-4cde-aecd-fbde1485e242.md: File not found: viking://user/ClaudeCode/memories/entities/mem_5c5dde86-1ab3-4cde-aecd-fbde1485e242.md
2026-03-28 08:56:47,907 - openviking.session.compressor - ERROR - Failed to merge memory viking://user/ClaudeCode/memories/entities/mem_c7ca02db-4226-4c42-a638-48c7d2cc4e52.md: File not found: viking://user/ClaudeCode/memories/entities/mem_c7ca02db-4226-4c42-a638-48c7d2cc4e52.md
...

Affected URIs:

  • viking://user/ClaudeCode/memories/entities/mem_5c5dde86-*
  • viking://user/ClaudeCode/memories/entities/mem_c7ca02db-*
  • viking://user/ClaudeCode/memories/entities/mem_925acff6-*
  • viking://user/ClaudeCode/memories/entities/mem_ac207d28-*
  • viking://user/default/memories/entities/mem_5ddaedd4-*
  • viking://agent/593c73a6b8d0/memories/patterns/mem_a133eab7-*
  • viking://agent/593c73a6b8d0/memories/patterns/mem_3106ba58-*

Expected Behavior:
When a memory file is not found, the compressor should remove the orphaned reference from its tracking state instead of retrying indefinitely.

Actual Behavior:

  • Semantic Queue processes all pending items (0 pending, 0 errors shown in ov observer queue)
  • But session.compressor continues to retry the same missing files every few minutes
  • No way to clear these orphaned references via CLI (ov session, ov admin, ov system)

System Status:

[queue] (healthy) - 0 pending, 0 in progress
[vikingdb] (healthy) - 435 vectors
[system] (healthy)

Impact:

  • No functional impact on search/indexing
  • Logs are flooded with repeated error messages
  • Wastes CPU cycles on futile retry attempts

Activity

  1. self-assigned this
    on Mar 28, 2026
  2. qin-ctx commented on Mar 30, 2026

    @qin-ctx
    Collaborator

    Thanks for reporting this.

    From the current code path, the repeated retries themselves look like a real issue on our side: once a stale memory URI is still present in the vector index, the v1 session compressor can keep trying to merge it and log repeated "File not found" errors instead of cleaning it up automatically.

    To help narrow down how those stale references were introduced, could you confirm one detail: were any of these memory files manually deleted, moved, or cleaned up outside the normal OpenViking APIs/CLI before the repeated errors started?

    That would help us distinguish between:

    1. stale index records left behind after manual filesystem changes, and
    2. a consistency bug in OpenViking's own delete/update flow.
  3. samuelleung1009 commented on Apr 1, 2026

    @samuelleung1009
    Author

    感谢回复。

    关于那些过期的 memory 文件,我回忆了一下——应该是之前手动清理 session 文件夹里的 .reset.* 文件时,不小心把这些 memory 文件也一起删掉了。

    那时候 session reset 之后会产生很多归档文件,我想清理一下磁盘空间,就手动删了一些看起来是旧 session 的 reset 文件,可能把一些相关的 memory 文件也误删了。

    所以应该是第一种情况:手动文件系统操作后留下的过期索引记录,不是 OpenViking 自身删除流程的问题。

    这个问题目前对实际功能没有影响,但日志一直在刷错误,希望能在后续版本里修复。

  4. added a commit that references this issue on Apr 3, 2026
    f70e71b
  5. moved this from Backlog to In progress in OpenViking projecton Apr 3, 2026
  6. moved this from In progress to Done in OpenViking projecton Apr 5, 2026
  7. added a commit that references this issue on Apr 5, 2026
    2255289
  8. added 2 commits that reference this issue on Apr 11, 2026
    8e628b2
    95ddc7c
  9. added a commit that references this issue on Oct 9, 2026
    d327f13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions