{"record":{"id":"ee833a7d43c565b7","repo":"Hmbown/CodeWhale","slug":"message-should-deserialize","errorCode":null,"errorMessage":"message should deserialize","messagePattern":"message should deserialize","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/models/src/lib.rs","lineNumber":925,"sourceCode":"        };\n        let via_core_path: codewhale_core::request::MessageRequest = via_tui_path.clone();\n        assert_eq!(\n            serde_json::to_vec(&via_tui_path).expect(\"serialize TUI path\"),\n            serde_json::to_vec(&via_core_path).expect(\"serialize core path\")\n        );\n    }\n\n    #[test]\n    fn interrupted_assistant_role_round_trips_as_distinct_session_item() {\n        let message = Message {\n            role: Role::InterruptedAssistant,\n            content: vec![ContentBlock::Text {\n                text: \"partial output\".to_string(),\n                cache_control: None,\n            }],\n        };\n        let encoded = serde_json::to_string(&message).expect(\"message should serialize\");\n        let decoded: Message = serde_json::from_str(&encoded).expect(\"message should deserialize\");\n        assert_eq!(decoded, message);\n        assert_ne!(decoded.role, \"assistant\");\n    }\n\n    #[test]\n    fn unrecognized_deepseek_models_do_not_inherit_sibling_metadata() {\n        for model in [\n            \"deepseek-v4-flash-20260423\",\n            \"deepseek-v4-pro-20260423\",\n            \"deepseek-coder\",\n            \"deepseek-v3.2-0324\",\n            \"deepseek-v4.1-flash-expires-on-0910\",\n        ] {\n            assert_eq!(context_window_for_model(model), None, \"{model}\");\n        }\n        assert!(!model_supports_reasoning(\n            \"deepseek-v4.1-flash-expires-on-0910\"\n        ));","sourceCodeStart":907,"sourceCodeEnd":943,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/433685b2024e7bc4c99e1e2e326bcad39b4d9d65/crates/models/src/lib.rs#L907-L943","documentation":"A test-only expect(\"message should deserialize\") panic: serde_json failed to parse the just-serialized JSON back into a Message. The test guards that an InterruptedAssistant message round-trips as a distinct session item; failure means the serialized form (role tag or content shape) is not accepted on the way back, so interrupted turns would be lost or coerced on reload.","triggerScenarios":"Thrown at crates/models/src/lib.rs:925 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Diff the serialized JSON against what Deserialize expects for Role::InterruptedAssistant","Align the serde attributes (tag, rename, content) so the serialized form parses back","Cover the full content-block set in the round-trip test to catch asymmetry early"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"433685b2024e7bc4c99e1e2e326bcad39b4d9d65","analyzedAt":"2026-09-15T12:24:24.634Z","contentChangedAt":"2026-09-15T12:24:24.634Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}