Skip to content

fix(session): pass ctx/user/session_id into async commit memory extraction#610

Merged
qin-ctx merged 1 commit intovolcengine:mainfrom
mvanhorn:osc/602-async-commit-memory-params
Mar 15, 2026
Merged

fix(session): pass ctx/user/session_id into async commit memory extraction#610
qin-ctx merged 1 commit intovolcengine:mainfrom
mvanhorn:osc/602-async-commit-memory-params

Conversation

@mvanhorn
Copy link
Contributor

Summary

Session.commit_async() calls extract_long_term_memories() without passing user, session_id, or ctx. Because the compressor returns early when ctx is None, async session commits always produce memories_extracted = 0 even when the archived messages contain extractable memories.

Why this matters

  • #602 documents the regression with reproduction steps and commit evidence
  • The sync commit() path correctly passes all three parameters (session.py:263-267)
  • The async path lost them after the COW pattern revert (#584)
  • This breaks memory extraction for integrations using the async commit endpoint (OpenClaw / memory-openviking)

Changes

openviking/session/session.py line 338: Added the three missing keyword arguments to match the sync path:

# Before (broken):
memories = await self._session_compressor.extract_long_term_memories(
    messages=messages_to_archive,
)

# After (fixed):
memories = await self._session_compressor.extract_long_term_memories(
    messages=messages_to_archive,
    user=self.user,
    session_id=self.session_id,
    ctx=self.ctx,
)

Testing

  • Verified the sync path (line 263) passes user, session_id, ctx
  • Verified the compressor guard (if not ctx: return []) at compressor.py:134 is the root cause
  • ruff format --check and ruff check pass

Fixes #602

This contribution was developed with AI assistance (Claude Code).

…ction

commit_async() called extract_long_term_memories(messages=...) without
passing user, session_id, or ctx. Because the compressor returns early
when ctx is None, async commits always produced memories_extracted=0.

The sync commit() path already passes all three parameters correctly.
This aligns the async path to match.

Regression from the COW pattern revert (volcengine#584) which dropped these
arguments from the async call.

Fixes volcengine#602
@CLAassistant
Copy link

CLAassistant commented Mar 14, 2026

CLA assistant check
All committers have signed the CLA.

@qin-ctx qin-ctx merged commit 6ba7a66 into volcengine:main Mar 15, 2026
1 check passed
@github-project-automation github-project-automation bot moved this from Backlog to Done in OpenViking project Mar 15, 2026
@mvanhorn
Copy link
Contributor Author

Thanks for the review and merge, @qin-ctx!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

fix(session): pass ctx/user/session_id into async commit memory extraction

3 participants