Skip to content

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

fix(agent): handle missing debug dump directory

Steven Enamakel3cd9a1a4a300
diff --git a/crates/openhuman-core/src/agent/debug/dump_writer.rs b/crates/openhuman-core/src/agent/debug/dump_writer.rs
index 31c151ff4d..950011b67f 100644
--- a/crates/openhuman-core/src/agent/debug/dump_writer.rs
+++ b/crates/openhuman-core/src/agent/debug/dump_writer.rs
@@ -2,9 +2,9 @@
//!
//! Owns the byte-stable file layout the CLI previously inlined:
//!
-//! * `{idx}_{agent}[_{toolkit}].md` — raw system prompt bytes
-//! * `{idx}_{agent}[_{toolkit}].meta.txt` — key/value metadata sidecar
-//! * `SUMMARY.txt` — one fixed-width row per dump
+//! * `{idx}_{agent}.md` — raw system prompt bytes
+//! * `{idx}_{agent}.meta.txt` — key/value metadata sidecar
+//! * `SUMMARY.txt` — one fixed-width row per dump
//!
//! Format is exercised by the golden test in this file; any field
//! reorder or width change is a breaking artefact change and must land
@@ -95,30 +95,12 @@ pub fn write_prompt_dumps(dir: &Path, dumps: &[DumpedPrompt]) -> Result<DumpWrit
fn stem_for(idx: usize, dumped: &DumpedPrompt) -> String {
let safe_agent = sanitise_filename_component(&dumped.agent_id);
- match &dumped.toolkit {
- Some(tk) => format!(
- "{}_{}_{}",
- idx + 1,
- safe_agent,
- sanitise_filename_component(tk)
- ),
- None => format!("{}_{}", idx + 1, safe_agent),
- }
-}
-
-fn label_for(dumped: &DumpedPrompt) -> String {
- match &dumped.toolkit {
- Some(tk) => format!("{}@{}", dumped.agent_id, tk),
- None => dumped.agent_id.clone(),
- }
+ format!("{}_{}", idx + 1, safe_agent)
}
fn render_meta(dumped: &DumpedPrompt) -> String {
let mut meta = String::new();
let _ = writeln!(meta, "agent: {}", dumped.agent_id);
- if let Some(tk) = &dumped.toolkit {
- let _ = writeln!(meta, "toolkit: {tk}");
- }
let _ = writeln!(meta, "mode: {}", dumped.mode);
let _ = writeln!(meta, "model: {}", dumped.model);
let _ = writeln!(meta, "workspace: {}", dumped.workspace_dir.display());
diff --git a/crates/openhuman-core/src/agent/debug/prompt_size.rs b/crates/openhuman-core/src/agent/debug/prompt_size.rs
index d7bc5449fe..141f9c1c86 100644
--- a/crates/openhuman-core/src/agent/debug/prompt_size.rs
+++ b/crates/openhuman-core/src/agent/debug/prompt_size.rs
@@ -70,7 +70,6 @@ pub struct ToolSize {
#[derive(Debug, Clone, serde::Serialize)]
pub struct PromptSizeReport {
pub agent: String,
- pub toolkit: Option<String>,
pub model: String,
/// Rendered system-prompt bytes.
pub prompt_bytes: usize,
@@ -78,10 +77,8 @@ pub struct PromptSizeReport {
pub tool_bytes: usize,
/// `prompt_bytes + tool_bytes` — the fixed cost of every turn.
pub fixed_prefix_bytes: usize,
- /// Number of entries in [`DumpedPrompt::tool_specs`]. For a session agent
- /// that is the provider-facing visible set (belt, policy and toolpack
- /// withholding applied); for an `integrations_agent` toolkit dump it is
- /// that toolkit's rendered tools.
+ /// Number of entries in [`DumpedPrompt::tool_specs`]: the provider-facing
+ /// visible set (belt, policy and toolpack withholding applied).
pub tool_count: usize,
pub sections: Vec<SectionSize>,
pub tools: Vec<ToolSize>,
@@ -129,7 +126,6 @@ impl PromptSizeReport {
let tool_bytes = tools.iter().map(|t| t.bytes).sum();
Self {
agent: dumped.agent_id.clone(),
- toolkit: dumped.toolkit.clone(),
model: dumped.model.clone(),
prompt_bytes,
tool_bytes,
@@ -211,11 +207,7 @@ pub fn render_text(report: &PromptSizeReport, section_limit: usize, tool_limit:
let mut out = String::new();
let est = |b: usize| b / EST_BYTES_PER_TOKEN;
- let label = match &report.toolkit {
- Some(t) => format!("{}@{}", report.agent, t),
- None => report.agent.clone(),
- };
- let _ = writeln!(out, "agent: {label}");
+ let _ = writeln!(out, "agent: {}", report.agent);
let _ = writeln!(out, "model: {}", report.model);
let _ = writeln!(out);
let _ = writeln!(
diff --git a/crates/openhuman-core/src/agent/debug/wire.rs b/crates/openhuman-core/src/agent/debug/wire.rs
index 8d5ca20e0a..6bf0034cb4 100644
--- a/crates/openhuman-core/src/agent/debug/wire.rs
+++ b/crates/openhuman-core/src/agent/debug/wire.rs
@@ -85,9 +85,6 @@ pub fn render(dumped: &DumpedPrompt) -> String {
out.push_str(" WHAT THE MODEL RECEIVES, BEFORE THE USER SAYS ANYTHING\n");
out.push_str("════════════════════════════════════════════════════════════════════\n");
let _ = writeln!(out, " agent {}", dumped.agent_id);
- if let Some(toolkit) = &dumped.toolkit {
- let _ = writeln!(out, " toolkit {toolkit}");
- }
let _ = writeln!(out, " model {}", dumped.model);
let _ = writeln!(out, " workspace {}", dumped.workspace_dir.display());
out.push('\n');