codetether-agent 4.7.0-a-002.4

A2A-native AI coding agent for the CodeTether ecosystem
Documentation
use serde_json::json;

use crate::tool::Tool;
use crate::tool::tetherscript::TetherScriptPluginTool;

#[tokio::test]
async fn tetherscript_err_result_becomes_failed_tool_result() {
    let tool = TetherScriptPluginTool::new();
    let result = tool
        .execute(json!({
            "source": r#"fn validate() { return Err("feature rejected") }"#,
            "hook": "validate"
        }))
        .await
        .unwrap();

    assert!(!result.success);
    assert!(result.output.contains("Err(\"feature rejected\")"));
    assert_eq!(
        result.metadata.get("value"),
        Some(&json!({"err": "feature rejected"}))
    );
}