File tree Expand file tree Collapse file tree
pattern_core/src/agent/impls Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -478,7 +478,7 @@ pub async fn create_agent_from_record_with_tracker(
478478 . context
479479 . as_ref( )
480480 . and_then( |c| c. max_messages)
481- . unwrap_or( 50 ) ,
481+ . unwrap_or( 100 ) ,
482482 compression_strategy
483483 . as_ref( )
484484 . map( |s| format!( "{:?}" , s) )
Original file line number Diff line number Diff line change @@ -909,15 +909,15 @@ where
909909 . find ( |m| m. id == * model_id || m. name == * model_id)
910910 . map ( |m| {
911911 // Use 90% of context window to leave room for output
912- ( m. context_window as f64 * 0.9 ) as usize
912+ ( m. context_window - m . max_output_tokens . unwrap_or_else ( || 8192 ) ) as usize
913913 } )
914914 } else {
915915 None
916916 } ;
917917
918918 // Build the context config from the record with token limit
919919 let mut context_config = record. to_context_config ( ) ;
920- context_config. max_context_tokens = max_context_tokens. or ( Some ( 180_000 ) ) ; // Fallback to 180k
920+ context_config. max_context_tokens = max_context_tokens. or ( Some ( 136_000 ) ) ; // Fallback to 136k
921921
922922 // Load tool rules from database record (with config fallback)
923923 let tool_rules = if !record. tool_rules . is_empty ( ) {
You can’t perform that action at this time.
0 commit comments