Skip to content

Launch the loopback UI in the desktop browser on WSL #55

Description

@xuzijian2019

Problem

npm run dev starts the agent on 127.0.0.1:30141 but never opens a browser. The production pi-web launcher uses xdg-open on Linux, which in WSL does not open the Windows browser. The WSL workflow is “hope the operator types localhost in Edge”.

This is the browser surface, not Tauri and not a DeepSeek Harness --profile web port. Spec: docs/web-profile.md.

Goal

One command starts the in-process Pi agent on loopback, prints http://127.0.0.1:<port>, and opens that URL in the Windows desktop browser from a WSL shell.

In scope (v1)

  • npm run webnext dev -H 127.0.0.1 + handoff after Next Ready
  • Production pi-web uses the same helper
  • Bind 127.0.0.1 only on the web path; default port 30141
  • --no-open / PI_WEB_NO_OPEN / SSH skip the handoff; still print the URL
  • WSL: powershell.exe Start-Process, never cmd.exe /C start, never xdg-open
  • Handoff failure is a warning; the server stays up
  • Existing Host/Origin fence unchanged; no new auth

Out of scope

  • Native Windows as a supported product surface
  • macOS as a validation / support target
  • Linux desktop xdg-open quality
  • Binding 0.0.0.0 as a WSL trick
  • Sharing ~/.pi/agent across Windows and WSL
  • Pairing a Tauri window to this server
  • Auto-open on npm run dev

Acceptance

  • npm run web from an ext4 WSL checkout opens the Windows browser at http://127.0.0.1:30141
  • npm run web -- --no-open prints the URL and does not open a window
  • SSH env skips the open
  • Ctrl+C does not dump write EPIPE
  • npm run dev still does not auto-open
  • npm test and tsc --noEmit stay green; no next build on this path

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions