Skip to content

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

fix(scripts): handle empty agentId in life-scenarios runner

Steven Enamakel63d76d133ec4
diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware/tool_output.rs b/crates/openhuman-core/src/agent/tinyagents/middleware/tool_output.rs
index c1b03d86b4..15007ff34a 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware/tool_output.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware/tool_output.rs
@@ -419,7 +419,11 @@ impl Middleware<(), crate::agent::tinyagents::host::OpenHumanRunContext> for Too
capping and spilling to an artifact instead"
);
}
- if !raw_fetch && !compaction_exempt && wants_tinyjuice && (tool_cap.is_none() || focus.is_some()) {
+ if !raw_fetch
+ && !compaction_exempt
+ && wants_tinyjuice
+ && (tool_cap.is_none() || focus.is_some())
+ {
// Bind a summary call to this turn only when the result is big
// enough for TinyJuice to want one; building the child context for
// every small result would be waste.
diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware/tool_output_tests.rs b/crates/openhuman-core/src/agent/tinyagents/middleware/tool_output_tests.rs
index ee2aa5079a..d7e1b5551b 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware/tool_output_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware/tool_output_tests.rs
@@ -65,7 +65,10 @@ async fn same_tool_calls_persist_artifacts_under_distinct_call_ids() {
fn only_a_raw_web_fetch_is_exempt_from_the_payload_summarizer() {
use serde_json::json;
- assert!(is_raw_fetch("web_fetch", &json!({"url": "https://x", "raw": true})));
+ assert!(is_raw_fetch(
+ "web_fetch",
+ &json!({"url": "https://x", "raw": true})
+ ));
// A converted fetch is the normal path and stays summarizer-eligible: its
// Markdown is prose the summarizer compresses well.
diff --git a/scripts/life-scenarios/run.mjs b/scripts/life-scenarios/run.mjs
index f0459ce22d..e76bb10c53 100644
--- a/scripts/life-scenarios/run.mjs
+++ b/scripts/life-scenarios/run.mjs
@@ -1088,6 +1088,7 @@ async function main() {
// pre-written value is read by nothing, and the turn silently runs the
// orchestrator at its own 15-iteration cap — which looks like the benchmark
// agent failing when it never ran at all.
+ const chatAgentId = opts.agentId.trim() || null;
await withRetries(
async () => {
await core.rpc("openhuman.config_update_agent_settings", {
@@ -1096,9 +1097,9 @@ async function main() {
const snap = await core.rpc("openhuman.config_get", {});
const cfg = snap?.config ?? snap?.snapshot?.config ?? snap?.snapshot ?? snap ?? {};
const got = cfg.agent?.chat_agent_id ?? null;
- if (got !== opts.agentId)
+ if (got !== chatAgentId)
throw new Error(
- `chat_agent_id not in the active config yet (want ${opts.agentId}, got ${got ?? "unset"})`,
+ `chat_agent_id not in the active config yet (want ${chatAgentId ?? "unset"}, got ${got ?? "unset"})`,
);
},
{ attempts: 10, delayMs: 500, what: "chat_agent_id" },