Skip to content

The open source coding agent.

TypeScript

fix issue with input randomly breaking

Dax Raadb25d4f9dfb21
diff --git a/packages/opencode/src/cli/cmd/tui/thread.ts b/packages/opencode/src/cli/cmd/tui/thread.ts
index b05bb5829b6..c530c888442 100644
--- a/packages/opencode/src/cli/cmd/tui/thread.ts
+++ b/packages/opencode/src/cli/cmd/tui/thread.ts
@@ -2,7 +2,6 @@ import { cmd } from "@/cli/cmd/cmd"
import { tui } from "./app"
import { Rpc } from "@/util/rpc"
import { type rpc } from "./worker"
-import { upgrade } from "@/cli/upgrade"
import { Session } from "@/session"
import { bootstrap } from "@/cli/bootstrap"
import path from "path"
@@ -78,8 +77,6 @@ export const TuiThreadCommand = cmd({
}
await bootstrap(cwd, async () => {
- upgrade()
-
const sessionID = await (async () => {
if (args.continue) {
const it = Session.list()
diff --git a/packages/opencode/src/cli/cmd/tui/worker.ts b/packages/opencode/src/cli/cmd/tui/worker.ts
index d268449c135..32cd5562a44 100644
--- a/packages/opencode/src/cli/cmd/tui/worker.ts
+++ b/packages/opencode/src/cli/cmd/tui/worker.ts
@@ -3,6 +3,7 @@ import { Server } from "@/server/server"
import { Log } from "@/util/log"
import { Instance } from "@/project/instance"
import { Rpc } from "@/util/rpc"
+import { upgrade } from "@/cli/upgrade"
await Log.init({
print: process.argv.includes("--print-logs"),
@@ -25,6 +26,8 @@ process.on("uncaughtException", (e) => {
})
})
+upgrade()
+
let server: Bun.Server<undefined>
export const rpc = {
async server(input: { port: number; hostname: string }) {