-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
Summary
Session.commit_async() calls extract_long_term_memories() without passing user, session_id, and ctx.
Because SessionCompressor.extract_long_term_memories() returns early when ctx is missing, async session commit can archive successfully but still produce memories_extracted = 0.
Affected code
Current code in openviking/session/session.py:
memories = await self._session_compressor.extract_long_term_memories(
messages=messages_to_archive,
)But openviking/session/compressor.py contains:
if not ctx:
return []So the async commit path can return zero extracted memories even when the archived messages clearly contain extractable long-term memory.
Expected behavior
Session.commit_async() should pass the same context information as the normal extraction flow:
memories = await self._session_compressor.extract_long_term_memories(
messages=messages_to_archive,
user=self.user,
session_id=self.session_id,
ctx=self.ctx,
)Reproduction
- Create a session
- Add a clearly extractable preference or unique fact
- Call
POST /api/v1/sessions/{id}/commit - Observe
memories_extracted = 0
Example message pair:
- user:
以后所有回复都用中文,默认简洁直接。 - assistant:
收到,后续我会默认用中文并保持简洁直接。
Evidence
I verified this locally in two ways:
- Directly calling
MemoryExtractor.extract(...)on a minimal example returns valid candidates. - Running the same content through the HTTP session commit path returned
memories_extracted = 0before restoring the missing arguments.
After restoring user=self.user, session_id=self.session_id, and ctx=self.ctx, the same HTTP commit path returned memories_extracted = 1, and the memory file was actually written to disk.
Regression source
This looks like a regression introduced after feat(sessions): add async commit support with wait parameter (#472).
- The earlier async implementation in commit
9c4f419passeduser,session_id, andctx. - The current broken call appears after commit
20b5dab(Revert "feat(resource): implement incremental update with COW pattern (#535)" (#584)), where those arguments are no longer passed.
Impact
This affects integrations that rely on OV session commit for long-term memory extraction, including OpenClaw / memory-openviking style flows.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status