fix(openclaw): support 5.2 contracts and shared remember writes#1866
Merged
qin-ctx merged 1 commit intovolcengine:mainfrom May 6, 2026
Merged
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨No code suggestions found for the PR. |
5d3e834 to
6ae4672
Compare
OpenClaw 5.2 gates non-bundled plugin capabilities from the manifest before relying on runtime registration. The previous OpenViking manifest only identified the plugin as kind=context-engine, so 5.2 could classify it as non-capability, emit diagnostics for agent tools registered without contracts.tools, and leave real gateway/agent runs falling back from the openviking context engine even when inspect loaded it manually. Declare startup/capability activation and the tool contract list so the plugin is loaded as a plain capability plugin and its registered tools match manifest contracts. Register the ov_archive_expand factory tool with an explicit name so it can be matched to contracts.tools. Drop the agent_end hook registration because 5.2 blocks that typed hook for non-bundled plugins without conversation access, and this plugin already records agent routing through session_start/session_end. Harden the memory-chain e2e to find only the current run's OpenViking session, assert the unique marker is persisted, and exit non-zero on assertion failures.
6ae4672 to
a830da1
Compare
qin-ctx
approved these changes
May 6, 2026
qin-ctx
pushed a commit
that referenced
this pull request
May 7, 2026
…#1871) #1866 explicitly removed the agent_end hook from index.ts because OpenClaw 5.2 blocks that typed hook for non-bundled plugins without conversation access; session routing is now recorded through session_start/session_end. README.md and README_CN.md still listed agent_end in the hook-layer summary.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/api/v1/agent/rememberendpoint that preserves the existing session add-message + commit memory pipelineopenviking_store, OpenClawmemory_store, and MCPstorethrough the shared remember helper without renaming tools or changing search/forget semanticsRoot Cause
OpenClaw 5.2 gates non-bundled plugin capabilities from the manifest before relying on runtime registration. The previous OpenViking manifest only declared
kind: context-engine, so 5.2 could classify it asnon-capability, emit diagnostics for agent tools registered withoutcontracts.tools, and let real gateway/agent runs fall back from theopenvikingcontext engine even wheninspect --runtimecould load the plugin manually.The manifest now declares startup/capability activation plus the full tool contract list, and the
ov_archive_expandfactory tool has an explicit registration name so it matchescontracts.tools. Theagent_endhook is removed because 5.2 blocks that typed hook for non-bundled plugins without conversation access; session routing is already recorded throughsession_start/session_end.The remember write path was also duplicated across host adapters as ad hoc create-session/add-message/commit/delete flows.
/api/v1/agent/remembernow gives plugins one canonical explicit-memory write API while still delegating to the existing session memory lifecycle, preservingrole_id/session_idhandling and async extraction results.Fixes #1862
Verification
uv run ruff check openviking/server/remember.py openviking/server/routers/agent.py openviking/server/mcp_endpoint.py tests/server/test_agent_remember.pyuv run ruff format --check openviking/server/remember.py openviking/server/routers/agent.py openviking/server/mcp_endpoint.py tests/server/test_agent_remember.pyuv run pytest tests/server/test_agent_remember.py -quv run pytest tests/server/test_agent_remember.py tests/server/test_api_sessions.py::test_commit_updates_archive_metadata_before_background_task -qnpm run buildinexamples/codex-memory-pluginnpm test -- --run tests/ut/tools.test.ts tests/ut/client.test.ts tests/ut/plugin-normal-flow-real-server.test.tsinexamples/openclaw-pluginuv run python -m py_compile examples/openclaw-plugin/tests/e2e/test-memory-chain.pynpm test -- --run tests/ut/manifest-contracts.test.ts tests/ut/config.test.ts tests/ut/tools.test.ts tests/ut/plugin-bypass-session-patterns.test.tsopenclaw plugins inspect openviking --runtimeshows Shape: plain-capability / context-engine: openviking / all 7 tools registered