@@ -1489,6 +1489,21 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps)
14891489 onExpandImage,
14901490 onFileOpen,
14911491 } = props ;
1492+ const threadCostId = activeThread ?. id ;
1493+ const threadCostCreatedAt = activeThread ?. createdAt ;
1494+ const threadCostRefreshKey = activeContextWindow ?. updatedAt ?? null ;
1495+ const threadCost = useMemo (
1496+ ( ) =>
1497+ threadCostId === undefined || threadCostCreatedAt === undefined
1498+ ? null
1499+ : {
1500+ environmentId,
1501+ threadId : threadCostId ,
1502+ createdAt : threadCostCreatedAt ,
1503+ refreshKey : threadCostRefreshKey ,
1504+ } ,
1505+ [ environmentId , threadCostId , threadCostCreatedAt , threadCostRefreshKey ] ,
1506+ ) ;
14921507 const activeTasksProgress = props . threadSyncPhase === null ? props . activeTasksProgress : null ;
14931508 const activeTaskSteps = props . threadSyncPhase === null ? props . activeTaskSteps : null ;
14941509 // ------------------------------------------------------------------
@@ -5855,16 +5870,7 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps)
58555870 ) : null }
58565871 < ComposerFooterPrimaryActions
58575872 compact = { isComposerResting || isComposerPrimaryActionsCompact }
5858- threadCost = {
5859- activeThread
5860- ? {
5861- environmentId,
5862- threadId : activeThread . id ,
5863- createdAt : activeThread . createdAt ,
5864- refreshKey : activeContextWindow ?. updatedAt ?? null ,
5865- }
5866- : null
5867- }
5873+ threadCost = { threadCost }
58685874 activeContextWindow = {
58695875 settings . contextWindowMeterEnabled ? activeContextWindow : null
58705876 }
0 commit comments