Skip to content

Fix OpenClaw verbatim memory ingest rejection - #50

Merged
ethanj merged 1 commit into
mainfrom
sync/monorepo-8d31f11
Jul 31, 2026
Merged

Fix OpenClaw verbatim memory ingest rejection#50
ethanj merged 1 commit into
mainfrom
sync/monorepo-8d31f11

Conversation

@ethanj

@ethanj ethanj commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Summary

Fix the OpenClaw plugin's memory_ingest tool so verbatim ingests are no longer rejected, and add a CI check that keeps every plugin surface (OpenClaw, Hermes, Claude Code, Codex, Cursor, MCP server) in sync on how they declare content classification.

Changes

  • Add a contentClass enum property to the OpenClaw memory_ingest tool schema, forwarded to MCP as a top-level argument.
  • Add scripts/check-ingest-contract-conformance.mjs, a CI check that verifies each plugin surface declares, stamps, or delegates content_class support consistent with the provider contract.
  • Add regression tests for the OpenClaw tool schema/registration and for the new conformance check.
  • Fix llmwiki provider/registration tests to use isolated temp directories instead of a shared, ambient /tmp path.
  • Export families from scripts/version-families.mjs so the conformance check can enumerate plugin family members instead of duplicating the list.
  • Bump plugin package/manifest versions to 0.2.1.

Why

Core defaults to RAW_CONTENT_POLICY=reject, which refuses an unstamped verbatim ingest with a 422 raw_content_rejected error. The OpenClaw plugin's memory_ingest schema pins additionalProperties: false, so even though its skill instructions told the agent to send contentClass, the undeclared property was rejected before the call could be made - the agent reported a validation error rather than sending an unstamped ingest. The published plugin could not perform any verbatim ingest, which is the path its own skill prescribes for session snapshots and handoffs. The new conformance check ensures a future contract change can't silently miss one plugin surface again.

Validation

  • pnpm test in plugins/openclaw: 5 passed, including two regression tests verified to fail when the schema declaration is removed.
  • node --test scripts/ci/__tests__/ingest-contract-conformance.test.mjs: 14 passed.
  • node scripts/check-ingest-contract-conformance.mjs: passes, and was mutation-tested against every surface - removing a declaration, commenting one out, dropping one of two payload branches, repointing a delegation config, and adding an unclassified family member each fail the check.
  • pnpm --dir packages/llmwiki test: 152 passed (previously 150 passed, 2 failed), confirmed with a conflicting file still present at the shared path.
  • pnpm run ci:affected: 16/16 tasks successful.

## Summary
Fix the OpenClaw plugin's `memory_ingest` tool schema, which silently rejected every verbatim ingest because it never declared the `contentClass` parameter, and add a CI check that verifies every plugin surface can satisfy the content-class contract.

## Changes
- Add a `contentClass` enum (`summary`, `redacted`, `raw`) to OpenClaw's `memory_ingest` schema, forwarded to MCP as a top-level argument rather than nested under `metadata`.
- Add regression tests confirming the schema declares `contentClass` and that it is forwarded correctly on a live call.
- Add `scripts/check-ingest-contract-conformance.mjs`, a CI check that verifies every plugin in the release family (MCP server, OpenClaw, Hermes, Claude Code, Codex, Cursor) declares, stamps, or delegates `content_class` handling, with structural checks that reject commented-out or handler-only mentions.
- Wire the new conformance check and its unit tests into CI.
- Export `families` from `scripts/version-families.mjs` so the conformance check can enumerate plugin family members instead of duplicating the list.
- Fix llmwiki provider tests to use per-test temp directories instead of a shared `/tmp/x` path, removing a source of cross-process test flakiness.
- Bump plugin package and manifest versions to 0.2.1.

## Why
Core defaults to `RAW_CONTENT_POLICY=reject`, so an unstamped verbatim ingest is refused with a 422. Because OpenClaw's tool schema sets `additionalProperties: false`, a call without a declared `contentClass` property was rejected before it ever reached MCP — making verbatim ingest impossible from OpenClaw even though its docs and skill instructions already told the agent to send it. The conformance check closes the gap that let this ship: it enumerates every plugin in the release family and fails if a new or existing surface can't demonstrably satisfy the contract.

## Validation
- Added unit tests for the OpenClaw schema and tool-call forwarding behavior.
- Added unit tests for the new conformance check covering declaring, stamping, and delegating surfaces, missing files, and unmapped family members.
- Wired both test suites into the CI workflow.
@ethanj ethanj changed the title Fix OpenClaw ingest schema rejecting content_class Fix OpenClaw verbatim memory ingest rejection Jul 31, 2026
@ethanj
ethanj merged commit 279af13 into main Jul 31, 2026
11 checks passed
@ethanj
ethanj deleted the sync/monorepo-8d31f11 branch July 31, 2026 05:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant