From b6ba75b2287b4c1d8b41d0be644b08a29a6fbcd4 Mon Sep 17 00:00:00 2001 From: Brett Chien Date: Tue, 18 Aug 2026 22:46:33 +0800 Subject: [PATCH] fix(remote): echo the client's MCP protocol version in the oab initialize MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Confirmed by the #77 log on a live management session: reverse-MCP initialize — PROTOCOL MISMATCH: client requested 2025-06-18, server answered 2024-11-05 The reverse-MCP `initialize` shim answered a hardcoded `2024-11-05`. The agent runtime requested `2025-06-18`; the downgrade is why it completed the handshake (sent `initialized`) yet never issued `tools/list` — so the management agent saw no oab tools. Echo the client's requested `protocolVersion` instead of pinning one. Our initialize is a thin shim over the already-initialized oab-mcp sidecar, and `tools/list`/`tools/call` are forwarded verbatim (the response shape is stable across these versions), so echoing is safe; fall back to `2024-11-05` only when the client omits a version. With this, the #77 log should read "client requested X, server answered X" (no mismatch) and `tools/list` should follow — confirming the fix on the live session. No local src-tauri build (dep tree OOMs this box); CI build-test covers the compile. --- src-tauri/src/remote.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src-tauri/src/remote.rs b/src-tauri/src/remote.rs index a973578..cbfe370 100644 --- a/src-tauri/src/remote.rs +++ b/src-tauri/src/remote.rs @@ -1018,10 +1018,20 @@ async fn handle_inner( match method { "notifications/initialized" => None, "initialize" => id.map(|i| { + // Echo the client's requested protocol version. Our initialize is a + // thin shim over the already-initialized oab-mcp sidecar, and + // tools/list·call are forwarded verbatim (version-agnostic), so a + // newer client (observed: 2025-06-18) must not see a downgrade to a + // pinned 2024-11-05 and then decline to enumerate tools. Fall back to + // a known version only when the client omits one. + let proto = params + .get("protocolVersion") + .and_then(Value::as_str) + .unwrap_or("2024-11-05"); acp::message_reply( i, json!({ - "protocolVersion": "2024-11-05", + "protocolVersion": proto, "capabilities": { "tools": {} }, "serverInfo": { "name": "oab-studio", "version": env!("CARGO_PKG_VERSION") } }),