[PR #8849] fix(tui): show warning when opening WebUI without server mode #12888

Closed
opened 2026-02-16 18:17:46 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/8849

State: closed
Merged: No


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
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/8849 **State:** closed **Merged:** No --- ## 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
yindo added the pull-request label 2026-02-16 18:17:46 -05:00
yindo closed this issue 2026-02-16 18:17:46 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#12888