File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -1608,6 +1608,28 @@ impl ExtensionManager {
16081608 working_dir. display( )
16091609 ) ;
16101610
1611+ if let Ok ( session) = self
1612+ . context
1613+ . session_manager
1614+ . get_session ( session_id, false )
1615+ . await
1616+ {
1617+ if let ( Some ( total) , Some ( config) ) =
1618+ ( session. total_tokens , session. model_config . as_ref ( ) )
1619+ {
1620+ let limit = config. context_limit ( ) ;
1621+ if total > 0 && limit > 0 {
1622+ let pct = ( total as f64 / limit as f64 * 100.0 ) . round ( ) as u32 ;
1623+ content. push_str ( & format ! (
1624+ "Context: ~{}k/{}k tokens used ({}%)\n " ,
1625+ total / 1000 ,
1626+ limit / 1000 ,
1627+ pct
1628+ ) ) ;
1629+ }
1630+ }
1631+ }
1632+
16111633 let platform_clients: Vec < ( String , McpClientBox ) > = {
16121634 let extensions = self . extensions . lock ( ) . await ;
16131635 extensions
You can’t perform that action at this time.
0 commit comments