Skip to content

fix(web): retain browser-compatible listen ports - #696

Merged
testikun merged 1 commit into
openpi-dev:mainfrom
outlier27-cell:fix/web-browser-safe-port
Oct 9, 2026
Merged

testikun merged 1 commit into
openpi-dev:mainfrom
outlier27-cell:fix/web-browser-safe-port

Conversation

@outlier27-cell

Copy link
Copy Markdown
Contributor

Problem

Closes #694. Web Host could retain an OS-assigned or explicitly configured port that Fetch blocks (for example 6000), publish readiness, and leave the workbench unreachable. An isolated TCP/Fetch reproduction and a full Windows test run demonstrated the failure.

Value

Automatic startup no longer intermittently selects an unusable browser port; an explicit blocked port gets an actionable diagnostic.

Approach

Retain the loopback listener only after checking the WHATWG Fetch blocked-port list. Reject explicit blocked ports and close/retry automatic allocations at most eight times. Preserve original bind errors and clean temporary listeners on success, failure and exhaustion. Durable source evidence: docs/research/WEB_BROWSER_PORT_2026-10-07.md.

Validation

  • Five deterministic transport regressions pass, including a real Fetch request after a forced blocked allocation, bounded exhaustion, occupied-port errors and synchronous-error cleanup.
  • bun run check: passed.
  • bun run test: executed; 2181 passed, 12 failed, 14 skipped in the local Windows Node suite. Failures concern renderer/footer contracts, symlink EPERM and a worktree-validation timeout; no browser-port regression failed. The runner stopped before the UI suite, so a full local pass is not claimed. Exact-head GitHub CI will validate isolated environments.
  • No live model or installed Pi/browser acceptance is claimed.

Impact

User-visible startup diagnostics and automatic port selection change. No model-facing tools/context, persisted data/configuration or permissions change. Startup retries are bounded and never widen loopback binding. Occupied explicit ports still fail instead of silently switching ports.

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Oct 7, 2026
@outlier27-cell

Copy link
Copy Markdown
Contributor Author

@tt-a1i 请审核此 PR。最新提交已通过完整 GitHub CI,当前可合并;如有需要调整的地方,我会在原分支及时修复。

@testikun testikun left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已复查 Web Host 端口选择、失败清理和有界重试(提交 321fcf730409),并核对相关调用点和回归覆盖。本次未发现新增的 P1/P2。

@testikun
testikun merged commit f2a52b5 into openpi-dev:main Oct 9, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(web): avoid browser-blocked ports when starting the Web Host

2 participants