This repository was archived by the owner on Apr 1, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,7 +12,9 @@ import Home from "@/pages"
1212const host = import . meta. env . VITE_OPENCODE_SERVER_HOST ?? "127.0.0.1"
1313const port = import . meta. env . VITE_OPENCODE_SERVER_PORT ?? "4096"
1414
15- const url = new URLSearchParams ( document . location . search ) . get ( "url" ) || `http://${ host } :${ port } `
15+ const url =
16+ new URLSearchParams ( document . location . search ) . get ( "url" ) ||
17+ ( location . hostname . includes ( "opencode.ai" ) ? `http://${ host } :${ port } ` : "/" )
1618
1719const root = document . getElementById ( "root" )
1820if ( import . meta. env . DEV && ! ( root instanceof HTMLElement ) ) {
Original file line number Diff line number Diff line change @@ -358,6 +358,7 @@ function App() {
358358
359359 event . on ( SessionApi . Event . Deleted . type , ( evt ) => {
360360 if ( route . data . type === "session" && route . data . sessionID === evt . properties . info . id ) {
361+ dialog . clear ( )
361362 route . navigate ( { type : "home" } )
362363 toast . show ( {
363364 variant : "info" ,
Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ export function DialogSessionList() {
7272 } ,
7373 } )
7474 setToDelete ( undefined )
75- dialog . clear ( )
75+ // dialog.clear()
7676 return
7777 }
7878 setToDelete ( option . value )
Original file line number Diff line number Diff line change @@ -26,12 +26,15 @@ export const WebCommand = cmd({
2626 port,
2727 hostname,
2828 } )
29- const url = `https://desktop.dev.opencode.ai?url=${ server . url } `
3029 UI . empty ( )
3130 UI . println ( UI . logo ( " " ) )
3231 UI . empty ( )
33- UI . println ( UI . Style . TEXT_INFO_BOLD + " Web interface: " , UI . Style . TEXT_NORMAL , url )
34- open ( url ) . catch ( ( ) => { } )
32+ UI . println (
33+ UI . Style . TEXT_INFO_BOLD + " Web interface: " ,
34+ UI . Style . TEXT_NORMAL ,
35+ server . url . toString ( ) ,
36+ )
37+ open ( server . url . toString ( ) ) . catch ( ( ) => { } )
3538 await new Promise ( ( ) => { } )
3639 await server . stop ( )
3740 } ,
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import {
1010import { Hono } from "hono"
1111import { cors } from "hono/cors"
1212import { stream , streamSSE } from "hono/streaming"
13+ import { proxy } from "hono/proxy"
1314import { Session } from "../session"
1415import z from "zod"
1516import { Provider } from "../provider/provider"
@@ -1696,7 +1697,15 @@ export namespace Server {
16961697 } )
16971698 } )
16981699 } ,
1699- ) ,
1700+ )
1701+ . all ( "/*" , async ( c ) => {
1702+ return proxy ( `https://desktop.dev.opencode.ai${ c . req . path } ` , {
1703+ ...c . req ,
1704+ headers : {
1705+ host : "desktop.dev.opencode.ai" ,
1706+ } ,
1707+ } )
1708+ } ) ,
17001709 )
17011710
17021711 export async function openapi ( ) {
You can’t perform that action at this time.
0 commit comments