diff options
| author | Dax Raad <[email protected]> | 2026-03-09 15:30:15 -0400 |
|---|---|---|
| committer | Dax Raad <[email protected]> | 2026-03-09 15:30:15 -0400 |
| commit | 39ef7fc90e9c77dcf50d8f79efc492a2a3ae12ec (patch) | |
| tree | f594a71e396ab418c8552fb423c48597c1a6e90d /packages | |
| parent | 37ae0a405136a037b5df63d5d19c133de5d5ad95 (diff) | |
| parent | b312928e9f9149aaacf1cbb9af96399c1672c334 (diff) | |
| download | opencode-39ef7fc90e9c77dcf50d8f79efc492a2a3ae12ec.tar.gz opencode-39ef7fc90e9c77dcf50d8f79efc492a2a3ae12ec.zip | |
Merge remote-tracking branch 'origin/dev' into dev
Diffstat (limited to 'packages')
| -rw-r--r-- | packages/opencode/src/cli/cmd/tui/routes/home.tsx | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/packages/opencode/src/cli/cmd/tui/routes/home.tsx b/packages/opencode/src/cli/cmd/tui/routes/home.tsx index c011f6c62..24ea8f3b3 100644 --- a/packages/opencode/src/cli/cmd/tui/routes/home.tsx +++ b/packages/opencode/src/cli/cmd/tui/routes/home.tsx @@ -1,5 +1,5 @@ import { Prompt, type PromptRef } from "@tui/component/prompt" -import { createMemo, Match, onMount, Show, Switch } from "solid-js" +import { createEffect, createMemo, Match, on, onMount, Show, Switch } from "solid-js" import { useTheme } from "@tui/context/theme" import { useKeybind } from "@tui/context/keybind" import { Logo } from "../component/logo" @@ -14,6 +14,7 @@ import { usePromptRef } from "../context/prompt" import { Installation } from "@/installation" import { useKV } from "../context/kv" import { useCommandDialog } from "../component/dialog-command" +import { useLocal } from "../context/local" // TODO: what is the best way to do this? let once = false @@ -76,6 +77,7 @@ export function Home() { let prompt: PromptRef const args = useArgs() + const local = useLocal() onMount(() => { if (once) return if (route.initialPrompt) { @@ -84,9 +86,21 @@ export function Home() { } else if (args.prompt) { prompt.set({ input: args.prompt, parts: [] }) once = true - prompt.submit() } }) + + // Wait for sync and model store to be ready before auto-submitting --prompt + createEffect( + on( + () => sync.ready && local.model.ready, + (ready) => { + if (!ready) return + if (!args.prompt) return + if (prompt.current?.input !== args.prompt) return + prompt.submit() + }, + ), + ) const directory = useDirectory() const keybind = useKeybind() |
