From fe4e5cad252179da996b377049021e930614eb67 Mon Sep 17 00:00:00 2001 From: minhn4 Date: Fri, 10 Jul 2026 20:54:40 +0700 Subject: [PATCH] feat(tui): gate the prompt footer model indicator on configured providers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR #30 hid the footer's model/provider indicator whenever the current provider id was `opencode`/`opencode-go`, which also suppressed it for a user who deliberately authenticated OpenCode / OpenCode-Go. The intent was only to hide the free hosted Zen default while nothing is configured. Gate the indicator on the shared `useConnected()` predicate instead — the same "a real provider is configured" signal `app.tsx`'s startup dialog and the provider/model pickers already use. `connected()` is false only in the unconfigured default state (sole provider is free hosted `opencode`), so a configured gateway/real provider, or a deliberately-authenticated opencode/opencode-go, shows its model normally. Co-Authored-By: Claude Opus 4.8 (1M context) --- DIVERGENCES.md | 2 +- packages/tui/src/component/prompt/index.tsx | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/DIVERGENCES.md b/DIVERGENCES.md index 7a123876ff..4058d0a70f 100644 --- a/DIVERGENCES.md +++ b/DIVERGENCES.md @@ -40,7 +40,7 @@ upstream maintainers — see README → Syncing with upstream for why and how. | `packages/opencode/src/installation/index.ts` | Updater detects/queries/installs `codev-code` (npm-family); GitHub fallback → quickbeard/codev-code | `codev-code upgrade` and the update notification target OUR npm package, never stock opencode. brew/choco/scoop probes never match (no such packages). | Keep our package names. | | `packages/opencode/src/config/config.ts` | `share` defaults to `"disabled"` when unset | Sharing publishes sessions to upstream's share service; internal users must opt in via config. | Keep our default block. | | `packages/tui/src/component/dialog-provider.tsx`, `packages/tui/src/component/dialog-model.tsx`, `packages/opencode/src/cli/cmd/providers.ts` | Filter `opencode`/`opencode-go` out of provider pickers and the `/model` dialog (model list + Favorites/Recent; the model dialog's opencode-first sort became a plain name sort) | Upstream's hosted offerings (Zen/Go) are detours for gateway users. | Keep our filters. | -| `packages/tui/src/component/prompt/index.tsx` | Added an `isHostedZenModel` memo (current `providerID` is `opencode`/`opencode-go`) and gated the prompt footer's model/provider indicator on `!isHostedZenModel()` | Don't advertise the hosted Zen default (e.g. "Big Pickle · OpenCode Zen") in the prompt footer — same rationale as the provider/model filters. A configured gateway/real provider still shows its model. | Keep the memo + the extra `Show` condition; take upstream's surrounding changes. | +| `packages/tui/src/component/prompt/index.tsx` | Gated the prompt footer's model/provider indicator on `useConnected()` (the shared "a real provider is configured" predicate) | Don't advertise the free hosted Zen default (e.g. "Big Pickle · OpenCode Zen") in the footer while nothing is configured — same rationale and predicate as `app.tsx`'s startup gate and the provider/model filters. A configured gateway/real provider, or a deliberately-authenticated opencode/opencode-go, still shows its model. | Keep the extra `Show` condition; take upstream's surrounding changes. | | `packages/app/index.html` | `` → "CoDev Code" | Web UI tab title. | Keep our title. | | `packages/app/src/desktop-menu.ts`, `packages/app/src/components/windows-app-menu.tsx` | App-menu label "OpenCode" → "CoDev Code" | Visible menu branding. | Keep our labels. | | `packages/desktop/src/main/index.ts`, `packages/desktop/src/main/windows.ts` | APP_NAMES + window title → "CoDev Code" (Dev/Beta variants too) | Desktop app display name. | Keep our names. | diff --git a/packages/tui/src/component/prompt/index.tsx b/packages/tui/src/component/prompt/index.tsx index b153cddd1f..f9635e24b9 100644 --- a/packages/tui/src/component/prompt/index.tsx +++ b/packages/tui/src/component/prompt/index.tsx @@ -44,6 +44,7 @@ import { formatDuration } from "../../util/format" import { createColors, createFrames } from "../../ui/spinner" import { useDialog } from "../../ui/dialog" import { DialogProvider as DialogProviderConnect } from "../dialog-provider" +import { useConnected } from "../use-connected" import { DialogAlert } from "../../ui/dialog-alert" import { useToast } from "../../ui/toast" import { useKV } from "../../context/kv" @@ -209,14 +210,13 @@ export function Prompt(props: PromptProps) { const move = usePromptMove({ projectID: project.project, sessionID: () => props.sessionID }) const [cursorVersion, setCursorVersion] = createSignal(0) const currentProviderLabel = createMemo(() => local.model.parsed().provider) - // Fork: hide the model/provider footer indicator for upstream's hosted Zen - // offerings (the `opencode`/`opencode-go` providers) — they're detours for - // gateway users, and the same ids are filtered from the provider/model - // pickers. A configured gateway/real provider still shows its model. - const isHostedZenModel = createMemo(() => { - const id = local.model.current()?.providerID - return id === "opencode" || id === "opencode-go" - }) + // Fork: only advertise a model/provider in the footer once the user has + // configured a real provider. `connected()` is false in the unconfigured + // default state — where the sole provider is upstream's free hosted Zen + // (`opencode`) — so we suppress the "Big Pickle · OpenCode Zen" prose there. + // A configured gateway/real provider, or a deliberately-authenticated + // opencode/opencode-go, is `connected()` and still shows its model. + const connected = useConnected() const hasRightContent = createMemo(() => Boolean(props.right)) function promptModelWarning() { @@ -1455,7 +1455,7 @@ export function Prompt(props: PromptProps) { <Show when={store.mode === "normal" && local.permission.mode === "auto"}> <text fg={fadeColor(theme.textMuted, agentMetaAlpha())}>auto</text> </Show> - <Show when={store.mode === "normal" && !isHostedZenModel()}> + <Show when={store.mode === "normal" && connected()}> <box flexDirection="row" gap={1}> <text fg={fadeColor(theme.textMuted, modelMetaAlpha())}>·</text> <text