Skip to content

fix(plugin): memcommit session resolution and legacy commit compatibility#697

Merged
qin-ctx merged 1 commit intovolcengine:mainfrom
LittleLory:fix/memcommit-compat
Mar 17, 2026
Merged

fix(plugin): memcommit session resolution and legacy commit compatibility#697
qin-ctx merged 1 commit intovolcengine:mainfrom
LittleLory:fix/memcommit-compat

Conversation

@LittleLory
Copy link
Contributor

Summary

This PR fixes memcommit for the OpenCode memory plugin example.

It resolves two related issues:

  • the plugin was reading the wrong OpenCode tool-context field when trying to resolve the current session mapping
  • the plugin assumed the newer background commit/task API was always available, which broke compatibility with older OpenViking servers

Changes

  • use context.sessionID instead of context.session?.id when resolving the current OpenCode session
  • fix the same session-context issue in both memcommit and memsearch
  • detect whether the OpenViking server supports background commit tasks
  • fall back to synchronous POST /api/v1/sessions/{id}/commit when the server does not provide /api/v1/tasks
  • keep the background task flow for newer servers that support it

Why

The OpenCode plugin ToolContext exposes sessionID, not session.id.

Also, the plugin example currently needs to work against both:

  • newer OpenViking servers with background commit task APIs
  • older OpenViking servers that only support synchronous session commit

Without this compatibility handling, memcommit can fail even when the session mapping itself is valid.

Notes

This change does not yet alter the user-facing memcommit waiting behavior. It focuses on correctness and compatibility first.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@qin-ctx qin-ctx merged commit d8c0219 into volcengine:main Mar 17, 2026
5 of 6 checks passed
@github-project-automation github-project-automation bot moved this from Backlog to Done in OpenViking project Mar 17, 2026
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.

3 participants