فهرست منبع

tui: prevent deprecated models from appearing in model picker

Dax Raad 2 ماه پیش
والد
کامیت
1b05d5dd8e

+ 1 - 0
packages/opencode/src/cli/cmd/tui/component/dialog-model.tsx

@@ -108,6 +108,7 @@ export function DialogModel() {
           pipe(
           pipe(
             provider.models,
             provider.models,
             entries(),
             entries(),
+            filter(([_, info]) => info.status !== "deprecated"),
             map(([model, info]) => {
             map(([model, info]) => {
               const value = {
               const value = {
                 providerID: provider.id,
                 providerID: provider.id,

+ 0 - 3
packages/opencode/src/cli/cmd/tui/component/logo.tsx

@@ -21,9 +21,6 @@ export function Logo() {
           </box>
           </box>
         )}
         )}
       </For>
       </For>
-      <box flexDirection="row" justifyContent="flex-end">
-        <text fg={theme.textMuted}>{Installation.VERSION}</text>
-      </box>
     </box>
     </box>
   )
   )
 }
 }

+ 5 - 1
packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx

@@ -44,6 +44,8 @@ export type PromptRef = {
   focus(): void
   focus(): void
 }
 }
 
 
+const PLACEHOLDERS = ["Fix a TODO in the codebase", "What is the tech stack of this project?", "Fix broken tests"]
+
 export function Prompt(props: PromptProps) {
 export function Prompt(props: PromptProps) {
   let input: TextareaRenderable
   let input: TextareaRenderable
   let anchor: BoxRenderable
   let anchor: BoxRenderable
@@ -278,7 +280,9 @@ export function Prompt(props: PromptProps) {
     mode: "normal" | "shell"
     mode: "normal" | "shell"
     extmarkToPartIndex: Map<number, number>
     extmarkToPartIndex: Map<number, number>
     interrupt: number
     interrupt: number
+    placeholder: number
   }>({
   }>({
+    placeholder: Math.floor(Math.random() * PLACEHOLDERS.length),
     prompt: {
     prompt: {
       input: "",
       input: "",
       parts: [],
       parts: [],
@@ -666,7 +670,7 @@ export function Prompt(props: PromptProps) {
             flexGrow={1}
             flexGrow={1}
           >
           >
             <textarea
             <textarea
-              placeholder={props.sessionID ? undefined : "Build anything..."}
+              placeholder={props.sessionID ? undefined : `Ask anything... "${PLACEHOLDERS[store.placeholder]}"`}
               textColor={theme.text}
               textColor={theme.text}
               focusedTextColor={theme.text}
               focusedTextColor={theme.text}
               minHeight={1}
               minHeight={1}

+ 5 - 0
packages/opencode/src/cli/cmd/tui/routes/home.tsx

@@ -9,6 +9,7 @@ import { useArgs } from "../context/args"
 import { useDirectory } from "../context/directory"
 import { useDirectory } from "../context/directory"
 import { useRoute, useRouteData } from "@tui/context/route"
 import { useRoute, useRouteData } from "@tui/context/route"
 import { usePromptRef } from "../context/prompt"
 import { usePromptRef } from "../context/prompt"
+import { Installation } from "@/installation"
 
 
 // TODO: what is the best way to do this?
 // TODO: what is the best way to do this?
 let once = false
 let once = false
@@ -89,6 +90,10 @@ export function Home() {
             <text fg={theme.textMuted}>/status</text>
             <text fg={theme.textMuted}>/status</text>
           </Show>
           </Show>
         </box>
         </box>
+        <box flexGrow={1} />
+        <box flexShrink={0}>
+          <text fg={theme.textMuted}>{Installation.VERSION}</text>
+        </box>
       </box>
       </box>
     </>
     </>
   )
   )

+ 1 - 2
packages/opencode/src/provider/provider.ts

@@ -693,8 +693,7 @@ export namespace Provider {
         model.api.id = model.api.id ?? model.id ?? modelID
         model.api.id = model.api.id ?? model.id ?? modelID
         if (modelID === "gpt-5-chat-latest" || (providerID === "openrouter" && modelID === "openai/gpt-5-chat"))
         if (modelID === "gpt-5-chat-latest" || (providerID === "openrouter" && modelID === "openai/gpt-5-chat"))
           delete provider.models[modelID]
           delete provider.models[modelID]
-        if ((model.status === "alpha" && !Flag.OPENCODE_ENABLE_EXPERIMENTAL_MODELS) || model.status === "deprecated")
-          delete provider.models[modelID]
+        if (model.status === "alpha" && !Flag.OPENCODE_ENABLE_EXPERIMENTAL_MODELS) delete provider.models[modelID]
         if (
         if (
           (configProvider?.blacklist && configProvider.blacklist.includes(modelID)) ||
           (configProvider?.blacklist && configProvider.blacklist.includes(modelID)) ||
           (configProvider?.whitelist && !configProvider.whitelist.includes(modelID))
           (configProvider?.whitelist && !configProvider.whitelist.includes(modelID))