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
Copy link
Copy Markdown

Summary

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

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 now has a cross-agent compatibility workflow that can checkout this repo and run Dify contract checks for agent upgrade validation. This PR gives the Dify plugin repo first-party CI coverage as well.

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