Skip to content

Conversation

@lxxonx
Copy link

@lxxonx lxxonx commented Jan 16, 2026

Summary

Fixes #8848

When OpenCode runs without --port flag, the "Open WebUI" command attempts to open http://opencode.internal which is a non-resolvable internal URL used only for RPC communication.

Changes

  • Added a check in the "Open WebUI" command handler to detect when the URL is the internal placeholder
  • Shows a helpful warning toast explaining how to enable server mode instead of silently failing

Before

Clicking "Open WebUI" → Browser opens with http://opencode.internal → ERR_NAME_NOT_RESOLVED

After

Clicking "Open WebUI" → Toast warning: "WebUI requires server mode. Restart with: opencode --port 4096"

Testing

  1. Run opencode (without --port flag)
  2. Press Cmd+P → Select "Open WebUI"
  3. Verify warning toast appears instead of browser opening

Alternative Approaches Considered

  1. Hide the menu item when server not running - Would require passing server state through context, more invasive change
  2. Start server on-demand when WebUI requested - Adds complexity and may have side effects
  3. Show warning (chosen) - Minimal change, clear user feedback, explains the fix

When OpenCode runs without --port flag, it uses internal RPC
communication with 'opencode.internal' as a placeholder URL.
The 'Open WebUI' command was trying to open this non-resolvable
URL in the browser, which fails silently.

This change adds a check for the internal URL and shows a helpful
warning toast explaining how to enable server mode instead.
@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

Found potential duplicates:

Related PRs:

  1. PR fix(tui): start server on-demand when opening WebUI from command palette #8409 - fix(tui): start server on-demand when opening WebUI from command palette

  2. PR feat(cli): rework server for webui (safe by default) #8546 - feat(cli): rework server for webui (safe by default)

These PRs likely handle the same problem domain. PR #8409 is the closest match since it directly addresses the "Open WebUI" behavior when the server isn't running, though with a different solution (auto-start vs. warning).

lxxonx and others added 2 commits January 17, 2026 12:26
Instead of showing a warning when WebUI is requested without server mode,
automatically start the server and open the actual WebUI page.
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.

Open WebUI fails when running without --port flag (uses unresolvable opencode.internal URL)

1 participant