mirror of
https://github.com/Monkopedia/rouse-context.git
synced 2026-12-02 09:43:13 +00:00
3.5 KiB
3.5 KiB
End-to-End Status (2026-04-06)
What works
- Device onboarding: Firebase auth → relay registration (two-round-trip) → ACME server cert + relay CA client cert
- Device connects to relay via mTLS WebSocket (
active_mux_connections: 1confirmed) - Session handler wired in TunnelForegroundService to receive incoming mux streams
- Relay deployed at relay.rousecontext.com with real services (FCM, Firebase Auth, ACME, DeviceCa)
- Debug test MCP integration available (echo, get_time, device_info tools)
Current blocker: AI client → relay passthrough → device
When an AI client connects to {subdomain}.rousecontext.com:443, the TLS handshake hangs.
The relay has the device's mux session registered, but the passthrough doesn't route the client connection to it.
What the relay logs show
INFO rouse_relay::api::ws: Device WebSocket upgrade accepted subdomain=main-board
INFO rouse_relay::api::ws: Mux session registered subdomain=main-board
INFO rouse_relay::api::ws: Mux session loop started subdomain=main-board
No log entries about the AI client connection arriving or being routed.
What the integration tests do differently
EndToEndSessionTest scenario 5 manually pumps mux frames from the WebSocket listener — it doesn't use TunnelClientImpl at all. The test builds its own frame routing. This means:
- The test proves the relay's passthrough works (OPEN frames are sent)
- But it doesn't test whether
TunnelClientImpl.incomingSessionsactually emits - The production code path (
TunnelClientImpl→MuxDemux→incomingSessionsflow) may have a bug
Investigation needed
- Does
TunnelClientImpl.incomingSessionsactually work? Check ifMuxDemux.onOpen()emits to the flow - Does the relay's passthrough handler (
passthrough.rs) correctly look up the mux session by subdomain? - Does the relay's SNI router send the client to the passthrough handler when SNI matches a device subdomain?
- Is there a mismatch between how
SessionRegistrystores sessions (byws.rs) and howpassthrough.rslooks them up?
Key file locations
- Relay passthrough:
relay/src/passthrough.rs - Relay session registry:
relay/src/passthrough.rs(SessionRegistry) - Relay WS handler:
relay/src/api/ws.rs(registers mux session) - Relay main connection handler:
relay/src/main.rs(routes by SNI) - Device tunnel client:
core/tunnel/src/commonMain/kotlin/com/rousecontext/tunnel/TunnelClientImpl.kt - Device mux demux:
core/tunnel/src/commonMain/kotlin/com/rousecontext/tunnel/MuxDemux.kt - Device session handler:
work/src/main/kotlin/com/rousecontext/work/SessionHandler.kt - Device MCP bridge:
app/src/main/java/com/rousecontext/app/session/McpSessionBridge.kt - Integration test:
core/tunnel/src/jvmTest/kotlin/com/rousecontext/tunnel/integration/EndToEndSessionTest.kt
Known issues to fix
- MtlsWebSocketFactory created at Koin init — if onboarding happens after init, the factory has no cert. Needs lazy creation or recreation after onboarding.
- API 31+ foreground service restriction — can't start foreground service from background broadcast. Need to use
setForegroundServiceBehavior()or handle differently. - Onboarding blocks dashboard — should be a non-blocking banner, not a separate screen.
- ACME cert consumption — each
pm clear+ re-onboard burns a Let's Encrypt cert (50/week limit). Be careful in testing.
Device info
- Pixel 3 XL, API 31, package
com.rousecontext.debug - Wireless ADB:
192.168.68.112:38285 - Subdomain:
main-board - Relay:
relay.rousecontext.com(35.209.161.222)