File tree Expand file tree Collapse file tree
rust/crates/rusty-claude-cli/tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -276,6 +276,47 @@ fn resumed_status_command_emits_structured_json_when_requested() {
276276 assert ! ( parsed[ "sandbox" ] [ "filesystem_mode" ] . as_str( ) . is_some( ) ) ;
277277}
278278
279+ #[ test]
280+ fn resumed_status_surfaces_persisted_model ( ) {
281+ // given — create a session with model already set
282+ let temp_dir = unique_temp_dir ( "resume-status-model" ) ;
283+ fs:: create_dir_all ( & temp_dir) . expect ( "temp dir should exist" ) ;
284+ let session_path = temp_dir. join ( "session.jsonl" ) ;
285+
286+ let mut session = Session :: new ( ) ;
287+ session. model = Some ( "claude-sonnet-4-6" . to_string ( ) ) ;
288+ session
289+ . push_user_text ( "model persistence fixture" )
290+ . expect ( "write ok" ) ;
291+ session. save_to_path ( & session_path) . expect ( "persist ok" ) ;
292+
293+ // when
294+ let output = run_claw (
295+ & temp_dir,
296+ & [
297+ "--output-format" ,
298+ "json" ,
299+ "--resume" ,
300+ session_path. to_str ( ) . expect ( "utf8 path" ) ,
301+ "/status" ,
302+ ] ,
303+ ) ;
304+
305+ // then
306+ assert ! (
307+ output. status. success( ) ,
308+ "stderr:\n {}" ,
309+ String :: from_utf8_lossy( & output. stderr)
310+ ) ;
311+ let stdout = String :: from_utf8 ( output. stdout ) . expect ( "utf8" ) ;
312+ let parsed: Value = serde_json:: from_str ( stdout. trim ( ) ) . expect ( "should be json" ) ;
313+ assert_eq ! ( parsed[ "kind" ] , "status" ) ;
314+ assert_eq ! (
315+ parsed[ "model" ] , "claude-sonnet-4-6" ,
316+ "model should round-trip through session metadata"
317+ ) ;
318+ }
319+
279320#[ test]
280321fn resumed_sandbox_command_emits_structured_json_when_requested ( ) {
281322 // given
You can’t perform that action at this time.
0 commit comments