Skip to content

feat(remote): richer reverse-MCP + operator logging for troubleshooting - #75

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

feat(remote): richer reverse-MCP + operator logging for troubleshooting#75
brettchien merged 1 commit into
mainfrom
feat/reverse-mcp-more-logs

Conversation

@brettchien

Copy link
Copy Markdown
Contributor

Why

Follow-up to #74. Fills the silent gaps a reviewer hits when the Activity log can't explain a reverse-MCP or turn problem. Logging only, no behaviour change.

What (A–E)

  • A. tools/call outcome — log the tool name + ok / tool-error / failed (+msg), instead of only "a tools/call happened". A failing tool call is the usual troubleshooting case and was invisible.
  • B. tools/list failure — detect a sidecar error reply and log its message, instead of mislabelling it "unexpected shape" (that branch now means a genuinely odd shape, not an error). Surfaces a Studio-side tool problem.
  • C. Inbound::Disconnect — log when the agent tears down the reverse-MCP tunnel to the oab server — symmetric with feat(remote): honest reverse-MCP logging — declared vs. consumed #74's Connect log; explains "tools vanished" with no error.
  • D. Unsupported reverse-MCP method — log when the agent calls a method the oab server doesn't serve (replied -32601) — surfaces a capability mismatch.
  • E. OutMsg::Cancel — log the operator Stop so Activity distinguishes an operator cancel from a gateway cancel or an error drop.

The tunnel-message observability is restructured into one match on the inner method (tools/list / tools/call / initialize / other) carrying (level, message); initialize stays unlogged (Connect already proves the agent engaged).

Not done (flagged in the audit, your call)

  • keepalive ping currently logs every 45s — noise when troubleshooting. Left as-is; could be dropped to warn-on-anomaly or gated behind a verbose toggle in a separate change.

Verification

src-tauri isn't built locally (dep tree — tauri + aws-sdk-ec2/s3 — OOMs this box, as on #69/#74); CI build-test covers the compile. Additive logging using patterns already in the file (app.emit + json!, and_then(Value::as_*)).

🤖 Generated with Claude Code

Follow-up to #74. Fills the silent gaps a reviewer hits when the Activity log
can't explain a reverse-MCP or turn problem. Logging only, no behaviour change.

- A. tools/call outcome: log the tool name + ok / tool-error / failed(+msg),
  instead of only "a tools/call happened". A failing tool call is the usual
  troubleshooting case and was invisible.
- B. tools/list failure: detect a sidecar error reply and log its message
  instead of mislabelling it "unexpected shape" (that branch now means a
  genuinely odd shape, not an error).
- C. Inbound::Disconnect: log when the agent tears down the reverse-MCP tunnel
  to the oab server — symmetric with #74's Connect log; explains "tools
  vanished" with no error.
- D. Unsupported reverse-MCP method: log when the agent calls a method the oab
  server doesn't serve (replied -32601) — surfaces a capability mismatch.
- E. OutMsg::Cancel: log the operator Stop so Activity distinguishes an
  operator cancel from a gateway cancel or an error drop.

The tunnel-message observability is restructured into one match on the inner
method (list/call/initialize/other) carrying (level, message); `initialize`
stays unlogged (Connect already proves the agent engaged).

No local src-tauri build (dep tree OOMs this box, as with #69/#74); CI
build-test covers the compile. Additive logging using patterns already in the
file (`app.emit` + `json!`, `and_then(Value::as_*)`).

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@brettchien
brettchien merged commit eb093ba into main Aug 18, 2026
2 checks passed
@brettchien
brettchien deleted the feat/reverse-mcp-more-logs branch August 18, 2026 04:17
brettchien added a commit that referenced this pull request Aug 18, 2026
…sions (#77)

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