Skip to content

feat(remote): log reverse-MCP initialize handshake + protocol versions - #77

Merged
brettchien merged 1 commit into
mainfrom
feat/reverse-mcp-initialize-log
Aug 18, 2026
Merged

feat(remote): log reverse-MCP initialize handshake + protocol versions#77
brettchien merged 1 commit into
mainfrom
feat/reverse-mcp-initialize-log

Conversation

@brettchien

Copy link
Copy Markdown
Contributor

Why

#74/#75 moved the "management sees no oab tools" symptom forward: the Activity log now shows the agent does connect to the oab server (reverse-MCP — agent connected), but there's no tools/list after it. MCP requires the client to send initialize right after connecting (it's protocol-mandated, not the agent's choice), so the stall is in that inner handshake — which #75 deliberately left unlogged.

What (logging only, no behaviour change)

  • initialize — log the client's requested protocolVersion vs the version the server answered, and flag a PROTOCOL MISMATCH (warn) when they differ. A mismatch is the leading hypothesis for why a connected agent aborts before tools/list (the server currently answers a hardcoded 2024-11-05).
  • notifications/initialized — log it (a notification, so it never reached the outcome match). Its presence means the handshake completed; its absence right after an initialize points at a rejected handshake.

Reading the result

  • initialize … client requested X, server answered X + initialized then no tools/list → handshake fine, list problem elsewhere.
  • initialize … PROTOCOL MISMATCH and no initialized → the agent rejected our handshake — the fix is to echo the client's version (follow-up).
  • no initialize at all after connect → the agent connected but never handshook (different bug).

Follow-up (not in this PR)

If the log confirms a mismatch: echo the client's protocolVersion instead of the hardcoded 2024-11-05, and advertise capabilities.tools.listChanged.

Verification

src-tauri not built locally (dep tree OOMs this box, as on #74/#75); CI build-test covers the compile. Additive logging using patterns already in the file.

🤖 Generated with Claude Code

…sions

#74/#75 revealed the agent DOES connect to the oab server but never calls
tools/list. The stall is between connect and list — the inner MCP initialize
handshake, which #75 deliberately left unlogged. Log it, since MCP requires
the client to initialize right after connecting (it's not the agent's choice).

- initialize: log the client's requested `protocolVersion` vs the version the
  server answered; flag a **PROTOCOL MISMATCH** (warn) when they differ — the
  suspected reason a connected agent aborts before tools/list.
- notifications/initialized: log it (a notification, so it never reached the
  outcome match). Its presence means the handshake completed; its absence
  right after an initialize points at a rejected handshake.

Logging only — no behaviour change. If the log confirms a version mismatch,
the fix (echo the client's protocolVersion instead of the hardcoded
2024-11-05, + advertise tools.listChanged) is a follow-up.

No local src-tauri build (dep tree OOMs this box, as with #74/#75); CI
build-test covers the compile.
@brettchien
brettchien merged commit 2fe4aff into main Aug 18, 2026
2 checks passed
@brettchien
brettchien deleted the feat/reverse-mcp-initialize-log branch August 18, 2026 14:16
brettchien added a commit that referenced this pull request Aug 18, 2026
…lize (#79)

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.
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