fix: improve Windows setup UX and persist tunnel provider choice#11
Open
CT4nk3r wants to merge 1 commit into
Open
fix: improve Windows setup UX and persist tunnel provider choice#11CT4nk3r wants to merge 1 commit into
CT4nk3r wants to merge 1 commit into
Conversation
- Plugin now reads persisted provider from ~/.config/opencode-mobile/tunnel-config.json in addition to the TUNNEL_PROVIDER env var, so the choice made during 'npx opencode-mobile install --provider <name>' actually takes effect at runtime. - 'opencode-mobile install --provider <name>' now writes that file even when --skip-tunnel-setup is used (or when tunnel-setup itself wouldn't have written it). - Install success output now warns prominently that '/mobile' only works in 'opencode serve' mode and that --hostname 0.0.0.0 is required for LAN access (default 127.0.0.1 is loopback-only and unreachable from a phone). - The /mobile tool returns an actionable multi-line message instead of the bare 'No tunnel URL found.' when run in TUI/attach mode. - The plugin's non-serve-mode log spells out the exact serve command to run. - README: Quick Start now recommends 'opencode serve --hostname 0.0.0.0 --port 4096', documents the persisted tunnel config, and adds a troubleshooting section for mobile permission approvals that don't reflect on the PC (with curl-based diagnostics to isolate mobile-app vs tunnel vs server issues).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Addresses four issues found during setup and usage on Windows:
Tunnel doesn't start in TUI mode —
/mobilesilently returnedNo tunnel URL foundwhen OpenCode was launched as the plain TUI. The plugin still gates onservemode (per AGENTS.md,ctx.serverUrlis unsafe to use as a proxy becauseopencode debug waitprovides it too), but now logs an actionable message at startup and the/mobiletool returns a multi-line message telling the user to runopencode serve --hostname 0.0.0.0 --port 4096.Tunnel provider choice not persisted —
npx opencode-mobile install --provider localtunnelpreviously did nothing at runtime because the plugin only readTUNNEL_PROVIDERenv var. Now:install.tswrites the choice to~/.config/opencode-mobile/tunnel-config.json(merging with anythingtunnel-setupwrote).TUNNEL_PROVIDERenv > persisted config >auto.--hostnamedefaults to 127.0.0.1 — install success output now contains a prominent warning that mobile features requireopencode serve --hostname 0.0.0.0(loopback-only is unreachable from a phone). README Quick Start updated accordingly.Permission approvals from mobile don't go through — added a troubleshooting section to the README documenting the expected flow (
permission.asked→ push payload withpermissionId/sessionId/serverUrl→ mobile POSTs back through the tunnel) and a curl-based diagnostic to isolate whether the bug is in the mobile app, the tunnel, or the OpenCode server. The actual approve-callback code lives in a separate repo (mobile app), so this PR only adds plumbing/docs to help users diagnose.Files changed
index.ts— provider resolution from persisted config, better TUI/non-serve messaging, improved/mobiletool error messagesrc/cli/install.ts— persist provider choice, hostname/0.0.0.0 warning in success outputREADME.md— Quick Start clarifies serve-mode requirement, troubleshooting expanded with permission-flow diagnostics + persisted-config docsVerification
npm run typecheckpassesnpx vitest run— all formatter tests pass; the only failing tests are pre-existing on master (network-dependent cloudflare quick-tunnel test, interactive ngrok prompt test) and unrelated to these changes.opencode servewith no--providerflag previously set:getTunnelProvider()still falls through toauto.