Skip to content

Add agent upgrade compatibility workflow - #336

Open
awxxxxxx wants to merge 4 commits into
mainfrom
agent-upgrade-compat-actions
Open

Add agent upgrade compatibility workflow#336
awxxxxxx wants to merge 4 commits into
mainfrom
agent-upgrade-compat-actions

Conversation

@awxxxxxx

@awxxxxxx awxxxxxx commented May 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds a repo-owned compatibility harness and manual GitHub Action for upgrade checks across the mem9 agent stack:

  • OpenClaw
  • Hermes Agent
  • Claude Code
  • OpenCode
  • Codex
  • Dify

The latest workflow separates the two upgrade axes:

  • plugin_ref: the mem9 plugin candidate ref/version/source
  • host_ref: the host agent/CLI candidate version, tag, SHA, or path:<bin>

This lets us test plugin upgrades by themselves and host upgrades by themselves from GitHub Actions.

What changed

  • Added compat/ with a manifest-driven runner:
    • python3 compat run <module>
    • python3 compat suite <suite>
    • python3 compat matrix <lane>
    • python3 compat agent <agent|all> --lane <plugin-contract|host-smoke|full>
  • Added compat/manifest.yaml with plugin metadata, host metadata, default refs, stable/next channels, and lane plans for all six agents.
  • Added OpenClaw live modules for install/setup/recall/ingest/compact/restart/failsoft, with host_ref support for openclaw@<version> or path:<bin>.
  • Added external repo support for mem9-ai/mem9-hermes-plugin and mem9-ai/mem9-dify-plugin via plugin_ref.
  • Added host-smoke coverage for:
    • Hermes host checkout plus provider HTTP contract smoke
    • Claude Code real CLI install/validate plus hook lifecycle HTTP shape
    • OpenCode real CLI install plus plugin config/TUI registration smoke
    • Codex real CLI install plus marketplace command, setup script, hook feature, recall/store hook smoke
  • Added Dify contract coverage with a stubbed Dify runtime for auth mode, headers, session_id, scanAll, and store/search request shape.
  • Added .github/workflows/agent-compat.yml for manual upgrade checks.
  • Added .github/workflows/compat-framework-checks.yml and make compat-test for harness PR checks.
  • Uploads compat/artifacts/** for per-agent logs and result JSON.

How to run locally

Fast harness self-test:

make compat-test

Run plugin contract tests:

python3 compat agent openclaw --lane plugin-contract
python3 compat agent hermes --lane plugin-contract --plugin-ref path:/Users/sx/github/mem9/mem9-hermes-plugin
python3 compat agent dify --lane plugin-contract --plugin-ref path:/Users/sx/github/mem9/mem9-dify-plugin
python3 compat agent claude --lane plugin-contract
python3 compat agent opencode --lane plugin-contract
python3 compat agent codex --lane plugin-contract

Run host upgrade smoke tests:

python3 compat agent claude --lane host-smoke --host-ref 2.1.159
python3 compat agent opencode --lane host-smoke --host-ref 1.15.13 --plugin-source local
python3 compat agent codex --lane host-smoke --host-ref 0.135.0
python3 compat agent openclaw --lane host-smoke --host-ref 2026.5.28 --plugin-source local
python3 compat agent hermes --lane host-smoke --host-ref <hermes-agent-branch-or-tag>

Use local installed CLIs during development:

python3 compat agent claude --lane host-smoke --host-ref path:$(command -v claude)
python3 compat agent opencode --lane host-smoke --host-ref path:$(command -v opencode) --plugin-source local
python3 compat agent codex --lane host-smoke --host-ref path:$(command -v codex)

GitHub Action usage

Manual workflow:

Actions -> Agent compatibility -> Run workflow

Inputs:

  • agent: openclaw, hermes, claude, opencode, codex, dify, or all
  • lane: plugin-contract, host-smoke, or full
  • plugin_ref: optional plugin branch/tag/SHA/source override
  • host_ref: optional host version/tag/SHA/source override
  • host_channel: stable or next; next is non-blocking
  • plugin_source: manifest, local, npm:<version>, path:<path>, or github:<repo>@<ref>

Plugin upgrade example:

agent: opencode
lane: plugin-contract
plugin_ref: <plugin-branch-or-tag-or-sha>
host_ref: <empty>
host_channel: stable
plugin_source: manifest

Host upgrade example:

agent: codex
lane: host-smoke
plugin_ref: <empty>
host_ref: 0.135.0
host_channel: stable
plugin_source: manifest

Full matrix example:

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

GitHub Action configuration

No secrets are required for:

  • all plugin-contract lanes
  • Claude Code host-smoke
  • OpenCode host-smoke
  • Codex host-smoke

Required for OpenClaw and Hermes hosted/host smoke lanes:

MNEMO_BASE_URL=<hosted-dev-api-base-url>

OpenClaw also needs one model key:

ANTHROPIC_API_KEY=<model-key>
# or
CLAUDE_CODE_TOKEN=<model-key>

Optional Action variables for default host refs:

COMPAT_OPENCLAW_STABLE_VERSION=<openclaw-version>
COMPAT_OPENCLAW_NEXT_VERSION=<openclaw-next-version>
COMPAT_HERMES_HOST_REF=<hermes-agent-ref>
COMPAT_CLAUDE_HOST_REF=<claude-code-version>
COMPAT_OPENCODE_HOST_REF=<opencode-ai-version>
COMPAT_CODEX_HOST_REF=<codex-version>

Verified locally

python3 -m py_compile compat/*.py && make compat-test
python3 compat agent claude --lane host-smoke --host-ref path:$(command -v claude)
python3 compat agent opencode --lane host-smoke --host-ref path:$(command -v opencode) --plugin-source local
python3 compat agent codex --lane host-smoke --host-ref path:$(command -v codex)
python3 compat agent claude --lane plugin-contract --plugin-ref path:/Users/sx/github/mem9/mem9

OpenClaw host_ref path:<bin> was also verified with the fake OpenClaw harness in compat-test. Live OpenClaw/Hermes hosted checks require MNEMO_BASE_URL and, for OpenClaw, a model key.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 48b489d9d3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread compat/runtime.py Outdated
Comment on lines +137 to +142
proc = subprocess.run(
argv,
cwd=str(repo_root),
env={
**os.environ.copy(),
"COMPAT_AGENT_REF": agent_ref or "",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Honor agent_ref for command-backed agents

When agent_ref is supplied for command-backed agents such as OpenClaw, Claude, OpenCode, or Codex, this path still runs the manifest command in the current checkout and only passes the ref through COMPAT_AGENT_REF. I checked repo-wide for COMPAT_AGENT_REF, and nothing consumes it, so dispatching the workflow from main with agent_ref=<upgrade branch> tests main and can falsely report an upgrade as compatible.

Useful? React with 👍 / 👎.

Comment thread compat/openclaw.py
profile=env.profile,
session_id="compat-compact",
message="/compact",
output_dir=module_dir / "compact-command",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Create compact run output directories first

In the OpenClaw full/upgrade suite, openclaw.compact passes a new subdirectory here, but run_agent writes agent.stdout.json and agent.stderr.txt directly under output_dir without creating it. When the suite reaches /compact, this raises FileNotFoundError before the module can finish, so the full OpenClaw compatibility lane fails even if the agent behavior is correct.

Useful? React with 👍 / 👎.

@awxxxxxx
awxxxxxx force-pushed the agent-upgrade-compat-actions branch from 48b489d to 6c9c246 Compare June 1, 2026 06:33
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