From b90e04f227e0257074095b836752f61c783515f4 Mon Sep 17 00:00:00 2001 From: Alex Clarke Date: Mon, 14 Sep 2026 00:39:20 -0600 Subject: [PATCH] fix(TASK-028): pin example-doc wording; make not-found escalation hint match queue semantics --- src/function/agents.rs | 6 +++++- src/function/user_interaction.rs | 19 +++++++++++++++++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/function/agents.rs b/src/function/agents.rs index 5637a86..3baafaa 100644 --- a/src/function/agents.rs +++ b/src/function/agents.rs @@ -1711,7 +1711,7 @@ fn handle_reply_escalation(ctx: &mut RequestContext, args: &Value) -> Result Ok(json!({ "status": "error", - "message": format!("No pending escalation found with id '{escalation_id}'. It may have already been replied to, or the child is no longer waiting (aborted, or its configured `escalation_timeout` expired)."), + "message": format!("No pending escalation found with id '{escalation_id}'. It may have already been replied to."), })), } } @@ -3093,6 +3093,10 @@ mod tests { ) .unwrap(); assert_eq!(result["status"], "error"); + assert_eq!( + result["message"], + "No pending escalation found with id 'missing'. It may have already been replied to." + ); } #[test] diff --git a/src/function/user_interaction.rs b/src/function/user_interaction.rs index f9a2923..d698fa7 100644 --- a/src/function/user_interaction.rs +++ b/src/function/user_interaction.rs @@ -432,10 +432,25 @@ mod tests { concat!("default:", " 5 minutes"), ]; let root = std::path::Path::new(env!("CARGO_MANIFEST_DIR")); - let mut files = vec![root.join("config.agent.example.yaml")]; + let example = root.join("config.agent.example.yaml"); + let example_text = std::fs::read_to_string(&example).unwrap(); + for needle in ["escalation_timeout: 0", "0 = wait indefinitely"] { + assert!( + example_text.contains(needle), + "{} lost the shipped wording {needle:?}", + example.display() + ); + } + + let mut files = vec![example]; collect_files(&root.join("src"), &mut files); collect_files(&root.join("assets"), &mut files); - assert!(files.len() > 3, "walked only {} files", files.len()); + let this_file = root.join(file!()); + assert!( + files.contains(&this_file), + "walk did not reach {}", + this_file.display() + ); let mut hits = Vec::new(); for path in &files {