Skip to content

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

Merge upstream/main into bench-6951-truncated-reasoning

Steven Enamakel30212b5361d4
diff --cc crates/openhuman-core/src/agent/tinyagents/turn_outcome.rs
index 8a015ca2ca,a80e41b64d..2cb01195df
--- a/crates/openhuman-core/src/agent/tinyagents/turn_outcome.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/turn_outcome.rs
@@@ -78,21 -71,12 +78,25 @@@ pub(crate) struct TinyagentsTurnOutcom
/// only place the caller can recover whether each call actually failed — used
/// to build honest `ToolCallRecord`s for post-turn hooks + the cap checkpoint.
pub tool_outcomes: Vec<ToolCallOutcome>,
+ /// The run's context compaction, when it compacted: re-applied by the
+ /// session driver to the history it persists, so the next turn starts
+ /// from the checkpoint. `None` when the run did not compact.
+ pub compaction: Option<super::CompactionCarry>,
}
+/// Whether a run's final response is a reply that ran out of output tokens
+/// before producing anything: `finish_reason = length`, no visible text and no
+/// tool call. See [`TinyagentsTurnOutcome::truncated`].
+pub(crate) fn ended_out_of_output_budget(
+ final_response: Option<&tinyinference_llm::model::ModelResponse>,
+) -> bool {
+ final_response.is_some_and(|response| {
+ response.finish_reason.as_deref() == Some("length")
+ && response.message.tool_calls.is_empty()
+ && response.text().trim().is_empty()
+ })
+}
+
/// One tool call's execution outcome, captured at the tool boundary before the
/// harness discards the failure flag. `success` mirrors the absence of a
/// `TaToolResult::error`; `content` is the (possibly summarized/capped) result
diff --cc crates/openhuman-core/src/agent/tinyagents/turn_run_finalize.rs
index a5d585e6ff,32cbbf0239..fe49052228
--- a/crates/openhuman-core/src/agent/tinyagents/turn_run_finalize.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/turn_run_finalize.rs
@@@ -298,7 -301,7 +313,8 @@@ pub(super) async fn finalize_turn_outco
hit_cap,
wrap_up_injected,
breaker_halt,
+ truncated,
tool_outcomes,
+ compaction,
}
}
diff --cc crates/openhuman-core/src/agent/tinyagents/turn_runner.rs
index 058dbca6ac,50eb9c947e..20303a0fa4
--- a/crates/openhuman-core/src/agent/tinyagents/turn_runner.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/turn_runner.rs
@@@ -287,8 -291,8 +291,9 @@@ async fn run_turn_via_tinyagents_inner
crate::agent::tinyagents::reasoning::turn_reasoning_for(
&run_context,
hosted_root.as_ref().map(|(base, _)| base.config.as_ref()),
+ max_output_tokens,
),
+ has_thread,
);
// Fail-closed registry validation gate (issue #4249, Workstream 10 — registry).