Skip to content

Add Dify compatibility contract checks#3

Open
awxxxxxx wants to merge 1 commit into
mainfrom
add-compat-checks
Open

Add Dify compatibility contract checks#3
awxxxxxx wants to merge 1 commit into
mainfrom
add-compat-checks

Conversation

@awxxxxxx

@awxxxxxx awxxxxxx commented May 29, 2026

Copy link
Copy Markdown

Summary

Adds repo-local contract tests and CI for the mem9 Dify plugin.

This PR covers the plugin-upgrade side. The main mem9 compatibility workflow can now checkout this repo with plugin_ref and run Dify contract checks as part of the cross-agent matrix.

What changed

  • Adds .github/workflows/compat-checks.yml.
  • Adds tests/test_contract.py with a stubbed Dify runtime so tests do not need a live Dify server.
  • Verifies provider credential validation and tool request contracts.

What the tests cover

  • Single-space credential validation sends X-API-Key and X-Mnemo-Agent-Id.
  • Single-space mode requires an API key.
  • Multi-space search returns a clear error when node-level API key is missing.
  • memory_search sends expected headers and params, including session_id, scanAll, and upstream limit * 3.
  • memory_store sends smart ingest payload with messages[], agent_id, mode=smart, and session_id.

How this relates to mem9 main

The main mem9 repo PR adds:

python3 compat agent dify --lane plugin-contract --plugin-ref <this-repo-branch-or-tag>

Dify does not currently have a real headless host smoke lane in the same way as OpenClaw/Hermes/Claude/OpenCode/Codex, so the blocking gate is the plugin contract suite. The main workflow still includes Dify in agent=all plugin/full matrices.

GitHub Action usage from mem9 main

Dify plugin upgrade check:

agent: dify
lane: plugin-contract
plugin_ref: <this PR branch/tag/SHA>
host_ref: <empty>
plugin_source: manifest

Full matrix check:

agent: all
lane: full
host_channel: stable
plugin_source: local

Verified locally

python3 -m venv /tmp/mem9-dify-ci-venv
/tmp/mem9-dify-ci-venv/bin/python -m pip install --disable-pip-version-check pytest requests
/tmp/mem9-dify-ci-venv/bin/python -m pytest -q tests/test_contract.py

Result: 5 passed.

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