()
| 1803 | |
| 1804 | #[tokio::test] |
| 1805 | async fn failed_step_with_schema_skips_coercion() { |
| 1806 | let workspace = tempfile::tempdir().unwrap(); |
| 1807 | let executor = TaskExecutor::new( |
| 1808 | Arc::new(AgentRegistry::new()), |
| 1809 | Arc::new(SchemaCoercionClient), |
| 1810 | workspace.path().to_string_lossy().to_string(), |
| 1811 | ); |
| 1812 | // Unknown agent → the run fails BEFORE coercion. The failure is the |
| 1813 | // run error, not a coercion failure — coercion must not run. |
| 1814 | let spec = AgentStepSpec::new("step-y", "no-such-agent", "d", "p") |
| 1815 | .with_output_schema(verdict_schema()); |
| 1816 | |
| 1817 | let outcome = executor.execute_step(spec, None).await; |
| 1818 | |
| 1819 | assert!(!outcome.success); |
| 1820 | assert_eq!(outcome.structured, None); |
| 1821 | assert!( |
| 1822 | !outcome.output.contains("[structured output failed"), |
| 1823 | "coercion never ran — failure is the run error, not a coercion failure: {}", |
| 1824 | outcome.output |
| 1825 | ); |
| 1826 | } |
| 1827 | |
| 1828 | struct StaticLlmClient { |
| 1829 | text: String, |
nothing calls this directly
no test coverage detected