Repository navigation
Keep local plans private, configure recap runners, and improve demo charts - #2046
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Here's a visual recap of what changed: Open the full interactive recap |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Builder reviewed your changes and found 2 potential issues 🟡
Review Details
This incremental update meaningfully improves the earlier privacy fix: the prior hash-navigation regression on local Plan routes is addressed by persisting the bridge URL across in-tab hash changes, and auth return paths now strip #bridge=... before redirecting into sign-in. The workflow side also now documents and wires a separate VISUAL_RECAP_GATE_RUNS_ON path so self-hosted-only environments can choose a gate runner explicitly. Risk assessment remains High because these changes still touch privacy-sensitive local-plan routing, telemetry/session-replay behavior, and CI security gates.
The main remaining concern is durability when more than one bridged local plan is opened in the same tab: because every bridge-backed page now uses the fixed /local-plans/local route, the new sessionStorage fallback is keyed too coarsely and can restore the wrong bridge. I also found a replay regression in the new content-capture gating: when capture is re-enabled after visiting a private route, session replay restarts without the caller’s original replay configuration. On the positive side, the previously reported hash-fragment navigation issue appears fixed and I resolved that stale review thread.
🧪 Browser testing: Attempted, but executor browser tooling was unavailable; full Plan UI verification could not be completed on this incremental review.
| ? new URLSearchParams(hash.slice(1)) | ||
| : null; | ||
| const bridgeUrl = hashParams?.get("bridge") ?? null; | ||
| const storageKey = `agent-native.local-plan-bridge.${slug}`; |
There was a problem hiding this comment.
🟡 Session-storage fallback aliases all bridged local plans to the same key
The new fallback stores every bridged page under agent-native.local-plan-bridge.local, because the CLI now always opens /local-plans/local#bridge=.... If a user opens plan A, then plan B in the same tab, going back to A's hash-only URL can silently restore B's bridge instead.
Additional Info
Found by 2/4 review agents and manually verified against plan-local.ts:547 (fixed route slug `local`) plus localPlanBridgeUrlFromLocation() using only the route slug to build the sessionStorage key.
There was a problem hiding this comment.
Fixed in f9b58a7: each bridge URL now gets a distinct opaque 16-hex route id derived from the high-entropy bridge URL, so sessionStorage keys cannot alias plan A and plan B. The hosted path still reveals neither folder name nor token; CLI/docs/localized docs and tests are updated.
| maybeInstallSessionReplay( | ||
| _trackingContentCaptureEnabled ? options.sessionReplay : false, | ||
| { | ||
| endpoint: options.endpoint, | ||
| publicKey, | ||
| }, | ||
| ); | ||
| maybeInstallErrorCapture(options.errorCapture); | ||
| } | ||
| } | ||
|
|
||
| export function setTrackingContentCaptureEnabled(enabled: boolean): void { | ||
| if (_trackingContentCaptureEnabled === enabled) return; | ||
| _trackingContentCaptureEnabled = enabled; | ||
| if (enabled) { | ||
| void maybeStartSessionReplay(); |
There was a problem hiding this comment.
🟡 Re-enabling content capture restarts session replay without the original options
When a private route disables capture, configureTracking() now installs replay with false, and re-enabling it later calls maybeStartSessionReplay() with no saved config. That drops custom replay settings like sampling, auth requirements, endpoint/publicKey overrides, or explicit enablement after the first private-route transition.
Additional Info
Found by 1/4 review agents and manually verified: the new `_trackingContentCaptureEnabled ? options.sessionReplay : false` path prevents `_sessionReplayOptions` from being preserved on initial private-route loads, while `setTrackingContentCaptureEnabled(true)` restarts replay with no options.
There was a problem hiding this comment.
Fixed in f9b58a7: configureTracking now always normalizes and retains the original replay options even when initial route capture is disabled, but starts only when policy allows. Re-enabling uses startConfiguredSessionReplay(savedOptions), preserving endpoint, publicKey, auth, sampling, and explicit false. Regression coverage starts private, navigates hosted, and verifies the original options.
…harts (#2046) * fix: keep local plans private and support recap runners * fix: harden local plan privacy transitions * fix: cancel private route replay startup * test: cover replay auth retry privacy * fix: preserve private bridge across local navigation * fix: restrict custom recap gate runners * fix: isolate local bridges and preserve replay settings

Summary
Validation