@@ -92,6 +92,7 @@ impl RolloutStore {
9292 cwd : PathBuf ,
9393 title : Option < String > ,
9494 model : Option < String > ,
95+ model_binding_id : Option < String > ,
9596 thinking : Option < String > ,
9697 model_provider : String ,
9798 parent_session_id : Option < SessionId > ,
@@ -112,6 +113,7 @@ impl RolloutStore {
112113 agent_path : None ,
113114 model_provider,
114115 model,
116+ model_binding_id,
115117 thinking,
116118 cwd,
117119 cli_version : env ! ( "CARGO_PKG_VERSION" ) . into ( ) ,
@@ -391,6 +393,7 @@ impl ReplayState {
391393 status : line. turn . status . clone ( ) ,
392394 kind : line. turn . kind . clone ( ) ,
393395 model : line. turn . model . clone ( ) ,
396+ model_binding_id : line. turn . model_binding_id . clone ( ) ,
394397 thinking : line. turn . thinking . clone ( ) ,
395398 reasoning_effort : line
396399 . turn
@@ -527,13 +530,19 @@ impl ReplayState {
527530 . div_ceil ( 4 ) ;
528531 let pending_turn_queue = std:: sync:: Arc :: clone ( & core_session. pending_turn_queue ) ;
529532 let btw_input_queue = std:: sync:: Arc :: clone ( & core_session. btw_input_queue ) ;
530- let summary_model = self
533+ let summary_model_selection = self
531534 . latest_turn_metadata
532535 . as_ref ( )
533- . map ( |turn| turn. model . clone ( ) )
536+ . and_then ( |turn| turn. model_binding_id . clone ( ) )
537+ . or_else ( || {
538+ self . latest_turn_metadata
539+ . as_ref ( )
540+ . map ( |turn| turn. model . clone ( ) )
541+ } )
542+ . or_else ( || record. model_binding_id . clone ( ) )
534543 . or_else ( || record. model . clone ( ) )
535544 . unwrap_or_else ( || deps. default_model . clone ( ) ) ;
536- let turn_config = deps. resolve_turn_config ( Some ( & summary_model ) , None ) ;
545+ let turn_config = deps. resolve_turn_config ( Some ( & summary_model_selection ) , None ) ;
537546 let concrete_selection = |selection : Option < & str > | {
538547 selection
539548 . map ( str:: trim)
@@ -565,6 +574,7 @@ impl ReplayState {
565574 . resolve_thinking_selection ( summary_thinking. as_deref ( ) )
566575 . effective_reasoning_effort ;
567576 record. model = Some ( turn_config. model . slug . clone ( ) ) ;
577+ record. model_binding_id = turn_config. model_binding_id . clone ( ) ;
568578 record. thinking = summary_thinking. clone ( ) ;
569579
570580 let summary = SessionMetadata {
@@ -580,6 +590,7 @@ impl ReplayState {
580590 agent_role : record. agent_role . clone ( ) ,
581591 ephemeral : false ,
582592 model : Some ( turn_config. model . slug ) ,
593+ model_binding_id : turn_config. model_binding_id . clone ( ) ,
583594 thinking : summary_thinking,
584595 reasoning_effort : summary_reasoning_effort,
585596 total_input_tokens : self . total_input_tokens ,
@@ -1147,6 +1158,7 @@ pub(crate) fn build_turn_record(
11471158 status : turn. status . clone ( ) ,
11481159 kind : turn. kind . clone ( ) ,
11491160 model : turn. model . clone ( ) ,
1161+ model_binding_id : turn. model_binding_id . clone ( ) ,
11501162 thinking : turn. thinking . clone ( ) ,
11511163 request_model : turn. request_model . clone ( ) ,
11521164 request_thinking : turn. request_thinking . clone ( ) ,
@@ -1491,6 +1503,7 @@ mod tests {
14911503 agent_path : None ,
14921504 model_provider : "test" . into ( ) ,
14931505 model : Some ( "model-a" . into ( ) ) ,
1506+ model_binding_id : None ,
14941507 thinking : None ,
14951508 cwd : PathBuf :: from ( "/tmp/root" ) ,
14961509 cli_version : "0.1.0" . into ( ) ,
@@ -1523,6 +1536,7 @@ mod tests {
15231536 status : TurnStatus :: Completed ,
15241537 kind : devo_core:: TurnKind :: Regular ,
15251538 model : "model-b" . into ( ) ,
1539+ model_binding_id : None ,
15261540 thinking : Some ( "enabled" . into ( ) ) ,
15271541 request_model : "model-b" . into ( ) ,
15281542 request_thinking : Some ( "enabled" . into ( ) ) ,
0 commit comments