Skip to content

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

fix(agent): handle empty dump directory gracefully

Steven Enamakel4653c5e3c0b0
diff --git a/crates/openhuman-core/src/agent/debug/dump_writer.rs b/crates/openhuman-core/src/agent/debug/dump_writer.rs
index 950011b67f..12bfd9c8c5 100644
--- a/crates/openhuman-core/src/agent/debug/dump_writer.rs
+++ b/crates/openhuman-core/src/agent/debug/dump_writer.rs
@@ -69,7 +69,7 @@ pub fn write_prompt_dumps(dir: &Path, dumps: &[DumpedPrompt]) -> Result<DumpWrit
std::fs::write(&wire_path, super::wire::render(dumped))
.with_context(|| format!("writing {}", wire_path.display()))?;
- let label = label_for(dumped);
+ let label = &dumped.agent_id;
let _ = writeln!(
summary,
"{:<32} tools={:<4} skill={:<4}",
diff --git a/crates/openhuman-core/src/agent/debug/dump_writer_tests.rs b/crates/openhuman-core/src/agent/debug/dump_writer_tests.rs
index 5f26bdac73..9b50b6cda9 100644
--- a/crates/openhuman-core/src/agent/debug/dump_writer_tests.rs
+++ b/crates/openhuman-core/src/agent/debug/dump_writer_tests.rs
@@ -1,10 +1,9 @@
use super::*;
use std::path::PathBuf;
-fn sample_dump(agent: &str, toolkit: Option<&str>, tool_names: &[&str]) -> DumpedPrompt {
+fn sample_dump(agent: &str, tool_names: &[&str]) -> DumpedPrompt {
DumpedPrompt {
agent_id: agent.to_string(),
- toolkit: toolkit.map(|s| s.to_string()),
mode: "session",
model: "claude-opus-4-7".to_string(),
workspace_dir: PathBuf::from("/tmp/ws"),
@@ -19,8 +18,8 @@ fn sample_dump(agent: &str, toolkit: Option<&str>, tool_names: &[&str]) -> Dumpe
fn golden_layout_matches_cli_format() {
let dir = tempfile::tempdir().unwrap();
let dumps = vec![
- sample_dump("orchestrator", None, &["a", "b", "c"]),
- sample_dump("integrations_agent", Some("gmail"), &["send", "search"]),
+ sample_dump("orchestrator", &["a", "b", "c"]),
+ sample_dump("researcher", &["send", "search"]),
];
let out = write_prompt_dumps(dir.path(), &dumps).unwrap();
@@ -30,7 +29,7 @@ fn golden_layout_matches_cli_format() {
assert_eq!(out.prompt_paths[0], dir.path().join("1_orchestrator.md"));
assert_eq!(
out.prompt_paths[1],
- dir.path().join("2_integrations_agent_gmail.md")
+ dir.path().join("2_researcher.md")
);
assert_eq!(out.summary_path, dir.path().join("SUMMARY.txt"));
@@ -38,7 +37,7 @@ fn golden_layout_matches_cli_format() {
let body = std::fs::read_to_string(&out.prompt_paths[0]).unwrap();
assert_eq!(body, "# prompt for orchestrator\nbody\n");
- // Meta sidecar: exact byte format, toolkit-less variant.
+ // Meta sidecar: exact byte format.
let meta0 = std::fs::read_to_string(dir.path().join("1_orchestrator.meta.txt")).unwrap();
let expected_meta0 = "\
agent: orchestrator
@@ -50,12 +49,9 @@ skill_tools: 1
";
assert_eq!(meta0, expected_meta0);
- // Meta sidecar: toolkit variant inserts `toolkit:` after `agent:`.
- let meta1 =
- std::fs::read_to_string(dir.path().join("2_integrations_agent_gmail.meta.txt")).unwrap();
+ let meta1 = std::fs::read_to_string(dir.path().join("2_researcher.meta.txt")).unwrap();
let expected_meta1 = "\
-agent: integrations_agent
-toolkit: gmail
+agent: researcher
mode: session
model: claude-opus-4-7
workspace: /tmp/ws
@@ -72,7 +68,7 @@ skill_tools: 1
// break.
let expected_summary = "\
orchestrator tools=3 skill=1 \n\
-integrations_agent@gmail tools=2 skill=1 \n";
+researcher tools=2 skill=1 \n";
assert_eq!(summary, expected_summary);
}
diff --git a/crates/openhuman-core/src/agent/debug/prompt_size_tests.rs b/crates/openhuman-core/src/agent/debug/prompt_size_tests.rs
index 985bd19241..8cc7de5753 100644
--- a/crates/openhuman-core/src/agent/debug/prompt_size_tests.rs
+++ b/crates/openhuman-core/src/agent/debug/prompt_size_tests.rs
@@ -46,7 +46,6 @@ fn a_bare_hash_is_not_a_heading() {
fn tools_are_ranked_by_cost_not_registration_order() {
let dumped = DumpedPrompt {
agent_id: "t".into(),
- toolkit: None,
mode: "session",
model: "m".into(),
workspace_dir: std::path::PathBuf::from("/tmp"),
diff --git a/crates/openhuman-core/src/agent/debug/wire_tests.rs b/crates/openhuman-core/src/agent/debug/wire_tests.rs
index 3bd7e1264a..a9f869709f 100644
--- a/crates/openhuman-core/src/agent/debug/wire_tests.rs
+++ b/crates/openhuman-core/src/agent/debug/wire_tests.rs
@@ -10,7 +10,6 @@ use std::path::PathBuf;
fn dump(text: &str, specs: Vec<serde_json::Value>) -> DumpedPrompt {
DumpedPrompt {
agent_id: "test_agent".to_string(),
- toolkit: None,
mode: "session",
model: "test-model".to_string(),
workspace_dir: PathBuf::from("/tmp/ws"),