Skip to content

fix(pi): notify review URL in RPC sessions - #1407

Open
Shujakuinkuraudo wants to merge 1 commit into
backnotprop:mainfrom
Shujakuinkuraudo:fix/pi-rpc-url-notice
Open

fix(pi): notify review URL in RPC sessions#1407
Shujakuinkuraudo wants to merge 1 commit into
backnotprop:mainfrom
Shujakuinkuraudo:fix/pi-rpc-url-notice

Conversation

@Shujakuinkuraudo

Copy link
Copy Markdown

Summary

Pi Web runs extensions with ExtensionContext.mode === "rpc". In this mode,
Plannotator's isRemoteSession() can remain false even though the user cannot
directly access the browser launched by the Pi Web host process.

openBrowserForServer() currently notifies the URL only for remote sessions or
when browser launch reports failure. A successful browser spawn in the Pi Web
host can therefore hide the URL from the RPC session.

Treat RPC extension contexts like remote sessions for the purpose of URL
notification:

- if (isRemoteSession()) {
+ if (ctx.mode === "rpc" || isRemoteSession()) {
    ctx.ui.notify(`[Plannotator] ${serverUrl}`, "info");
  }

Behavior

  • Local interactive sessions keep their existing behavior.
  • Existing SSH and PLANNOTATOR_REMOTE sessions keep their existing behavior.
  • Pi Web RPC sessions receive the review URL through ctx.ui.notify() even
    when the browser launcher reports success.
  • Server binding, hostname selection, ports, authentication, browser launch,
    and port forwarding are unchanged.
  • This does not make the random review port directly reachable through Pi Web;
    it only exposes the URL to the user so an explicitly configured access path
    can be used.

Test plan

  • Added a regression test for an RPC context with PLANNOTATOR_REMOTE=0.
  • The test points BROWSER at the current Node executable, so no real browser
    is opened while the launcher still reports success.
  • The test verifies that the RPC context receives the [Plannotator] <url>
    notification.
  • git diff --check passes.
  • The full Bun test suite could not be run locally because Bun is not installed
    in the development environment; GitHub Actions should run the repository's
    standard checks.

Closes #1406

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pi Web RPC sessions do not show the Plannotator review URL

1 participant