Skip to content

AI media harness for planning, generating, and editing locally

TypeScript

Fix validator retry count

Bittid4892b3bc33f
diff --git a/src-tauri/src/agent.rs b/src-tauri/src/agent.rs
index cbaa646..39bf3f5 100644
--- a/src-tauri/src/agent.rs
+++ b/src-tauri/src/agent.rs
@@ -442,6 +442,7 @@ pub enum AgentEvent {
Diagnostic { text: String },
Validation {
round: usize,
+ #[serde(rename = "maxRounds")]
max_rounds: usize,
text: String,
},
@@ -1567,6 +1568,19 @@ mod tests {
assert!(AGENT_SYSTEM_PROMPT.contains("durationSeconds must be between 0 and 15"));
}
+ #[test]
+ fn validation_events_use_the_frontend_field_name() {
+ let event = serde_json::to_value(AgentEvent::Validation {
+ round: 1,
+ max_rounds: 3,
+ text: "Fix the reference type.".into(),
+ })
+ .unwrap();
+
+ assert_eq!(event["maxRounds"], 3);
+ assert!(event.get("max_rounds").is_none());
+ }
+
#[test]
fn scene_planning_prompt_requires_reference_first_shots_and_structured_speech() {
let system_prompt = full_agent_system_prompt();