Skip to content

fix(openclaw-plugin): serialize per-session commits to prevent CONFLICT errors#1035

Open
mobilebarn wants to merge 1 commit intovolcengine:mainfrom
mobilebarn:fix/commit-in-progress-overlap
Open

fix(openclaw-plugin): serialize per-session commits to prevent CONFLICT errors#1035
mobilebarn wants to merge 1 commit intovolcengine:mainfrom
mobilebarn:fix/commit-in-progress-overlap

Conversation

@mobilebarn
Copy link
Copy Markdown

Summary

  • Adds a per-session commit lock (promise chain) in context-engine.ts to serialize overlapping commitSession calls targeting the same OV session ID.
  • The OV server rejects concurrent commits on the same session with a CONFLICT error. The plugin has three independent code paths (afterTurn, doCommitOVSession via before_reset/compact, and memory_store) that can overlap. This change ensures they execute sequentially via withCommitLock.
  • Exposes commitWithLock on the ContextEngineWithSessionMapping type so index.ts callers can opt in to the same lock in the future.

Test plan

  • npx tsc --noEmit passes with no errors
  • npx vitest run passes (10/10 tests)
  • Manual: trigger concurrent afterTurn + before_reset commits and verify no CONFLICT errors
  • Manual: verify memory_store tool still works when context engine is active

…CT errors

Adds a per-session commit lock (promise chain) in the context engine
to serialize overlapping commits from afterTurn, before_reset, and
compact fallback paths. The OV server rejects concurrent commits on
the same session with CONFLICT; this ensures they run sequentially.
@github-actions
Copy link
Copy Markdown

Failed to generate code suggestions for PR

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

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant