| 5812 | |
| 5813 | #[test] |
| 5814 | fn orchestration_object_conversions_round_trip_fields() { |
| 5815 | let schema = serde_json::json!({ "type": "object" }); |
| 5816 | let spec = AgentStepSpecObject { |
| 5817 | task_id: "t1".into(), |
| 5818 | agent: "explore".into(), |
| 5819 | description: "d".into(), |
| 5820 | prompt: "p".into(), |
| 5821 | max_steps: Some(5), |
| 5822 | parent_session_id: Some("parent".into()), |
| 5823 | output_schema: Some(schema.clone()), |
| 5824 | }; |
| 5825 | let rust: RustAgentStepSpec = spec.into(); |
| 5826 | assert_eq!(rust.task_id, "t1"); |
| 5827 | assert_eq!(rust.agent, "explore"); |
| 5828 | assert_eq!(rust.max_steps, Some(5)); |
| 5829 | assert_eq!(rust.parent_session_id.as_deref(), Some("parent")); |
| 5830 | assert_eq!(rust.output_schema, Some(schema)); |
| 5831 | |
| 5832 | let outcome = RustStepOutcome { |
| 5833 | task_id: "t1".into(), |
| 5834 | session_id: "task-run-t1".into(), |
| 5835 | agent: "explore".into(), |
| 5836 | output: "out".into(), |
| 5837 | success: true, |
| 5838 | structured: Some(serde_json::json!({ "k": 1 })), |
| 5839 | }; |
| 5840 | let obj = StepOutcomeObject::from(outcome); |
| 5841 | assert_eq!(obj.task_id, "t1"); |
| 5842 | assert!(obj.success); |
| 5843 | assert_eq!(obj.structured, Some(serde_json::json!({ "k": 1 }))); |
| 5844 | } |
| 5845 | |
| 5846 | fn sdk_test_config() -> a3s_code_core::CodeConfig { |
| 5847 | a3s_code_core::CodeConfig { |