tui: prevent deprecated models from appearing in model picker

This commit is contained in:
Dax Raad 2025-12-06 17:07:01 -05:00
parent 6923cc4a6a
commit 1b05d5dd8e
5 changed files with 12 additions and 6 deletions

View file

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

View file

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

View file

@ -44,6 +44,8 @@ export type PromptRef = {
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) {
let input: TextareaRenderable
let anchor: BoxRenderable
@ -278,7 +280,9 @@ export function Prompt(props: PromptProps) {
mode: "normal" | "shell"
extmarkToPartIndex: Map<number, number>
interrupt: number
placeholder: number
}>({
placeholder: Math.floor(Math.random() * PLACEHOLDERS.length),
prompt: {
input: "",
parts: [],
@ -666,7 +670,7 @@ export function Prompt(props: PromptProps) {
flexGrow={1}
>
<textarea
placeholder={props.sessionID ? undefined : "Build anything..."}
placeholder={props.sessionID ? undefined : `Ask anything... "${PLACEHOLDERS[store.placeholder]}"`}
textColor={theme.text}
focusedTextColor={theme.text}
minHeight={1}

View file

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

View file

@ -693,8 +693,7 @@ export namespace Provider {
model.api.id = model.api.id ?? model.id ?? modelID
if (modelID === "gpt-5-chat-latest" || (providerID === "openrouter" && modelID === "openai/gpt-5-chat"))
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 (
(configProvider?.blacklist && configProvider.blacklist.includes(modelID)) ||
(configProvider?.whitelist && !configProvider.whitelist.includes(modelID))