@@ -463,6 +463,9 @@ impl ChatArgs {
463463// Maximum number of times to show the changelog announcement per version
464464const CHANGELOG_MAX_SHOW_COUNT : i64 = 2 ;
465465
466+ // Maximum number of times to show the Kiro upgrade announcement
467+ const KIRO_UPGRADE_MAX_SHOW_COUNT : i64 = 2 ;
468+
466469const GREETING_BREAK_POINT : usize = 80 ;
467470
468471const RESPONSE_TIMEOUT_CONTENT : & str = "Response timed out - message took too long to generate" ;
@@ -1207,6 +1210,32 @@ impl ChatSession {
12071210 Ok ( ( ) )
12081211 }
12091212
1213+ async fn show_kiro_upgrade_announcement ( & mut self , os : & mut Os ) -> Result < bool > {
1214+ let show_count = os. database . get_kiro_upgrade_show_count ( ) ?. unwrap_or ( 0 ) ;
1215+
1216+ // Only show if we haven't reached the max count
1217+ if show_count < KIRO_UPGRADE_MAX_SHOW_COUNT {
1218+ let announcement_with_styling = crate :: constants:: kiro_upgrade_announcement ( ) ;
1219+
1220+ draw_box (
1221+ & mut self . stderr ,
1222+ "" ,
1223+ & announcement_with_styling,
1224+ GREETING_BREAK_POINT ,
1225+ crate :: theme:: theme ( ) . ui . secondary_text ,
1226+ ) ?;
1227+
1228+ execute ! ( self . stderr, style:: Print ( "\n " ) ) ?;
1229+
1230+ // Update the show count
1231+ os. database . set_kiro_upgrade_show_count ( show_count + 1 ) ?;
1232+
1233+ Ok ( true )
1234+ } else {
1235+ Ok ( false )
1236+ }
1237+ }
1238+
12101239 /// Reload built-in tools to reflect experiment changes while preserving MCP tools
12111240 pub async fn reload_builtin_tools ( & mut self , os : & mut Os ) -> Result < ( ) , ChatError > {
12121241 self . conversation
@@ -1308,6 +1337,11 @@ impl ChatSession {
13081337
13091338 async fn spawn ( & mut self , os : & mut Os ) -> Result < ( ) > {
13101339 let is_small_screen = self . terminal_width ( ) < GREETING_BREAK_POINT ;
1340+
1341+ // Check if Kiro upgrade announcement will be shown
1342+ let show_count = os. database . get_kiro_upgrade_show_count ( ) ?. unwrap_or ( 0 ) ;
1343+ let kiro_announcement_will_show = show_count < KIRO_UPGRADE_MAX_SHOW_COUNT ;
1344+
13111345 if os
13121346 . database
13131347 . settings
@@ -1324,26 +1358,30 @@ impl ChatSession {
13241358
13251359 execute ! ( self . stderr, style:: Print ( & welcome_text) , style:: Print ( "\n \n " ) , ) ?;
13261360
1327- let rotating_tips = tips:: get_rotating_tips ( ) ;
1328- let tip = & rotating_tips[ usize:: try_from ( rand:: random :: < u32 > ( ) ) . unwrap_or ( 0 ) % rotating_tips. len ( ) ] ;
1329- if is_small_screen {
1330- // If the screen is small, print the tip in a single line
1331- execute ! (
1332- self . stderr,
1333- style:: Print ( "💡 " . to_string( ) ) ,
1334- style:: Print ( tip) ,
1335- style:: Print ( "\n " )
1336- ) ?;
1337- } else {
1338- draw_box (
1339- & mut self . stderr ,
1340- "Did you know?" ,
1341- tip,
1342- GREETING_BREAK_POINT ,
1343- crate :: theme:: theme ( ) . ui . secondary_text ,
1344- ) ?;
1361+ // Only show rotating tips if Kiro announcement won't be shown
1362+ if !kiro_announcement_will_show {
1363+ let rotating_tips = tips:: get_rotating_tips ( ) ;
1364+ let tip = & rotating_tips[ usize:: try_from ( rand:: random :: < u32 > ( ) ) . unwrap_or ( 0 ) % rotating_tips. len ( ) ] ;
1365+ if is_small_screen {
1366+ // If the screen is small, print the tip in a single line
1367+ execute ! (
1368+ self . stderr,
1369+ style:: Print ( "💡 " . to_string( ) ) ,
1370+ style:: Print ( tip) ,
1371+ style:: Print ( "\n " )
1372+ ) ?;
1373+ } else {
1374+ draw_box (
1375+ & mut self . stderr ,
1376+ "Did you know?" ,
1377+ tip,
1378+ GREETING_BREAK_POINT ,
1379+ crate :: theme:: theme ( ) . ui . secondary_text ,
1380+ ) ?;
1381+ }
13451382 }
13461383
1384+ // Always show shortcuts and separator
13471385 execute ! (
13481386 self . stderr,
13491387 style:: Print ( "\n " ) ,
@@ -1361,8 +1399,10 @@ impl ChatSession {
13611399 execute ! ( self . stderr, style:: Print ( "\n " ) , StyledText :: reset( ) ) ?;
13621400 }
13631401
1364- // Check if we should show the whats-new announcement
1365- self . show_changelog_announcement ( os) . await ?;
1402+ // Only show changelog if Kiro announcement won't be shown
1403+ if !kiro_announcement_will_show {
1404+ self . show_changelog_announcement ( os) . await ?;
1405+ }
13661406
13671407 if self . all_tools_trusted ( ) {
13681408 queue ! (
@@ -1422,6 +1462,9 @@ impl ChatSession {
14221462 self . conversation . checkpoint_manager = checkpoint_manager;
14231463 }
14241464
1465+ // Show Kiro upgrade announcement (limited to 2 times)
1466+ self . show_kiro_upgrade_announcement ( os) . await ?;
1467+
14251468 if let Some ( user_input) = self . initial_input . take ( ) {
14261469 self . inner = Some ( ChatState :: HandleInput { input : user_input } ) ;
14271470 }
0 commit comments