Skip to content

fix(openclaw): support 5.2 contracts and shared remember writes#1866

Merged
qin-ctx merged 1 commit intovolcengine:mainfrom
Mijamind719:codex/fix-openclaw-5-2-capabilities
May 6, 2026
Merged

fix(openclaw): support 5.2 contracts and shared remember writes#1866
qin-ctx merged 1 commit intovolcengine:mainfrom
Mijamind719:codex/fix-openclaw-5-2-capabilities

Conversation

@Mijamind719
Copy link
Copy Markdown
Collaborator

@Mijamind719 Mijamind719 commented May 6, 2026

Summary

  • declare OpenClaw 5.2 startup/capability activation and tool contracts for the OpenViking context-engine plugin
  • register the archive expand factory tool with an explicit name and drop the blocked agent_end hook
  • add an agent-facing /api/v1/agent/remember endpoint that preserves the existing session add-message + commit memory pipeline
  • route Codex openviking_store, OpenClaw memory_store, and MCP store through the shared remember helper without renaming tools or changing search/forget semantics

Root 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 as non-capability, emit diagnostics for agent tools registered without contracts.tools, and let real gateway/agent runs fall back from the openviking context engine even when inspect --runtime could load the plugin manually.

The manifest now declares startup/capability activation plus the full tool contract list, and the ov_archive_expand factory tool has an explicit registration name so it matches contracts.tools. The agent_end hook is removed because 5.2 blocks that typed hook for non-bundled plugins without conversation access; session routing is already recorded through session_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/remember now gives plugins one canonical explicit-memory write API while still delegating to the existing session memory lifecycle, preserving role_id/session_id handling 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.py
  • uv run ruff format --check openviking/server/remember.py openviking/server/routers/agent.py openviking/server/mcp_endpoint.py tests/server/test_agent_remember.py
  • uv run pytest tests/server/test_agent_remember.py -q
  • uv run pytest tests/server/test_agent_remember.py tests/server/test_api_sessions.py::test_commit_updates_archive_metadata_before_background_task -q
  • npm run build in examples/codex-memory-plugin
  • npm test -- --run tests/ut/tools.test.ts tests/ut/client.test.ts tests/ut/plugin-normal-flow-real-server.test.ts in examples/openclaw-plugin
  • uv run python -m py_compile examples/openclaw-plugin/tests/e2e/test-memory-chain.py
  • npm 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.ts
  • openclaw plugins inspect openviking --runtime shows Shape: plain-capability / context-engine: openviking / all 7 tools registered
  • e2e memory-chain against OpenClaw 2026.5.2 and OpenViking local server: 31/31 assertions passed twice

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis ✅

1862 - Fully compliant

Compliant requirements:

  • Added activation and contracts sections to openclaw.plugin.json
  • Registered ov_archive_expand with explicit name
  • Bumped OpenClaw minimum version to 2026.5.2
  • Added tests for manifest contracts and config backward compatibility
  • Removed blocked agent_end hook
⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🏅 Score: 92
🧪 PR contains tests
🔒 No security concerns identified
✅ No TODO sections
🔀 No multiple PR themes
⚡ No major issues detected

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

PR Code Suggestions ✨

No code suggestions found for the PR.

@Mijamind719 Mijamind719 force-pushed the codex/fix-openclaw-5-2-capabilities branch 4 times, most recently from 5d3e834 to 6ae4672 Compare May 6, 2026 08:40
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.
@Mijamind719 Mijamind719 force-pushed the codex/fix-openclaw-5-2-capabilities branch from 6ae4672 to a830da1 Compare May 6, 2026 08:45
@qin-ctx qin-ctx merged commit 3ebbb5b into volcengine:main May 6, 2026
6 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in OpenViking project May 6, 2026
@Mijamind719 Mijamind719 changed the title fix(openclaw): support capability contracts on 5.2 fix(openclaw): support 5.2 contracts and shared remember writes 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

2 participants