Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions packages/app/src/components/dialog-select-server.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import { usePlatform } from "@/context/platform"
import { normalizeServerUrl, ServerConnection, useServer } from "@/context/server"
import { checkServerHealth, type ServerHealth } from "@/utils/server-health"

const DEFAULT_USERNAME = "opencode"

interface ServerFormProps {
value: string
name: string
Expand Down Expand Up @@ -178,7 +180,7 @@ export function DialogSelectServer() {
addServer: {
url: "",
name: "",
username: "",
username: DEFAULT_USERNAME,
password: "",
adding: false,
error: "",
Expand All @@ -201,7 +203,7 @@ export function DialogSelectServer() {
setStore("addServer", {
url: "",
name: "",
username: "",
username: DEFAULT_USERNAME,
password: "",
adding: false,
error: "",
Expand Down Expand Up @@ -362,8 +364,8 @@ export function DialogSelectServer() {
http: { url: normalized },
}
if (store.addServer.name.trim()) conn.displayName = store.addServer.name.trim()
if (store.addServer.username) conn.http.username = store.addServer.username
if (store.addServer.password) conn.http.password = store.addServer.password
if (store.addServer.password && store.addServer.username) conn.http.username = store.addServer.username
const result = await checkServerHealth(conn.http, fetcher)
setStore("addServer", { adding: false })
if (!result.healthy) {
Expand Down Expand Up @@ -441,7 +443,7 @@ export function DialogSelectServer() {
showForm: true,
url: "",
name: "",
username: "",
username: DEFAULT_USERNAME,
password: "",
error: "",
status: undefined,
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/components/terminal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ export const Terminal = (props: TerminalProps) => {
url.searchParams.set("directory", sdk.directory)
url.searchParams.set("cursor", String(start !== undefined ? start : restore ? -1 : 0))
url.protocol = url.protocol === "https:" ? "wss:" : "ws:"
url.username = server.current?.http.username ?? ""
url.username = server.current?.http.username ?? "opencode"
url.password = server.current?.http.password ?? ""

const socket = new WebSocket(url)
Expand Down
Loading