Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

test(core): align plan skill and web fixtures with current contracts

Steven Enamakelf8db93e66d3d
diff --git a/crates/openhuman-core/src/agent/plan_review/tool_tests.rs b/crates/openhuman-core/src/agent/plan_review/tool_tests.rs
index 376e6e0513..0083f0951a 100644
--- a/crates/openhuman-core/src/agent/plan_review/tool_tests.rs
+++ b/crates/openhuman-core/src/agent/plan_review/tool_tests.rs
@@ -1,5 +1,6 @@
use super::*;
use crate::agent::turn_origin::with_origin;
+use crate::security::approval::{ApprovalChatContext, APPROVAL_CHAT_CONTEXT};
#[tokio::test]
async fn non_interactive_origin_auto_approves() {
@@ -30,7 +31,14 @@ async fn interactive_turn_parks_until_resolved() {
client_id: "c-int".into(),
request_id: Some("req-int".into()),
},
- tool.execute(json!({ "summary": "plan", "steps": ["one"] })),
+ APPROVAL_CHAT_CONTEXT.scope(
+ ApprovalChatContext {
+ thread_id: "t-int".into(),
+ client_id: "c-int".into(),
+ request_id: Some("req-int".into()),
+ },
+ tool.execute(json!({ "summary": "plan", "steps": ["one"] })),
+ ),
);
// An interactive turn must BLOCK on the gate rather than return
// immediately — a short timeout elapses with no result (the parked
diff --git a/crates/openhuman-core/src/skills/bundled/mod_tests.rs b/crates/openhuman-core/src/skills/bundled/mod_tests.rs
index 40eac444fc..71e06ce2a1 100644
--- a/crates/openhuman-core/src/skills/bundled/mod_tests.rs
+++ b/crates/openhuman-core/src/skills/bundled/mod_tests.rs
@@ -18,21 +18,19 @@ const SAMPLE: BundledSkill = BundledSkill {
fn validate_relative_path(dir_name: &str, path: &str) -> Result<(), String> {
let path: &'static str = Box::leak(path.to_owned().into_boxed_str());
+ let mut files = vec![BundledFile {
+ path: "WORKFLOW.md",
+ contents: "---\nname: test\ndescription: test\n---\n",
+ }];
+ if path != "WORKFLOW.md" {
+ files.push(BundledFile {
+ path,
+ contents: "body",
+ });
+ }
let skill = BundledSkill {
dir_name: Box::leak(dir_name.to_owned().into_boxed_str()),
- files: Box::leak(
- vec![
- BundledFile {
- path: "WORKFLOW.md",
- contents: "---\nname: test\ndescription: test\n---\n",
- },
- BundledFile {
- path,
- contents: "body",
- },
- ]
- .into_boxed_slice(),
- ),
+ files: Box::leak(files.into_boxed_slice()),
};
skill.validate()
}
diff --git a/crates/openhuman-core/src/skills/search_tests.rs b/crates/openhuman-core/src/skills/search_tests.rs
index 58cddae93a..eba72e9303 100644
--- a/crates/openhuman-core/src/skills/search_tests.rs
+++ b/crates/openhuman-core/src/skills/search_tests.rs
@@ -171,7 +171,7 @@ async fn the_bundled_skill_is_findable_once_installed() {
};
let tool = SkillSearchTool::new(Arc::new(config));
let result = tool
- .execute(json!({ "query": "tinyflows expression syntax and node configuration" }))
+ .execute(json!({ "query": "flow authoring" }))
.await
.expect("dispatch");
let text = format!("{result:?}");
diff --git a/crates/openhuman-core/src/web_chat/web_tests_error_code_classification_tests.rs b/crates/openhuman-core/src/web_chat/web_tests_error_code_classification_tests.rs
index 53389a7848..b088290615 100644
--- a/crates/openhuman-core/src/web_chat/web_tests_error_code_classification_tests.rs
+++ b/crates/openhuman-core/src/web_chat/web_tests_error_code_classification_tests.rs
@@ -446,12 +446,13 @@ fn web_channel_catalog_has_chat_and_cancel() {
let s = all_web_channel_controller_schemas();
let c = all_web_channel_registered_controllers();
assert_eq!(s.len(), c.len());
- assert_eq!(s.len(), 4);
+ assert_eq!(s.len(), 5);
let fns: Vec<&str> = s.iter().map(|x| x.function).collect();
assert!(fns.contains(&"web_chat"));
assert!(fns.contains(&"web_cancel"));
assert!(fns.contains(&"web_queue_status"));
assert!(fns.contains(&"web_queue_clear"));
+ assert!(fns.contains(&"web_queue_remove"));
}
#[test]