GeezerVison is showing github.com — web: session view stuck on "Something went wrong" (Transport: Load failed) after network switch on remote Safari/Firefox client · Issue #55673 · anomalyco/opencode
web: session view stuck on "Something went wrong" (Transport: Load failed) after network switch on remote Safari/Firefox client #55673DescriptionDescription
Body:
Summary
The web UI permanently parks on the "Something went wrong" error boundary with ClientError: Transport: Load failed after any network interruption (Wi-Fi ↔ cellular switch, backgrounded Safari tab, or Mac sleep/wake) when accessed remotely from Safari on iPhone over Tailscale. The in-app Reload does not recover it; only killing the tab and doing a fresh load + re-auth works. Sessions and messages are intact server-side.
Environment
- opencode version: Desktop service 2.0.29 (bundled CLI), standalone CLI 1.18.32
- OS: Darwin 24.2.0 arm64 (Mac server); client is Safari on iOS (iPhone)
- Terminal: N/A (failing client is the web UI, not the TUI)
- Shell: /bin/zsh (server side)
- Install/channel: OpenCode Desktop app (release) + release CLI
- Active plugins: one MCP server (
rea, local) in global config; no project-local plugins
Reproduction
- Run the Desktop background service bound to all interfaces (
"hostname": "0.0.0.0" in service config), reachable at http://<tailscale-ip>:<port> (verified HTTP 200 on both Tailscale and LAN IPs, Basic auth working).
- On iPhone Safari, open a fresh tab to the server URL, authenticate (Basic auth, user
opencode), open any session with messages.
- Interrupt the network path: switch iPhone Wi-Fi ↔ cellular, background/lock Safari, or let the Mac sleep and wake it.
- Return to the tab.
Expected Behavior
The web UI re-establishes its live event subscription / API transport after a transient network failure (auto-reconnect), or the error page's Reload button performs a full recovery.
Actual Behavior
Full-page error boundary, every time:
The tab stays broken across Reload presses. Recovery requires closing the tab, opening a new one, and logging in again. Reproduced consistently (5G and Wi-Fi, multiple sessions).
Additional Context
- Server is healthy throughout:
/api/info and /api/session respond normally with Basic auth; session list (41 sessions) and messages (e.g. 50 messages in the affected session) verified via API from the Mac. This is client-transport-only.
- Per the client docs, event subscriptions are "live-only, with no replay or automatic reconnection" — after a blip the subscription is dead and the UI surfaces it as a fatal error instead of resubscribing.
- Server log shows
GET /api/event → 200 streams opening/closing around the failures, plus GET /_assets/health-<hash>.js:1:6165 → 404 entries (browser requesting a stack-frame URL literally — cosmetic, but shows the error path).
- Two aggravating defaults for remote use:
serve/web default to --port 0 (random port invalidates bookmarks on restart) and --hostname 127.0.0.1 (unreachable remotely unless overridden).
- Workarounds tried: fresh tab + re-auth (works until next blip); direct-LAN URL when on home Wi-Fi (more stable, same failure mode on switch);
caffeinate on the Mac to rule out sleep (failure persists on network switch alone).
Plugins
No response
OpenCode version
No response
Steps to reproduce
- Run the Desktop background service bound to all interfaces ("hostname": "0.0.0.0" in service config), reachable at http://: (verified HTTP 200 on both Tailscale and LAN IPs, Basic auth working).
- On iPhone Safari, open a fresh tab to the server URL, authenticate (Basic auth, user opencode), open any session with messages.
- Interrupt the network path: switch iPhone Wi-Fi ↔ cellular, background/lock Safari, or let the Mac sleep and wake it.
- Return to the tab.
Screenshot and/or share link
Operating System
macOS 27.0.1
Terminal
No response Activityopencode-agent commented on Oct 15, 2026 Thanks for the detailed report. I reproduced this on 2.0.29 using headless WebKit (Playwright) on Linux, not a real iPhone. The server had a password and --hostname 0.0.0.0, and the browser connected through a small TCP proxy that stood in for the network path. I opened a session, then closed every connection and took the browser offline for about 15 seconds, navigating back into the session while offline. The session view switched to Something went wrong with ClientError: Transport: Load failed (caused by TypeError: Load failed), the same stack in _assets/health-*.js as in your screenshot. It stayed there after the network came back. It still happens on the latest dev (4397ee4).
Two differences from what you describe:
- A plain outage without any navigation recovered fine here, because the live event stream reconnects. The error page appeared when a session data request failed during the outage.
- In my runs the Reload button on the error page did bring the page back. I couldn't test real iOS Safari, so I couldn't confirm Reload failing there.
The script below reproduces it. The screenshots show the session before the drop and the error page afterwards, on 2.0.29 and on dev.
Related: #51857 (the live event stream dies silently and needs a hard refresh) and #54154 (open PR adding automatic retry for transient transport errors).



