Skip to content

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

chore(context): make every reduction step audible\n\nTier 1.5 of the context work: before deciding whether the ladder needs a\ndurable per-turn ledger, make it possible to see which steps actually fire on\nreal turns. Three of the four already spoke — compression logs its provenance,\nthe trim warns with drop/token counts on every eviction, and the per-result\nartifact store logs each persist and each persist failure. Two did not.\n\n**Microcompact was silent by design.** `emit_events` defaults to false because\nthe middleware was built as "a silent transcript rewrite", so the one step that\ndestroys content outright was also the only one that never said it had run.\nThat is precisely how it went unnoticed that it was blanking on every model\ncall rather than under context pressure. It now emits `AgentEvent::Compressed`\nwhen it clears a body.\n\n**A missing artifact store truncated silently.** `apply_per_result_persistence`\nwarns when a persist FAILS, but a run with no store configured falls straight\nthrough to inline truncation with nothing recorded — the oversized tail is\ndiscarded and no line says so. Now logged, and worded so it is clear the tail\nis gone rather than stored somewhere.\n\nNeither changes behaviour; both exist so the Tier 2 decision (a per-turn ledger\nwith a table of contents in context) is made from what production turns do\nrather than from reasoning about the code.\n

sanil-23831744efe774
diff --git a/src/openhuman/agent/harness/tool_result_artifacts/mod.rs b/src/openhuman/agent/harness/tool_result_artifacts/mod.rs
index c77c040015..afba1d1265 100644
--- a/src/openhuman/agent/harness/tool_result_artifacts/mod.rs
+++ b/src/openhuman/agent/harness/tool_result_artifacts/mod.rs
@@ -322,6 +322,20 @@ pub(crate) async fn apply_per_result_persistence(
}
}
+ // Reached two ways, and only one of them was audible: a persist that FAILED
+ // warns just above, but a run with no artifact store configured falls
+ // through to here silently — the oversized tail is discarded with nothing
+ // recording that it happened. Say so, so "where did the rest of my search
+ // result go" is answerable from the logs rather than by reading this
+ // function.
+ if store.is_none() {
+ log::info!(
+ "[agent][tool-result-artifacts] no artifact store configured; truncating oversized tool result inline tool={} original_bytes={} budget_bytes={} — the tail is discarded, not recoverable",
+ tool_name,
+ original_bytes,
+ budget_bytes
+ );
+ }
let (output, BudgetOutcome { final_bytes, .. }) =
apply_tool_result_budget(content, budget_bytes);
(
diff --git a/src/openhuman/agent/tinyagents/mod_part_04.rs b/src/openhuman/agent/tinyagents/mod_part_04.rs
index df273dcb56..37ff75bf54 100644
--- a/src/openhuman/agent/tinyagents/mod_part_04.rs
+++ b/src/openhuman/agent/tinyagents/mod_part_04.rs
@@ -592,7 +592,14 @@ fn assemble_turn_harness(
}
None => microcompact,
};
- harness.push_middleware(Arc::new(microcompact));
+ // Emit `AgentEvent::Compressed` when a body is cleared. Off by default —
+ // the middleware was built as "a silent transcript rewrite" — which is
+ // why blanking was, until now, the one reduction step nobody could see
+ // happening: compression logs its provenance, the trim warns on every
+ // eviction, and the per-result artifact store logs each persist. Only
+ // this one destroyed content without saying so, which is how it went
+ // unnoticed that it was doing it on every call.
+ harness.push_middleware(Arc::new(microcompact.with_events(true)));
}
// Issue #6014: make the last permitted model call the turn's conclusion,