Skip to content

fix(memory): preserve watched file mtimes - #650

Merged
andreapn merged 1 commit into
use-agent-os:mainfrom
BunnyTeddy:codex/fix-kb-source-mtime
Sep 1, 2026
Merged

fix(memory): preserve watched file mtimes#650
andreapn merged 1 commit into
use-agent-os:mainfrom
BunnyTeddy:codex/fix-kb-source-mtime

Conversation

@BunnyTeddy

@BunnyTeddy BunnyTeddy commented Aug 30, 2026

Copy link
Copy Markdown

Fixes #649

Summary

MemorySyncManager now passes the filesystem mtime already captured by its watcher to LongTermMemoryStore.index_file() for both watched memory files and knowledge-base documents. This matches the direct ingestion path and keeps persisted freshness metadata and retrieval recency signals tied to the source file instead of the sync time. No extra filesystem stat is performed. Public APIs, schema, persistence, and migrations are unchanged.

Tests

  • Added an offline regression test covering both MEMORY.md and knowledge_base/guide.md with deterministic mtimes.
  • Focused memory suite: 17 passed.
  • Control UI build, frontend check (98 files / 2,004 tests), ruff, mypy, and uv build --wheel pass.
  • Local full pytest: 8,559 passed, 32 skipped; 6 unrelated ONNX/packaging failures and 3 ONNX fixture errors because this checkout's model asset is invalid and its uv does not support the test helper's --clear flag.

Diff is limited to src/agentos/memory/sync_manager.py and tests/test_memory_sync_manager_architecture.py.

@BunnyTeddy
BunnyTeddy force-pushed the codex/fix-kb-source-mtime branch from e6f773b to a87e73f Compare August 31, 2026 08:28
@BunnyTeddy BunnyTeddy changed the title fix(memory): preserve knowledge-base source mtime fix(memory): preserve watched file mtimes Aug 31, 2026
@BunnyTeddy

Copy link
Copy Markdown
Author

Addressed the accepted scope notes from #649:

  • reuses the mtime already captured in MemorySyncManager._mtimes (no extra stat() call);
  • passes that mtime to index_file() for both watched memory files and knowledge-base documents;
  • extends the offline regression test to cover both MEMORY.md and knowledge_base/guide.md.

I also rebased onto the latest main (47102d6). Focused memory tests pass (17 passed), along with targeted ruff and mypy.

@andreapn andreapn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@andreapn
andreapn merged commit 0def0e7 into use-agent-os:main Sep 1, 2026
6 checks passed
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.

[Bug]: Knowledge-base watcher stores sync time instead of source mtime

2 participants