Reproduction script (repro.mjs)
// Reproduce #55673: web UI stuck on "Something went wrong" after a network interruption.
// Prereq: `OPENCODE_SERVER_PASSWORD=pw opencode serve --hostname 0.0.0.0 --port 4096` running,
// and at least one session (POST /api/session). Usage: node repro.mjs [webkit|firefox]
import net from "node:net"
import { webkit, firefox } from "playwright"
const MODE = process.env.MODE ?? "reset" // reset | blackhole
const UPSTREAM = Number(process.env.UPSTREAM ?? 4096)
const PROXY = 5000
const engine = process.argv[2] === "firefox" ? firefox : webkit
const out = process.env.OUT ?? "/workspace/repro"
// TCP proxy that simulates the network path (Tailscale / Wi-Fi). We can cut it.
let down = false
const sockets = new Set()
const proxy = net.createServer((c) => {
if (down && MODE !== "blackhole") return c.destroy()
const u = net.connect(UPSTREAM, "127.0.0.1")
sockets.add(c); sockets.add(u)
// in blackhole mode, data is silently dropped while down (like a dead Wi-Fi path)
c.on("data", (d) => { if (!down) u.write(d) })
u.on("data", (d) => { if (!down) c.write(d) })
const end = () => { c.destroy(); u.destroy(); sockets.delete(c); sockets.delete(u) }
c.on("error", end); u.on("error", end); c.on("close", end); u.on("close", end)
})
await new Promise((r) => proxy.listen(PROXY, "127.0.0.1", r))
const auth = { username: "opencode", password: "pw" }
const sessions = await fetch(`http://127.0.0.1:${UPSTREAM}/api/session`, {
headers: { authorization: "Basic " + btoa("opencode:pw") },
}).then((r) => r.json())
const sid = sessions.data[0].id
const browser = await engine.launch()
const ctx = await browser.newContext({ httpCredentials: auth, viewport: { width: 390, height: 844 } })
const page = await ctx.newPage()
page.on("console", (m) => m.type() === "error" && console.log("[console]", m.text().slice(0, 200)))
await page.goto(`http://127.0.0.1:${PROXY}/`)
await page.waitForTimeout(4000)
// Log in with the password form (Basic auth user "opencode")
if (await page.getByText("Use password").count()) {
await page.getByText("Use password").click()
await page.waitForTimeout(1000)
const inputs = page.locator("input:visible")
console.log("inputs:", await inputs.count(), await page.locator("body").innerText())
const pw = page.locator('input[type="password"]').first()
const all = await inputs.all()
for (const i of all) {
const type = await i.getAttribute("type")
const ph = (await i.getAttribute("placeholder")) ?? ""
if (type === "password") await i.fill("pw")
else if (/user/i.test(ph) || /user/i.test((await i.getAttribute("name")) ?? "")) await i.fill("opencode")
else if (/http|server|url/i.test(ph)) await i.fill(`http://127.0.0.1:${PROXY}`)
}
await pw.press("Enter")
await page.waitForTimeout(5000)
}
console.log("url after load:", page.url())
await page.screenshot({ path: `${out}/1-before.png` })
// Try to open the session
const link = page.locator(`a[href*="${sid}"]`).first()
if (await link.count()) await link.click()
else await page.getByText("New session").first().click()
await page.waitForTimeout(4000)
console.log("url in session:", page.url())
await page.screenshot({ path: `${out}/2-session.png` })
// Network interruption: kill all connections and refuse new ones for 15s
console.log("cutting network")
down = true
if (MODE === "reset") { for (const s of sockets) s.destroy(); await ctx.setOffline(true) }
// simulate Safari tab background/foreground while the path is down, and navigating within the app
await page.evaluate(() => { window.dispatchEvent(new Event("offline")); document.dispatchEvent(new Event("visibilitychange")); window.dispatchEvent(new Event("focus")) })
await page.waitForTimeout(3000)
await page.goBack().catch(() => {})
await page.waitForTimeout(2000)
await page.goForward().catch(() => {})
await page.waitForTimeout(15000)
await page.screenshot({ path: `${out}/3-during.png` })
console.log("restoring network")
down = false
if (MODE === "reset") await ctx.setOffline(false)
if (MODE === "blackhole") for (const s of sockets) s.destroy() // stale connections finally time out
await page.evaluate(() => { window.dispatchEvent(new Event("online")); document.dispatchEvent(new Event("visibilitychange")) })
await page.waitForTimeout(10000)
const text = await page.locator("body").innerText()
console.log("after restore, error page:", /Something went wrong/i.test(text))
console.log(text.slice(0, 500))
await page.screenshot({ path: `${out}/4-after.png` })
// Press Reload on the error page if present
const reload = page.getByRole("button", { name: /reload/i })
if (await reload.count()) {
await reload.first().click()
await page.waitForTimeout(8000)
const t2 = await page.locator("body").innerText()
console.log("after Reload, error page:", /Something went wrong/i.test(t2))
await page.screenshot({ path: `${out}/5-after-reload.png` })
}
await browser.close()
proxy.close()
process.exit(0)
Run it: bun repro.mjs
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|