Skip to content

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

fix(ops_types): correct type mismatch in skill operation handling

Steven Enamakeld5d169887fba
diff --git a/crates/openhuman-core/src/skills/ops_types.rs b/crates/openhuman-core/src/skills/ops_types.rs
index 4cac0b4851..835dfc042a 100644
--- a/crates/openhuman-core/src/skills/ops_types.rs
+++ b/crates/openhuman-core/src/skills/ops_types.rs
@@ -2,27 +2,12 @@
pub use tinyskills::{
Skill as Workflow, SkillFrontmatter as WorkflowFrontmatter, SkillScope as WorkflowScope,
+ MAX_DESCRIPTION_LEN, MAX_NAME_LEN, MAX_RESOURCE_BYTES as MAX_WORKFLOW_RESOURCE_BYTES,
+ RESOURCE_DIRS, SKILL_JSON, SKILL_MD, WORKFLOW_MD,
};
-pub const MAX_DESCRIPTION_LEN: usize = 1024;
-pub const MAX_NAME_LEN: usize = 64;
-pub const RESOURCE_DIRS: &[&str] = &[
- "scripts",
- "references",
- "assets",
- "templates",
- "examples",
- "prompts",
-];
-pub const SKILL_JSON: &str = "skill.json";
-pub const SKILL_MD: &str = "SKILL.md";
+// Host-owned sidecar names and the trust marker are OpenHuman policy.
pub const SKILL_TOML: &str = "skill.toml";
-pub const WORKFLOW_MD: &str = "WORKFLOW.md";
pub const WORKFLOW_TOML: &str = "workflow.toml";
pub(crate) const TRUST_MARKER: &str = "trust";
-pub const MAX_WORKFLOW_RESOURCE_BYTES: u64 = 128 * 1024;
-
-#[cfg(test)]
-#[path = "ops_types_tests.rs"]
-mod ops_types_tests;
diff --git a/crates/openhuman-core/src/skills/ops_types_tests.rs b/crates/openhuman-core/src/skills/ops_types_tests.rs
deleted file mode 100644
index bf9c765b4e..0000000000
--- a/crates/openhuman-core/src/skills/ops_types_tests.rs
+++ /dev/null
@@ -1,49 +0,0 @@
-use super::*;
-
-#[test]
-fn allowed_tools_accepts_yaml_sequence() {
- let fm: WorkflowFrontmatter =
- serde_yaml::from_str("allowed-tools:\n - Bash\n - Read\n").unwrap();
- assert_eq!(fm.allowed_tools, vec!["Bash", "Read"]);
-}
-
-#[test]
-fn allowed_tools_accepts_comma_string() {
- // Claude Code convention: a scalar comma-joined string. Before the
- // string-or-seq deserializer this failed with "invalid type: string,
- // expected a sequence" and the skill's tools were silently dropped.
- let fm: WorkflowFrontmatter =
- serde_yaml::from_str("allowed-tools: Bash, Read, Grep, Skill, WebFetch").unwrap();
- assert_eq!(
- fm.allowed_tools,
- vec!["Bash", "Read", "Grep", "Skill", "WebFetch"]
- );
-}
-
-#[test]
-fn allowed_tools_trims_whitespace_and_drops_empty_tokens() {
- // Hand-authored frontmatter is ragged: padding around each name and a
- // stray comma that yields an empty token. Both are dropped rather than
- // surfacing as a bogus tool name.
- let fm: WorkflowFrontmatter =
- serde_yaml::from_str(r#"allowed-tools: " Bash, , Read, ""#).unwrap();
- assert_eq!(fm.allowed_tools, vec!["Bash", "Read"]);
-}
-
-#[test]
-fn allowed_tools_accepts_tools_alias() {
- let fm: WorkflowFrontmatter = serde_yaml::from_str("tools: Bash, Read").unwrap();
- assert_eq!(fm.allowed_tools, vec!["Bash", "Read"]);
-}
-
-#[test]
-fn allowed_tools_accepts_snake_case_alias() {
- let fm: WorkflowFrontmatter = serde_yaml::from_str("allowed_tools: Bash, Read").unwrap();
- assert_eq!(fm.allowed_tools, vec!["Bash", "Read"]);
-}
-
-#[test]
-fn allowed_tools_defaults_empty_when_absent() {
- let fm: WorkflowFrontmatter = serde_yaml::from_str("name: foo").unwrap();
- assert!(fm.allowed_tools.is_empty());
-}