Repository navigation
feat(web): rpcLog console logging; StartWRT streams over session RPC - #4731
Conversation
helix-white
left a comment
There was a problem hiding this comment.
[P2] Apply the toggle to already-active exchanges
RpcConsoleLog.request() (rpc-console-log.ts:47–65) snapshots enablement when the request starts: returning null prevents observing subsequent frames, while the returned reply/failure callbacks never re-check the switch. Consequently, rpcLog.disable() leaves existing streams printing plaintext and pending calls printing replies/errors. Conversely, enabling logging after the portal's long-lived db.subscribe starts never logs its frames. The persistence test only disables after its logged exchange has completed, so it misses these transitions.
The proposal keeps observation installed and gates each emission on the live switch. It records that contract at RpcConsoleLog and adds regression cases for toggling pending replies, established streams and transport failures.
Reviewed head 5cf286b05d3b2ef35fc608196534ede4dd3f6690; git merge-tree --write-tree origin/feat/registry-live-cache HEAD was clean. Current reported CI: Conflict Markers passed. No builds or tests run during review; the proposal's regression cases are unexecuted.
Proposed changes: 5cf286b...proposal/4731
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
|
[P2] Apply the toggle to already-active exchanges — adopted in a4b6fc8. Observation now stays installed on every session exchange, and each request, reply, stream-frame and transport-failure line checks the live switch, as proposed. The contract comment and both regression cases are in, unchanged. One variation:
|
helix-white
left a comment
There was a problem hiding this comment.
Approved at a4b6fc8b85210c9b7a5975cdfebaa51a2ea53e26.
The earlier finding is resolved: observation remains installed, and reply/stream/failure emissions check the live toggle. The lazy-parsing variation preserves that behavior without parsing request bodies while logging is off. The production contract and both transition regression cases are included.
git merge-tree --write-tree origin/feat/registry-live-cache HEAD is clean. Author reports check:shared passed (typecheck and 128/128 tests); current CI reports Conflict Markers passed. No builds or tests run during this review.
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
Dismissed by Helix: the changes require a substantive PR brief update. Logging changes from request-start enablement to live per-emission gating. The substantive brief must explain that disabling immediately silences pending replies, active stream frames and transport failures, while enabling captures already-active exchanges such as db.subscribe; this changes observable behavior and plaintext exposure.
|
@dr-bonez asked for a timeout; Correction to the earlier brief: StartOS and StartTunnel logs, metrics, init progress and the database subscription are RPC streams on the session websocket, and they are already logged. Only StartWRT's log follow and update progress still use GUID continuation sockets, and the description now asks whether to cover those. |
helix-white
left a comment
There was a problem hiding this comment.
Approved at 94f2e49a653fd84cef63a02cf99d6cc752bb16a8.
Reviewed the timeout change since my previous approval. The persisted absolute expiry preserves the remaining duration across reloads, defaults to 30 minutes, and supports a custom duration. Requests, replies, stream frames and transport failures all consult the same live expiry check; manual disable still silences active exchanges. The new regression case covers the deadline boundary, a pending reply, persistence and a custom duration. Developer documentation and all three product fragments reflect the new default.
git merge-tree --write-tree origin/feat/registry-live-cache HEAD is clean. Author reports check:shared passed (129/129 tests plus typecheck). Latest Conflict Markers passed; full product checks remain deferred on this feature-branch base. No builds or tests run during review.
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
Dismissed by Helix: the changes require a substantive PR brief update. Enablement changes from indefinite persistence until disable() to a persisted expiry: 30 minutes by default, customizable with enable(minutes), surviving reloads and silencing active exchanges at the deadline. The brief must update the logging lifetime, default and resulting plaintext-exposure guarantee.
Encrypted session RPC makes the network tab illegible. RpcConsoleLog exposes rpcLog.enable()/disable() on window, persisted in local storage, and RpcSocketService logs each request, reply and stream frame while it is enabled. Helix-Harness: claude-code Helix-Model: claude-opus-5-5
Gate each logged reply, stream frame and transport failure on the live switch, so disable() silences in-flight calls and enable() picks up established streams such as db.subscribe. The request is parsed only when a line is actually printed. Helix-Harness: claude-code Helix-Model: claude-opus-5-5
rpcLog.enable(minutes = 30) stores an expiry instead of a flag, so a forgotten enablement stops printing decrypted parameters on its own, including after reloads. Helix-Harness: claude-code Helix-Model: claude-opus-5-5
StartWRT's update dialog and logs page opened separate GUID continuation sockets, unlike StartOS and StartTunnel. system.update and system.logs-follow now forward to the request's response stream when one is open, through the shared revocation-aware forward_stream, and keep the GUID WebSocket for the CLI and older clients. The web UI consumes the generated streams, so rpcLog covers both feeds; the WRT-only continuation socket and its mock are removed. Helix-Harness: claude-code Helix-Model: claude-opus-5-5
94f2e49 to
8bc56bb
Compare
|
@dr-bonez asked for StartWRT's separate sockets to be fixed;
#4583 was squash-merged, so I rebased this PR's four commits onto Verification: |
StartWRT 1.4.0 is released and patch fragments are pending, so the changelog version check expects 1.4.1. Helix-Harness: claude-code Helix-Model: claude-opus-5-5
|
|
Keep legacy update progress tied to the requesting key's revocation lifetime and preserve cancellation of acquired mock streams. Include unexecuted regression coverage for both lifetimes. Helix-Harness: pi Helix-Model: openai-codex/gpt-6.1-sol
helix-white
left a comment
There was a problem hiding this comment.
[P2] Bind the retained GUID update observer to revocation
In projects/start-wrt/backend/ctrl/src/update.rs, only the response-stream branch registers a revocation subscription; the retained GUID branch still uses RpcContinuation::ws, whose kill listener is None. WebSocketPolicy::Authenticated does not supply that listener. A keyed CLI/older client can therefore keep receiving update progress after its key is revoked. This leaves the retained path outside API_CONTRACT.md's guarantee that revoking the requesting key ends observation.
The proposal registers once for either transport and reuses ws_authed, matching log follow and StartOS. The independent update task remains unchanged. A small continuation factory permits an idle-WebSocket revocation regression without device or registry fixtures; the guarantee is recorded at the handler.
[P2] Honor cancellation after mock stream acquisition
The new iterators in projects/start-wrt/web/src/app/services/api/mock-api.service.ts do not preserve RpcStreamOptions' iteration-cancellation contract. Acquire followLogs({signal}), abort, then call items.next(): the generator registers its listener after the event and waits forever. The update generator likewise yields progress and successful termination after cancellation. The current test covers only abort before acquisition and while log iteration is already waiting.
The proposal checks cancellation at iterator entry and subsequent boundaries, makes active log cancellation reject with its reason, and extends the regression cases.
Reviewed 1729b8e37f7b129020bcfcac10b8cbb1e146beef, including its version bump. The three rebased logging commits are patch-equivalent to the previously reviewed versions. Merge against origin/master is clean. CI is pending. No builds or tests run during review; all proposal regressions are unexecuted.
Proposed changes: 1729b8e...proposal/4731
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
Dismissed by Helix: the changes require a substantive PR brief update. Previously excluded StartWRT live logs and update progress now use typed session RPC streams covered by rpcLog, requiring the brief to describe expanded logging coverage, response/terminal semantics, observation lifetimes and legacy GUID compatibility. The product version also changes to 1.4.1. The approved logging patches remain unchanged by the rebase, but the added scope is substantive.
… cancellation The GUID update-progress continuation now registers the requesting key's revocation subscription, like log follow and StartOS. The WRT mock update and log streams reject with the abort reason after acquisition. Proposed by @helix-white in review. Helix-Harness: claude-code Helix-Model: claude-opus-5-5
|
Both points adopted as proposed in
I ran the regressions you hadn't executed:
The merge against |
helix-white
left a comment
There was a problem hiding this comment.
Approved at 9a14b29ea3bbd3efc17d6ca96fb6b4162ef2c102.
Both findings are resolved, and the resulting tree matches the proposal. The legacy update observer now shares the revocation subscription and uses ws_authed without changing the independent update task. Both mock iterators honor cancellation after acquisition and at subsequent boundaries. The handler contract and focused regressions are included.
Merge against origin/master is clean. The author reports 972 passing Rust tests, 102 passing RPC-client tests, and clean WRT typecheck/formatting checks, including the adopted regressions. CI is still pending. No builds or tests run during this review.
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
Dismissed by Helix: the changes require a substantive PR brief update. Legacy GUID update observation now terminates when the requesting key is revoked, while the accepted update continues independently. Mock update/log iterators now reject cancellation after acquisition and between items. The brief must describe these changed authorization and cancellation guarantees, including that the retained legacy path is no longer behaviorally unchanged.
Change
RPC console logging. Encrypted
/rpc/v2sessions leave the network tab showing only ciphertext. RunningrpcLog.enable()in the browser console prints each decrypted session RPC:RPC <first 8 chars of the correlation ID> <method> →, followed by its params;… ← <ms since request>, followed by the frame; error replies print asconsole.warn;… transport failed <ms>.Logging is off by default.
rpcLog.enable()turns it on for 30 minutes, andrpcLog.enable(minutes)sets another duration. The expiry is stored in local storage, so logging continues across reloads and still captures calls a page makes while loading, such asdb.subscribeand login. It stops by itself at the expiry, so a forgotten session does not keep printing parameters, which include passwords.rpcLog.disable()stops it early, andrpcLog.enabledreports the state. The switch is checked on every line, so disabling silences calls already in progress and enabling picks up streams that are already open.RpcConsoleLog, a root service in@start9labs/shared, owns the switch and installs itself aswindow.rpcLog.RpcSocketServicereports through it from the single path that every encrypted session call and stream takes. That covers the StartOS UI and setup wizard (including logs, metrics, init progress and the database subscription, which are session streams), StartTunnel and StartWRT. The request body is parsed only when a line is printed. Public HTTP RPC, used before a device key exists, already appears in the network tab and is not logged.StartWRT update progress and live logs move onto the session (requested by @dr-bonez). The WRT update dialog and logs page each opened a separate GUID continuation socket, unlike StartOS and StartTunnel, so neither was visible to this logging. They now follow the StartOS pattern:
system.update: when the request carries a response stream, the handler returns{target, progress: null}. It then streamsFullProgressitems and ends with a null result, or with the update's actual error. No available update closes the stream immediately.system.logs-follow: with a response stream, it returns{guid: null}and streamsLogEntryitems untillogreadexits.RevocationSubscription::forward_stream, now public, so revoking the requesting device key ends the observation.system.updategains theget_signermetadata for this. A forged__Auth_signeris stripped by the existing auth middleware.system updatestill uses. Revoking the requesting key now ends that socket too. Before this PR, the legacy update-progress socket ignored revocation; @helix-white found the gap in review and proposed the fix.FollowLogsRes.guidbecomes nullable in the generated bindings.overall: true/falseand close events produced.ContinuationSocket/openWebsocketAPI and itsMockContinuation.StartWRT's version moves to 1.4.1 (
ctrl/Cargo.tomlandCargo.lock). StartWRT 1.4.0 has been released and patch fragments are pending, so the repository's changelog version check requires the bump once a PR touchesprojects/start-wrt.Implementation diff: about +431 / −253 lines in 17 files (excludes lockfiles, tests, docs, release notes, and changelog). The regenerated WRT bindings account for about +82 / −5 of that; doc comments inside generated and hand-written code were excluded by hand, so the counts are approximate.
shared-libs/ts-modules/AGENTS.mddocumentsrpcLog. StartWRT'sAPI_CONTRACT.mdand architecture docs describe the stream and legacy paths. Each product'spatch-changed-rpc-authenticationchangelog fragment gains the relevant lines.Approach
forward_stream. WRT has its own progress tracker, so StartOS'sprogress_until_completecould not be reused directly. A smallprogress_until_doneyields snapshots through the final one, then the update's error, if any. Log follow shares onelogreadreader between the stream and legacy paths.RpcSocketService.openSocketis now unused in production, but the shared session browser probe still uses it to exercise the legacy GUID path, so it stays.Testing
All run through the build cache. The Rust and web checks below ran on the final head; the shared-lib checks ran before the rebase onto
master, which changed nothing they cover.make start-wrt-test: 972 passed. New cases:progress_until_done: success ends with a completed snapshot and no error; failure ends with a failed snapshot followed by the update's error.The existing revocation test still covers the legacy log-follow path.
WRT bindings regenerated with the
start-wrt-rpc-bindingsrecipe. Pinned rustfmt is clean.npm run check:rpc-clients: 102/102. New cases driveSystemService.startUpdatethrough a successful terminal, transport loss and an application error, plus a no-target update. Others cover the WRT mock's typed update and log streams, including cancellation before acquisition, after acquisition and between items.npm run check:wrt(typecheck) is clean.npm run check:shared: 129/129. Therpc-socket.test.mjscases cover:Not exercised: the WRT stream path against a real router or browser. No Rust test drives
system.logs-followorsystem.updateend to end over a session, because both depend on device-onlylogread,DeviceInfoand the registry. GitHub CI now runs againstmaster; its product build and test jobs are pending on this head.Helix-Harness: claude-code
Helix-Model: claude-opus-5-5