rouse-context/work
Jason Monk d8c4b6454d Fix MCP tool invocation: notification handling, TLS multi-record, idle timeout
- HttpTransport: add handleNotification() for fire-and-forget JSON-RPC
  messages (no response expected). Without this, notifications/initialized
  hung forever waiting for a response that never came.

- McpRouting: detect JSON-RPC notifications (no "id" field) and return
  202 Accepted immediately instead of dispatching through handleRequest.
  Also add 5s timeout on receiveText() for /register to prevent hangs.

- TlsInputStream: same multi-record fix as TlsAcceptor handshake —
  check netIn.position() before reading from stream. HTTP headers and
  body arriving in the same mux DATA frame caused the body read to block.

- TunnelClientImpl: catch ClosedSendChannelException in onBinaryMessage
  to prevent crash when WebSocket frames arrive after disconnect.

- TunnelForegroundService: handle double-wake by disconnecting stale
  connection before reconnecting.

- Increase idle timeout to 30 minutes for testing (was 5 minutes, which
  caused the connection to drop right when Claude tried tool calls).

Verified: Claude connected via OAuth, called echo and device_info tools
successfully through the full relay → device → MCP pipeline.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 16:41:22 -04:00
..
src Fix MCP tool invocation: notification handling, TLS multi-record, idle timeout 2026-04-06 16:41:22 -04:00
build.gradle.kts Extract core:bridge module for TLS accept + MCP session bridging 2026-04-06 14:22:37 -04:00