You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
p1: close the six review findings on the rpc-only mode
The service-side fence held; every defect was on the app side or in the
mode's headline promise.
B1 (blocking) — an rpc-only request rewrote routes against a pre-mode
service, and the log asserted the opposite. A v1 service has no `mode`
handler, so it drops the field, runs all eight steps and calls
netConfig_->Apply; the app then logged "the service is clamped. Nothing
will be connected." while the routing table had just been rewritten. The
code reasoned only about the downgrade direction. kProtocolVersion -> 2
with kFirstStartModeVersion, and BootstrapSession now refuses BEFORE
start_tunnel when it asks for rpc-only and hello reports < 2. The two
mismatch directions are handled separately: the safe one (asked tunnel,
got rpc-only) refuses; the dangerous one (asked rpc-only, got tunnel)
stops the tunnel it did not ask for and refuses.
B2 (blocking) — the app rendered "Connected" in rpc-only mode. The
previous audit was of the wrong signal: the user-visible connect status
never read TunnelState. The real chain is getConnectionStatus() ->
LiveStats::connectionStatus -> ParseConnectStatus -> ApplyConnectStatus,
and in rpc-only the DeviceLocal negotiates providers normally, so picking
a location showed "Connected", a green dot, a Disconnect button,
"Connected to N providers" and a live rate with zero packets carried --
while the tray, reading TunnelState, stayed disconnected.
Fixed at ONE chokepoint in SdkHost::ReadStats, not in the render path:
when the session is rpc-only, connectionStatus is forced to "RPC_ONLY"
and connected/providerCount/rates to zero. "RPC_ONLY" is deliberately a
value the view does not recognise -- ParseConnectStatus documents that
anything unrecognised reads as Disconnected precisely so an unknown
status cannot leave the button claiming a connection the SDK never made.
The true values are kept in rawConnectionStatus/rawConnected for the P2
developer surface. No view file is touched, so the P0 ConnectPage split
does not collide with this.
S1 — an rpc-only app could attach to a live production tunnel and then
revert it via Logout/re-registration. Reattach now requires an exact mode
match, and attaching to a live tunnel while asking rpc-only is refused.
S2 — --rpc-only did delete routes and clear DNS on startup, and consumed
the crash marker, while the banner claimed it wrote nothing. The startup
sweep is now observe-only in rpc-only: SweepOrphanedTunnel(remove=false)
reports orphans without touching them, and PeekActiveMarker reports the
marker without eating it. Banners corrected.
S3 — reply.ok now means "I did what you asked": IsSessionLive && mode
matches. The error string is left empty on a pure mode mismatch, because
ServiceClient::CallStatus overwrites state with Error whenever !ok
carries one, which would erase the mode the caller needs.
S4 — sessionMode_ defaults and resets to RpcOnly, the mode that claims
less, matching the policy Protocol.h already stated.
Also: URNETWORK_RPC_ONLY is now an explicit truthy allow-list. "off",
"no" and "0 " (trailing space) all used to evaluate to ON; unrecognised
values now mean OFF and say so. `console --rpc-only --bogus` no longer
ignores argv[3].
Verified by running, unelevated:
* B2 by SCREENSHOT, same build and same synthetic SDK inputs, only the
env var differing: clamp off renders "Connected" / green dot /
Disconnect / "Connected to 7 providers" / 12.3 Mbps; clamp on renders
"Ready to connect" / idle dot / Connect / no count / no rate.
* B1 both ways over the real pipe: a service reporting v1 makes the app
refuse and NO start_tunnel is ever sent; a v2 service bootstraps --
"session bootstrapped (mode=rpc_only)", the DeviceRemote's first real
RPC connection to the service.
* S2 by planting a marker: an unelevated rpc-only run leaves it in
place and says so; a normal console run consumes it and reports the
crash.
* S3: clamped process + mode=tunnel now replies ok=false with
mode=rpc_only.
* env var matrix (1/on/off/no/"0 "/banana/unset) and the argv rejection.
* routes and DNS byte-identical before/during/after; no adapter, no
marker, connectivity intact.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PT7KcWCPKfFwQUc7SM3oZY
0 commit comments