MCPcopy Create free account
hub / github.com/AI45Lab/Code / failed_step_with_schema_skips_coercion

Function failed_step_with_schema_skips_coercion

core/src/tools/task.rs:1805–1826  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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,

Callers

nothing calls this directly

Calls 4

verdict_schemaFunction · 0.85
pathMethod · 0.80
with_output_schemaMethod · 0.80
execute_stepMethod · 0.45

Tested by

no test coverage detected