@@ -3,6 +3,10 @@ import {
33 formatCooldown ,
44 formatWaitTime ,
55} from "../../accounts.js" ;
6+ import {
7+ evaluateForecastAccounts ,
8+ recommendForecastAccount ,
9+ } from "../../forecast.js" ;
610import type { ModelFamily } from "../../prompts/codex.js" ;
711import type { AccountStorageV3 } from "../../storage.js" ;
812
@@ -40,8 +44,22 @@ export async function runStatusCommand(
4044
4145 const now = deps . getNow ?.( ) ?? Date . now ( ) ;
4246 const activeIndex = deps . resolveActiveIndex ( storage , "codex" ) ;
47+ const forecastResults = evaluateForecastAccounts (
48+ storage . accounts . map ( ( account , index ) => ( {
49+ index,
50+ account,
51+ isCurrent : index === activeIndex ,
52+ now,
53+ } ) ) ,
54+ ) ;
55+ const recommendation = recommendForecastAccount ( forecastResults ) ;
4356 logInfo ( `Accounts (${ storage . accounts . length } )` ) ;
4457 logInfo ( `Storage: ${ path } ` ) ;
58+ if ( recommendation . recommendedIndex !== null ) {
59+ logInfo (
60+ `Selection reason: account ${ recommendation . recommendedIndex + 1 } (${ recommendation . reason } )` ,
61+ ) ;
62+ }
4563 logInfo ( "" ) ;
4664
4765 for ( let i = 0 ; i < storage . accounts . length ; i += 1 ) {
@@ -61,6 +79,10 @@ export async function runStatusCommand(
6179 ? `used ${ formatWaitTime ( now - account . lastUsed ) } ago`
6280 : "never used" ;
6381 logInfo ( `${ i + 1 } . ${ label } ${ markerLabel } ${ lastUsed } ` ) ;
82+ const primaryReason = forecastResults [ i ] ?. reasons [ 0 ] ;
83+ if ( primaryReason ) {
84+ logInfo ( ` reason: ${ primaryReason } ` ) ;
85+ }
6486 }
6587
6688 return 0 ;
0 commit comments