openclaw/extensions
Armand du Plessis b888741462
fix: QMD 1.1+ mcporter compatibility with legacy fallback [AI-assisted] (#54728)
* fix: QMD 2.0 mcporter compatibility with v1 fallback [AI-assisted]

QMD 2.0 unified all search modes under a single 'query' MCP tool
with typed sub-queries, replacing search/vector_search/deep_search.

- Default to QMD 2.0 'query' tool with {searches: [...]} format
- Auto-detect version on first call and cache for the session
- Fall back to v1 tool names if 'query' is not found
- Backwards compatible: v1 users get one retry then cached

AI-assisted: Built with Claude (Opus 4.6) via OpenClaw. Fully tested
against QMD 2.0 with mcporter 0.7.3 daemon. v1 fallback path not
live-tested (no v1 instance available). Code reviewed and understood.

* test: add QMD v2 tool format and v1 fallback tests

- Verify mcporter bridge uses 'query' tool with {searches: [...]} format (v2)
- Verify fallback to 'deep_search' with {query, limit} format when v2 not found
- Verify v1 fallback logs a warning for visibility

* fix: address review feedback — multi-collection v1 fallback + test cleanup

- Fix multi-collection v1 fallback: resolve effectiveTool at the top
  of runQmdSearchViaMcporter so stale 'query' tool names from the
  loop are corrected once qmdMcpToolVersion is set to 'v1'
- Assert callCount in v1 fallback test (one v2 attempt + one v1 retry)
- Remove spurious global state reset (qmdMcpToolVersion is per-instance)

* docs: correct version references — breaking change was QMD 1.5, not 2.0

The MCP tool removal (search/vector_search/deep_search → query) happened
in QMD 1.5, not 2.0. QMD 2.0 was the SDK/library refactor.
Updated all comments, test names, and documentation to reflect this.

* fix: respect searchMode when building v2 mcporter queries

When searchMode is 'search' (BM25), only send lex sub-query.
When 'vsearch', only send vec. Default 'query' sends all three
(lex + vec + hyde) for full hybrid search with reranking.

Previously all three sub-queries were always sent regardless of
the configured searchMode, which could trigger unnecessary vector
embedding and HyDE LLM work on setups explicitly requesting
lexical-only search.

Addresses Codex P2 review feedback.

* docs: correct to QMD 1.1.0 — that's the actual version that removed the tools

Per CHANGELOG.md, MCP tools search/vector_search/deep_search were removed
in QMD 1.1.0 (2026-02-20), not 1.5 (which doesn't exist). Versions go
1.0.7 → 1.1.0 → 1.1.1 → 1.1.2 → 1.1.5 → 1.1.6 → 2.0.0.

* fix: remove redundant v1 guard (race condition) + tighten error matching

1. Remove qmdMcpToolVersion !== 'v1' guard from catch block. It's
   redundant (effectiveTool === 'query' already prevents infinite retry)
   and introduces a race condition: concurrent searches that both probe
   with 'query' while version is null would fail after the first sets
   version to 'v1'.

2. Tighten isToolNotFoundError regex to require 'Tool' near 'not found'
   (within 40 chars, no sentence boundary). Prevents false-positives
   when user query text in the mcporter args contains both words.

Addresses Greptile P1 (concurrent-search race) and Codex P2
(overly broad error matching).

* fix: address claude code review — type safety, minScore docs, explicit switch

- Restore type union for tool param instead of bare string
- Add comment explaining minScore omission for v2 (QMD 1.1+ uses
  its own reranking pipeline, no minScore parameter)
- Make buildV2Searches switch exhaustive with explicit case 'query'

* fix: resolve CI failures — oxfmt formatting + TypeScript type errors

- Run oxfmt to fix formatting issues
- Add union return type to resolveQmdMcpTool() and
  runMcporterAcrossCollections() tool param to satisfy tsc
  (string was not assignable to the union type)

* fix(memory): align qmd query collection filters

* fix(memory): narrow qmd missing-tool fallback detection

* fix(memory): ignore qmd timeout text for v1 fallback

---------

Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
2026-03-30 08:07:14 +09:00
..
acpx refactor(plugin-sdk): untangle extension test seams 2026-03-29 23:43:53 +01:00
amazon-bedrock build: fix packaged plugin dependency ownership 2026-03-29 22:21:29 +01:00
anthropic chore: bump version to 2026.3.29 2026-03-29 14:33:12 +01:00
anthropic-vertex refactor: move remaining provider policy into plugins 2026-03-29 23:05:58 +09:00
bluebubbles refactor: move plugin-owned test support into plugins 2026-03-30 08:03:04 +09:00
brave chore: bump version to 2026.3.29 2026-03-29 14:33:12 +01:00
browser refactor: move plugin-owned test support into plugins 2026-03-30 08:03:04 +09:00
byteplus chore: bump version to 2026.3.29 2026-03-29 14:33:12 +01:00
chutes chore: bump version to 2026.3.29 2026-03-29 14:33:12 +01:00
cloudflare-ai-gateway chore: bump version to 2026.3.29 2026-03-29 14:33:12 +01:00
copilot-proxy chore: bump version to 2026.3.29 2026-03-29 14:33:12 +01:00
deepgram refactor(plugin-sdk): untangle extension test seams 2026-03-29 23:43:53 +01:00
deepseek refactor(plugin-sdk): untangle extension test seams 2026-03-29 23:43:53 +01:00
device-pair refactor(plugins): decouple bundled plugin runtime loading 2026-03-29 09:10:38 +01:00
diagnostics-otel chore: bump version to 2026.3.29 2026-03-29 14:33:12 +01:00
diffs chore(deps): bump workspace dependencies 2026-03-29 14:41:58 +01:00
discord refactor: share approval interactive renderers 2026-03-30 08:03:59 +09:00
duckduckgo chore: bump version to 2026.3.29 2026-03-29 14:33:12 +01:00
elevenlabs refactor: decouple bundled plugin sdk surfaces 2026-03-29 21:20:46 +01:00
exa chore: bump version to 2026.3.29 2026-03-29 14:33:12 +01:00
fal chore: bump version to 2026.3.29 2026-03-29 14:33:12 +01:00
feishu fix: stabilize extensions surface test gate 2026-03-30 07:47:58 +09:00
firecrawl chore: bump version to 2026.3.29 2026-03-29 14:33:12 +01:00
github-copilot chore: bump version to 2026.3.29 2026-03-29 14:33:12 +01:00
google refactor(plugin-sdk): untangle extension test seams 2026-03-29 23:43:53 +01:00
googlechat refactor(plugin-sdk): untangle extension test seams 2026-03-29 23:43:53 +01:00
groq chore: bump version to 2026.3.29 2026-03-29 14:33:12 +01:00
huggingface chore: bump version to 2026.3.29 2026-03-29 14:33:12 +01:00
image-generation-core chore: bump version to 2026.3.29 2026-03-29 14:33:12 +01:00
imessage refactor(plugin-sdk): untangle extension test seams 2026-03-29 23:43:53 +01:00
irc refactor(plugin-sdk): untangle extension test seams 2026-03-29 23:43:53 +01:00
kilocode refactor(plugin-sdk): untangle extension test seams 2026-03-29 23:43:53 +01:00
kimi-coding chore: bump version to 2026.3.29 2026-03-29 14:33:12 +01:00
line refactor(plugin-sdk): untangle extension test seams 2026-03-29 23:43:53 +01:00
litellm chore: bump version to 2026.3.29 2026-03-29 14:33:12 +01:00
llm-task chore(deps): bump workspace dependencies 2026-03-29 14:41:58 +01:00
lobster chore(deps): bump workspace dependencies 2026-03-29 14:41:58 +01:00
matrix refactor: move plugin-owned test support into plugins 2026-03-30 08:03:04 +09:00
mattermost chore(deps): bump workspace dependencies 2026-03-29 14:41:58 +01:00
media-understanding-core chore: bump version to 2026.3.29 2026-03-29 14:33:12 +01:00
memory-core fix: QMD 1.1+ mcporter compatibility with legacy fallback [AI-assisted] (#54728) 2026-03-30 08:07:14 +09:00
memory-lancedb chore(deps): bump workspace dependencies 2026-03-29 14:41:58 +01:00
microsoft refactor(plugin-sdk): untangle extension test seams 2026-03-29 23:43:53 +01:00
microsoft-foundry refactor(plugin-sdk): untangle extension test seams 2026-03-29 23:43:53 +01:00
minimax refactor(plugin-sdk): untangle extension test seams 2026-03-29 23:43:53 +01:00
mistral refactor(plugin-sdk): untangle extension test seams 2026-03-29 23:43:53 +01:00
modelstudio chore: bump version to 2026.3.29 2026-03-29 14:33:12 +01:00
moonshot refactor(plugin-sdk): untangle extension test seams 2026-03-29 23:43:53 +01:00
msteams refactor(plugin-sdk): untangle extension test seams 2026-03-29 23:43:53 +01:00
nextcloud-talk chore: bump version to 2026.3.29 2026-03-29 14:33:12 +01:00
nostr chore: bump version to 2026.3.29 2026-03-29 14:33:12 +01:00
nvidia chore: bump version to 2026.3.29 2026-03-29 14:33:12 +01:00
ollama refactor(plugin-sdk): untangle extension test seams 2026-03-29 23:43:53 +01:00
open-prose chore: bump version to 2026.3.29 2026-03-29 14:33:12 +01:00
openai refactor: move plugin-owned test support into plugins 2026-03-30 08:03:04 +09:00
opencode refactor(plugin-sdk): untangle extension test seams 2026-03-29 23:43:53 +01:00
opencode-go refactor(plugin-sdk): untangle extension test seams 2026-03-29 23:43:53 +01:00
openrouter refactor(plugin-sdk): untangle extension test seams 2026-03-29 23:43:53 +01:00
openshell refactor(plugin-sdk): untangle extension test seams 2026-03-29 23:43:53 +01:00
perplexity chore: bump version to 2026.3.29 2026-03-29 14:33:12 +01:00
phone-control refactor(plugins): decouple bundled plugin runtime loading 2026-03-29 09:10:38 +01:00
qianfan chore: bump version to 2026.3.29 2026-03-29 14:33:12 +01:00
sglang refactor(plugin-sdk): remove bundled provider setup shims 2026-03-29 20:23:20 +01:00
shared
signal refactor(plugin-sdk): untangle extension test seams 2026-03-29 23:43:53 +01:00
slack refactor(plugin-sdk): untangle extension test seams 2026-03-29 23:43:53 +01:00
speech-core chore: bump version to 2026.3.29 2026-03-29 14:33:12 +01:00
synology-chat refactor(plugin-sdk): untangle extension test seams 2026-03-29 23:43:53 +01:00
synthetic refactor(plugin-sdk): untangle extension test seams 2026-03-29 23:43:53 +01:00
talk-voice refactor: move plugin-owned test support into plugins 2026-03-30 08:03:04 +09:00
tavily chore: bump version to 2026.3.29 2026-03-29 14:33:12 +01:00
telegram refactor: share approval interactive renderers 2026-03-30 08:03:59 +09:00
thread-ownership
tlon fix: stabilize serial test suite 2026-03-30 04:46:04 +09:00
together chore: bump version to 2026.3.29 2026-03-29 14:33:12 +01:00
twitch chore: bump version to 2026.3.29 2026-03-29 14:33:12 +01:00
venice refactor: decouple bundled plugin sdk surfaces 2026-03-29 21:20:46 +01:00
vercel-ai-gateway chore: bump version to 2026.3.29 2026-03-29 14:33:12 +01:00
vllm refactor(plugin-sdk): remove bundled provider setup shims 2026-03-29 20:23:20 +01:00
voice-call chore(deps): bump workspace dependencies 2026-03-29 14:41:58 +01:00
volcengine chore: bump version to 2026.3.29 2026-03-29 14:33:12 +01:00
whatsapp refactor(plugin-sdk): untangle extension test seams 2026-03-29 23:43:53 +01:00
xai refactor(plugin-sdk): untangle extension test seams 2026-03-29 23:43:53 +01:00
xiaomi refactor(plugin-sdk): untangle extension test seams 2026-03-29 23:43:53 +01:00
zai refactor(plugin-sdk): untangle extension test seams 2026-03-29 23:43:53 +01:00
zalo refactor: localize zalo test support 2026-03-30 07:47:28 +09:00
zalouser refactor(plugin-sdk): untangle extension test seams 2026-03-29 23:43:53 +01:00
.npmignore
AGENTS.md Docs: add boundary AGENTS guides (#56647) 2026-03-28 20:22:03 -04:00
CLAUDE.md Docs: add boundary AGENTS guides (#56647) 2026-03-28 20:22:03 -04:00