{"record":{"id":"c650256de1130a3a","repo":"Hmbown/CodeWhale","slug":"serialize-core-path","errorCode":null,"errorMessage":"serialize core path","messagePattern":"serialize core path","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/models/src/lib.rs","lineNumber":911,"sourceCode":"\n        let via_tui_path = MessageRequest {\n            model: \"model\".to_string(),\n            messages: vec![],\n            max_tokens: 1024,\n            system: None,\n            tools: None,\n            tool_choice: None,\n            metadata: None,\n            thinking: None,\n            reasoning_effort: None,\n            stream: Some(true),\n            temperature: None,\n            top_p: None,\n        };\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","sourceCodeStart":893,"sourceCodeEnd":929,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/433685b2024e7bc4c99e1e2e326bcad39b4d9d65/crates/models/src/lib.rs#L893-L929","documentation":"A test-only expect(\"serialize core path\") panic: serde_json::to_vec failed on the MessageRequest obtained through the codewhale_core::request path. Since the test asserts the TUI and core values serialize to equal bytes, this panic means the core-typed clone itself failed to serialize, indicating a real incompatibility between the two type paths rather than a test-fixture issue.","triggerScenarios":"Thrown at crates/models/src/lib.rs:911 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Compare the Serialize impls of the TUI and core MessageRequest types for divergence","Fix whichever type's serialization errors, keeping the wire format identical across both paths","Add a regression test covering the offending field on both paths"],"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"}