@@ -103,6 +103,7 @@ import {
103103 renderProviderTraitsPicker ,
104104} from "./composerProviderState" ;
105105import { ContextWindowMeter } from "./ContextWindowMeter" ;
106+ import { resolveContextWindowModelDisplayName } from "./ContextWindowMeter.logic" ;
106107import { buildExpandedImagePreview , type ExpandedImagePreview } from "./ExpandedImagePreview" ;
107108import { basenameOfPath } from "../../pierre-icons" ;
108109import { cn , randomUUID } from "~/lib/utils" ;
@@ -210,7 +211,7 @@ import {
210211 XIcon ,
211212} from "lucide-react" ;
212213import { proposedPlanTitle } from "../../proposedPlan" ;
213- import { getProviderDisplayName , getProviderInteractionModeToggle } from "../../providerModels" ;
214+ import { getProviderInteractionModeToggle } from "../../providerModels" ;
214215import {
215216 applyProviderInstanceSettings ,
216217 deriveProviderInstanceEntries ,
@@ -225,10 +226,7 @@ import type { UnifiedSettings } from "@t3tools/contracts/settings";
225226import type { SessionPhase , Thread } from "../../types" ;
226227import type { PendingUserInputDraftAnswer } from "../../pendingUserInput" ;
227228import type { PendingApproval , PendingUserInput } from "../../session-logic" ;
228- import {
229- deriveLatestContextWindowSnapshot ,
230- formatProviderDisplayName ,
231- } from "../../lib/contextWindow" ;
229+ import { deriveLatestContextWindowSnapshot } from "../../lib/contextWindow" ;
232230import { formatProviderSkillDisplayName } from "../../providerSkillPresentation" ;
233231import { searchProviderSkills } from "../../providerSkillSearch" ;
234232import { useMediaQuery } from "../../hooks/useMediaQuery" ;
@@ -396,7 +394,7 @@ const ComposerFooterModeControls = memo(function ComposerFooterModeControls(prop
396394const ComposerFooterPrimaryActions = memo ( function ComposerFooterPrimaryActions ( props : {
397395 compact : boolean ;
398396 activeContextWindow : ReturnType < typeof deriveLatestContextWindowSnapshot > ;
399- activeThreadProviderDisplayName : string | null ;
397+ activeThreadModelDisplayName : string | null ;
400398 isPreparingWorktree : boolean ;
401399 pendingAction : {
402400 questionIndex : number ;
@@ -424,7 +422,7 @@ const ComposerFooterPrimaryActions = memo(function ComposerFooterPrimaryActions(
424422 { props . activeContextWindow ? (
425423 < ContextWindowMeter
426424 usage = { props . activeContextWindow }
427- providerDisplayName = { props . activeThreadProviderDisplayName }
425+ modelDisplayName = { props . activeThreadModelDisplayName }
428426 />
429427 ) : null }
430428 { props . isPreparingWorktree ? (
@@ -930,16 +928,10 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps)
930928 ( ) => deriveLatestContextWindowSnapshot ( activeThreadActivities ?? [ ] ) ,
931929 [ activeThreadActivities ] ,
932930 ) ;
933- const activeThreadProviderDisplayName = useMemo ( ( ) => {
934- if ( ! activeThreadModelSelection ) return null ;
935- const entry = providerStatuses . find (
936- ( p ) => p . instanceId === activeThreadModelSelection . instanceId ,
937- ) ;
938- if ( entry ) {
939- return getProviderDisplayName ( providerStatuses , entry . driver ) ;
940- }
941- return formatProviderDisplayName ( activeThreadModelSelection . instanceId ) ;
942- } , [ providerStatuses , activeThreadModelSelection ] ) ;
931+ const activeThreadModelDisplayName = useMemo (
932+ ( ) => resolveContextWindowModelDisplayName ( activeThreadModelSelection , modelOptionsByInstance ) ,
933+ [ activeThreadModelSelection , modelOptionsByInstance ] ,
934+ ) ;
943935
944936 // ------------------------------------------------------------------
945937 // Composer-local state
@@ -3222,7 +3214,7 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps)
32223214 < ComposerFooterPrimaryActions
32233215 compact = { isComposerPrimaryActionsCompact }
32243216 activeContextWindow = { activeContextWindow }
3225- activeThreadProviderDisplayName = { activeThreadProviderDisplayName }
3217+ activeThreadModelDisplayName = { activeThreadModelDisplayName }
32263218 pendingAction = { pendingPrimaryAction }
32273219 isRunning = { phase === "running" }
32283220 showPlanFollowUpPrompt = { pendingUserInputs . length === 0 && showPlanFollowUpPrompt }
0 commit comments