Skip to content

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

test(tools): remove obsolete config_hint truncation tests

Steven Enamakel10935a21554e
diff --git a/crates/openhuman-core/src/flows/tools_tests.rs b/crates/openhuman-core/src/flows/tools_tests.rs
index 74d4323222..0979d1f73d 100644
--- a/crates/openhuman-core/src/flows/tools_tests.rs
+++ b/crates/openhuman-core/src/flows/tools_tests.rs
@@ -178,101 +178,6 @@ async fn summary_step_count_and_kinds_are_correct() {
assert_eq!(steps[1]["config_hint"], "slack.post_message");
}
-#[test]
-fn dedup_config_hint_is_truncated_for_a_long_key_expression() {
- // CodeRabbit (PR #5265): unlike the other config_hint branches, the
- // dedup branch returned `format!("key: {k}")` unwrapped by
- // `truncate_hint`, so an oversized `config.key` expression could make
- // the proposal/summary payload unbounded.
- let long_key = format!("=item.{}", "x".repeat(200));
- let graph = WorkflowGraph {
- nodes: vec![Node {
- id: "dd".to_string(),
- kind: NodeKind::Dedup,
- type_version: 1,
- name: "Dedup".to_string(),
- config: json!({ "key": long_key }),
- ports: Vec::new(),
- position: None,
- }],
- ..Default::default()
- };
-
- let summary = build_summary(&graph);
- let hint = summary["steps"][0]["config_hint"].as_str().unwrap();
- assert!(
- hint.chars().count() <= MAX_CONFIG_HINT_CHARS,
- "hint not truncated: {} chars: {hint}",
- hint.chars().count()
- );
- assert!(hint.ends_with('…'), "expected an ellipsis marker: {hint}");
- assert!(
- hint.starts_with("key: "),
- "expected the key: prefix: {hint}"
- );
-}
-
-#[test]
-fn approval_config_hint_prefers_the_review_title() {
- let graph = WorkflowGraph {
- nodes: vec![Node {
- id: "review".to_string(),
- kind: NodeKind::Approval,
- type_version: 1,
- name: "Review".to_string(),
- config: json!({
- "title": "Publish this draft?",
- "prompt": "Approve publication"
- }),
- ports: Vec::new(),
- position: None,
- }],
- ..Default::default()
- };
-
- let summary = build_summary(&graph);
- assert_eq!(summary["steps"][0]["config_hint"], "Publish this draft?");
-}
-
-#[test]
-fn shell_config_hint_prefers_the_script_path_and_truncates_inline_source() {
- let graph = WorkflowGraph {
- nodes: vec![
- Node {
- id: "path".to_string(),
- kind: NodeKind::Shell,
- type_version: 1,
- name: "Script file".to_string(),
- config: json!({
- "script_path": "scripts/report.sh",
- "source": "ignored when a path is present"
- }),
- ports: Vec::new(),
- position: None,
- },
- Node {
- id: "inline".to_string(),
- kind: NodeKind::Shell,
- type_version: 1,
- name: "Inline script".to_string(),
- config: json!({ "source": "x".repeat(200) }),
- ports: Vec::new(),
- position: None,
- },
- ],
- ..Default::default()
- };
-
- let summary = build_summary(&graph);
- assert_eq!(
- summary["steps"][0]["config_hint"],
- "script: scripts/report.sh"
- );
- let inline_hint = summary["steps"][1]["config_hint"].as_str().unwrap();
- assert_eq!(inline_hint.chars().count(), MAX_CONFIG_HINT_CHARS);
- assert!(inline_hint.ends_with('…'));
-}
-
#[tokio::test]
async fn summary_trigger_describes_schedule() {
let tmp = TempDir::new().unwrap();