| ... | @@ -103,6 +103,7 @@ import { | ... | @@ -103,6 +103,7 @@ import { |
| 103 | renderProviderTraitsPicker, | 103 | renderProviderTraitsPicker, |
| 104 | } from "./composerProviderState"; | 104 | } from "./composerProviderState"; |
| 105 | import { ContextWindowMeter } from "./ContextWindowMeter"; | 105 | import { ContextWindowMeter } from "./ContextWindowMeter"; |
| | 106 | import { resolveContextWindowModelDisplayName } from "./ContextWindowMeter.logic"; |
| 106 | import { buildExpandedImagePreview, type ExpandedImagePreview } from "./ExpandedImagePreview"; | 107 | import { buildExpandedImagePreview, type ExpandedImagePreview } from "./ExpandedImagePreview"; |
| 107 | import { basenameOfPath } from "../../pierre-icons"; | 108 | import { basenameOfPath } from "../../pierre-icons"; |
| 108 | import { cn, randomUUID } from "~/lib/utils"; | 109 | import { cn, randomUUID } from "~/lib/utils"; |
| ... | @@ -210,7 +211,7 @@ import { | ... | @@ -210,7 +211,7 @@ import { |
| 210 | XIcon, | 211 | XIcon, |
| 211 | } from "lucide-react"; | 212 | } from "lucide-react"; |
| 212 | import { proposedPlanTitle } from "../../proposedPlan"; | 213 | import { proposedPlanTitle } from "../../proposedPlan"; |
| 213 | import { getProviderDisplayName, getProviderInteractionModeToggle } from "../../providerModels"; | 214 | import { getProviderInteractionModeToggle } from "../../providerModels"; |
| 214 | import { | 215 | import { |
| 215 | applyProviderInstanceSettings, | 216 | applyProviderInstanceSettings, |
| 216 | deriveProviderInstanceEntries, | 217 | deriveProviderInstanceEntries, |
| ... | @@ -225,10 +226,7 @@ import type { UnifiedSettings } from "@t3tools/contracts/settings"; | ... | @@ -225,10 +226,7 @@ import type { UnifiedSettings } from "@t3tools/contracts/settings"; |
| 225 | import type { SessionPhase, Thread } from "../../types"; | 226 | import type { SessionPhase, Thread } from "../../types"; |
| 226 | import type { PendingUserInputDraftAnswer } from "../../pendingUserInput"; | 227 | import type { PendingUserInputDraftAnswer } from "../../pendingUserInput"; |
| 227 | import type { PendingApproval, PendingUserInput } from "../../session-logic"; | 228 | import type { PendingApproval, PendingUserInput } from "../../session-logic"; |
| 228 | import { | 229 | import { deriveLatestContextWindowSnapshot } from "../../lib/contextWindow"; |
| 229 | deriveLatestContextWindowSnapshot, | | |
| 230 | formatProviderDisplayName, | | |
| 231 | } from "../../lib/contextWindow"; | | |
| 232 | import { formatProviderSkillDisplayName } from "../../providerSkillPresentation"; | 230 | import { formatProviderSkillDisplayName } from "../../providerSkillPresentation"; |
| 233 | import { searchProviderSkills } from "../../providerSkillSearch"; | 231 | import { searchProviderSkills } from "../../providerSkillSearch"; |
| 234 | import { useMediaQuery } from "../../hooks/useMediaQuery"; | 232 | import { useMediaQuery } from "../../hooks/useMediaQuery"; |
| ... | @@ -396,7 +394,7 @@ const ComposerFooterModeControls = memo(function ComposerFooterModeControls(prop | ... | @@ -396,7 +394,7 @@ const ComposerFooterModeControls = memo(function ComposerFooterModeControls(prop |
| 396 | const ComposerFooterPrimaryActions = memo(function ComposerFooterPrimaryActions(props: { | 394 | const ComposerFooterPrimaryActions = memo(function ComposerFooterPrimaryActions(props: { |
| 397 | compact: boolean; | 395 | compact: boolean; |
| 398 | activeContextWindow: ReturnType<typeof deriveLatestContextWindowSnapshot>; | 396 | activeContextWindow: ReturnType<typeof deriveLatestContextWindowSnapshot>; |
| 399 | activeThreadProviderDisplayName: string | null; | 397 | activeThreadModelDisplayName: string | null; |
| 400 | isPreparingWorktree: boolean; | 398 | isPreparingWorktree: boolean; |
| 401 | pendingAction: { | 399 | pendingAction: { |
| 402 | questionIndex: number; | 400 | questionIndex: number; |
| ... | @@ -424,7 +422,7 @@ const ComposerFooterPrimaryActions = memo(function ComposerFooterPrimaryActions( | ... | @@ -424,7 +422,7 @@ const ComposerFooterPrimaryActions = memo(function ComposerFooterPrimaryActions( |
| 424 | {props.activeContextWindow ? ( | 422 | {props.activeContextWindow ? ( |
| 425 | <ContextWindowMeter | 423 | <ContextWindowMeter |
| 426 | usage={props.activeContextWindow} | 424 | usage={props.activeContextWindow} |
| 427 | providerDisplayName={props.activeThreadProviderDisplayName} | 425 | modelDisplayName={props.activeThreadModelDisplayName} |
| 428 | /> | 426 | /> |
| 429 | ) : null} | 427 | ) : null} |
| 430 | {props.isPreparingWorktree ? ( | 428 | {props.isPreparingWorktree ? ( |
| ... | @@ -930,16 +928,10 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps) | ... | @@ -930,16 +928,10 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps) |
| 930 | () => deriveLatestContextWindowSnapshot(activeThreadActivities ?? []), | 928 | () => deriveLatestContextWindowSnapshot(activeThreadActivities ?? []), |
| 931 | [activeThreadActivities], | 929 | [activeThreadActivities], |
| 932 | ); | 930 | ); |
| 933 | const activeThreadProviderDisplayName = useMemo(() => { | 931 | const activeThreadModelDisplayName = useMemo( |
| 934 | if (!activeThreadModelSelection) return null; | 932 | () => resolveContextWindowModelDisplayName(activeThreadModelSelection, modelOptionsByInstance), |
| 935 | const entry = providerStatuses.find( | 933 | [activeThreadModelSelection, modelOptionsByInstance], |
| 936 | (p) => p.instanceId === activeThreadModelSelection.instanceId, | 934 | ); |
| 937 | ); | | |
| 938 | if (entry) { | | |
| 939 | return getProviderDisplayName(providerStatuses, entry.driver); | | |
| 940 | } | | |
| 941 | return formatProviderDisplayName(activeThreadModelSelection.instanceId); | | |
| 942 | }, [providerStatuses, activeThreadModelSelection]); | | |
| 943 | | 935 | |
| 944 | // ------------------------------------------------------------------ | 936 | // ------------------------------------------------------------------ |
| 945 | // Composer-local state | 937 | // Composer-local state |
| ... | @@ -3222,7 +3214,7 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps) | ... | @@ -3222,7 +3214,7 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps) |
| 3222 | <ComposerFooterPrimaryActions | 3214 | <ComposerFooterPrimaryActions |
| 3223 | compact={isComposerPrimaryActionsCompact} | 3215 | compact={isComposerPrimaryActionsCompact} |
| 3224 | activeContextWindow={activeContextWindow} | 3216 | activeContextWindow={activeContextWindow} |
| 3225 | activeThreadProviderDisplayName={activeThreadProviderDisplayName} | 3217 | activeThreadModelDisplayName={activeThreadModelDisplayName} |
| 3226 | pendingAction={pendingPrimaryAction} | 3218 | pendingAction={pendingPrimaryAction} |
| 3227 | isRunning={phase === "running"} | 3219 | isRunning={phase === "running"} |
| 3228 | showPlanFollowUpPrompt={pendingUserInputs.length === 0 && showPlanFollowUpPrompt} | 3220 | showPlanFollowUpPrompt={pendingUserInputs.length === 0 && showPlanFollowUpPrompt} |