Skip to content

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

fix(ci): align harness checks with latest dependencies

Steven Enamakel5fdd5cf4dc52
diff --git a/Cargo.lock b/Cargo.lock
index 57039cac46..c5e3700b02 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -6971,7 +6971,7 @@ dependencies = [
[[package]]
name = "tinyjuice"
-version = "0.5.2"
+version = "0.6.0"
dependencies = [
"anyhow",
"async-trait",
@@ -6997,7 +6997,7 @@ dependencies = [
[[package]]
name = "tinyjuice-bus"
-version = "0.5.2"
+version = "0.6.0"
dependencies = [
"serde",
"serde_json",
diff --git a/crates/openhuman-app/Cargo.lock b/crates/openhuman-app/Cargo.lock
index b53c955ad1..b34217f992 100644
--- a/crates/openhuman-app/Cargo.lock
+++ b/crates/openhuman-app/Cargo.lock
@@ -3193,6 +3193,17 @@ dependencies = [
"zeroize",
]
+[[package]]
+name = "landlock"
+version = "0.4.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4cca98e95f35b29d469dade6724c6f96cec9236640f745a0e99b0334ec320ab1"
+dependencies = [
+ "enumflags2",
+ "libc",
+ "thiserror 2.0.20",
+]
+
[[package]]
name = "lazy_static"
version = "1.5.0"
@@ -7197,6 +7208,7 @@ dependencies = [
name = "tinybox-jail"
version = "0.1.14"
dependencies = [
+ "landlock",
"log",
"serde",
"serde_json",
diff --git a/crates/openhuman-core/src/agent/agent_turn_loop_nudge_tests.rs b/crates/openhuman-core/src/agent/agent_turn_loop_nudge_tests.rs
index 8f790c17f5..4852575c1a 100644
--- a/crates/openhuman-core/src/agent/agent_turn_loop_nudge_tests.rs
+++ b/crates/openhuman-core/src/agent/agent_turn_loop_nudge_tests.rs
@@ -89,10 +89,7 @@ fn call(id: &str, name: &str) -> ChatResponse {
}
fn nudge_count(messages: &[Message]) -> usize {
- messages
- .iter()
- .filter(|m| matches!(m, Message::System(_)) && m.text() == NUDGE)
- .count()
+ messages.iter().filter(|m| m.text().contains(NUDGE)).count()
}
async fn run_turn(
@@ -148,7 +145,9 @@ async fn validation_nudge_reaches_the_retry_but_is_not_committed() {
assert_eq!(requests.len(), 2, "one failing call, then the retry");
assert!(
- matches!(requests[1].last(), Some(m @ Message::System(_)) if m.text() == NUDGE),
+ requests[1]
+ .last()
+ .is_some_and(|message| message.text().contains(NUDGE)),
"the retry request must end with the nudge, got {:?}",
requests[1].last()
);
@@ -196,7 +195,9 @@ async fn a_second_validation_failure_rearms_the_nudge() {
assert_eq!(requests.iter().map(|r| nudge_count(r)).collect::<Vec<_>>(), [0, 1, 1],
"each failure nudges exactly the request that follows it; a consumed nudge is not carried over");
assert!(
- matches!(requests[2].last(), Some(m @ Message::System(_)) if m.text() == NUDGE),
+ requests[2]
+ .last()
+ .is_some_and(|message| message.text().contains(NUDGE)),
"the re-armed nudge must end the request after the second failure"
);
assert_eq!(
diff --git a/crates/openhuman-core/src/agent/harness/definition_tests.rs b/crates/openhuman-core/src/agent/harness/definition_tests.rs
index b1b63b4621..9fabf34265 100644
--- a/crates/openhuman-core/src/agent/harness/definition_tests.rs
+++ b/crates/openhuman-core/src/agent/harness/definition_tests.rs
@@ -365,11 +365,8 @@ fn all_builtin_agent_definitions_have_expected_effective_max_iterations() {
.expect("built-in agent TOML must always parse");
let expected: &[(&str, usize)] = &[
- // Extended policy (or high `max_iterations`) -> effective cap raised.
- // Raised from 15 to 50 by 7ad30f7c5 (fix(registry): raise orchestrator
- // max iterations); the loader registration test moved with it, this
- // snapshot did not.
- ("orchestrator", 50),
+ // Explicitly raised for code work (#6958), above the extended default.
+ ("orchestrator", 200),
// #5204: general-purpose read-only flow context/memory retrieval
// agent — `iteration_policy = "extended"` so it can loop across
// several retrievals in one turn. `#[cfg(feature = "flows")]`-gated
diff --git a/crates/openhuman-core/src/agent/tinyagents/harness_assembly.rs b/crates/openhuman-core/src/agent/tinyagents/harness_assembly.rs
index 411ba4d5b7..607e543dad 100644
--- a/crates/openhuman-core/src/agent/tinyagents/harness_assembly.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/harness_assembly.rs
@@ -47,19 +47,14 @@ pub(super) struct AssembledTurnHarness {
/// Shared 1-based model-call cursor (event bridge advances, model adapter
/// reads for out-of-band thinking attribution).
pub(super) cursor: IterationCursor,
- /// Shared `call_id → tool_name` map: the model adapter's `ThinkingForwarder`
- /// writes it on tool-call start; the event bridge reads it to label the
- /// tool-argument fragments it now projects off the crate stream.
+ /// Shared `call_id → tool_name` map used by the event bridge to label
+ /// tool-argument fragments projected off the crate stream.
pub(super) tool_names: ToolNameMap,
- /// Shared `call_id → (success, failure, elapsed_ms, output_chars)`
- /// side-channel: the tool-outcome capture middleware classifies each outcome
- /// + records its duration/output size; the event bridge reads it to project
- ///
- /// Real success + a user-facing failure + timing onto `ToolCallCompleted`.
+ /// Shared `call_id → (success, failure, elapsed_ms, output_chars)` side-channel:
+ /// middleware records each outcome for the event bridge's `ToolCallCompleted`.
pub(super) failure_map: ToolFailureMap,
- /// Shared FIFO carry of per-call provider `BilledUsage` (charged USD + context
- /// window): the model adapter pushes, the event bridge pops when recording
- /// usage — restores charged-USD precedence on the tinyagents path (#4467).
+ /// Shared FIFO carry of per-call provider `BilledUsage`; the event bridge
+ /// reads it when recording usage to preserve charged-USD precedence (#4467).
pub(super) provider_usage_carry: ProviderUsageCarry,
/// Recovers the original (downcastable) provider error on run failure.
pub(super) error_slot: crate::agent::tinyagents::model::ModelErrorSlot,
@@ -91,10 +86,10 @@ pub(super) struct AssembledTurnHarness {
pub(super) registry_diagnostics: Vec<RegistryDiagnostic>,
/// TinyAgents store index for OpenHuman action-dir tool-result artifacts.
pub(super) tool_result_artifact_index: Option<Arc<ToolResultArtifactIndexStore>>,
- /// Concrete handle to the installed [`ContextCompressionMiddleware`], when the
- /// summarization step is active. Drained after the run to surface each
- /// compaction's [`CompressionProvenance`][tinyagents_harness::summarization::CompressionProvenance]
- /// (source ids + before/after token estimates) via the observability path.
+ /// Concrete handle to the installed [`ContextCompressionMiddleware`], when
+ /// summarization is active. Drained after the run to surface each compaction's
+ /// [`CompressionProvenance`][tinyagents_harness::summarization::CompressionProvenance]
+ /// via the observability path.
pub(super) compression_mw: Option<Arc<ContextCompressionMiddleware>>,
/// Crate prompt-cache guard (issue #4249, 03.2). Records a `CacheLayoutEvent`
/// whenever the cacheable prompt prefix (system prompt + tool set) changes
diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware/shell_turn_budget.rs b/crates/openhuman-core/src/agent/tinyagents/middleware/shell_turn_budget.rs
index 826a25d61e..8022e7b91e 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware/shell_turn_budget.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware/shell_turn_budget.rs
@@ -91,8 +91,7 @@ pub(crate) fn clamp_shell_timeout(
.saturating_sub(SHELL_TIMEOUT_RESERVE)
.max(remaining / 2)
.as_secs()
- .max(1)
- .min(crate::tools::timeout::MAX_TIMEOUT_SECS);
+ .clamp(1, crate::tools::timeout::MAX_TIMEOUT_SECS);
if requested.is_some_and(|secs| secs <= cap) {
return None;
}
diff --git a/tests/agent_harness_e2e.rs b/tests/agent_harness_e2e.rs
index 6954814737..9e910706f8 100644
--- a/tests/agent_harness_e2e.rs
+++ b/tests/agent_harness_e2e.rs
@@ -4660,10 +4660,14 @@ async fn todo_list_ticks_off_five_items_across_turns_inner() {
let mut script = vec![
todo_write(&FIVE_STEPS, 0),
text_completion("Plan written; starting on the first step."),
+ text_completion("Checked the plan against the request; starting the first step."),
];
for completed in 1..=FIVE_STEPS.len() {
script.push(todo_write(&FIVE_STEPS, completed));
script.push(text_completion(&format!("Step {completed} done.")));
+ script.push(text_completion(&format!(
+ "Checked step {completed} against the request; continuing."
+ )));
}
reset_script(script);
let stack = boot_stack().await;
diff --git a/tests/in_process/agent_prompt_comprehension_e2e.rs b/tests/in_process/agent_prompt_comprehension_e2e.rs
index f16486b2f3..601a22033c 100644
--- a/tests/in_process/agent_prompt_comprehension_e2e.rs
+++ b/tests/in_process/agent_prompt_comprehension_e2e.rs
@@ -45,6 +45,7 @@ static AGENT_DEF_REGISTRY_INIT: OnceLock<()> = OnceLock::new();
static SCRIPTED: OnceLock<Mutex<std::collections::VecDeque<Value>>> = OnceLock::new();
static CAPTURED: OnceLock<Mutex<Vec<Value>>> = OnceLock::new();
+static SCRIPTED_UPSTREAM: OnceLock<SocketAddr> = OnceLock::new();
fn scripted() -> std::sync::MutexGuard<'static, std::collections::VecDeque<Value>> {
lock_or_recover(SCRIPTED.get_or_init(Default::default))
@@ -312,6 +313,33 @@ async fn serve_on_ephemeral(
(addr, handle)
}
+fn scripted_upstream_addr() -> SocketAddr {
+ *SCRIPTED_UPSTREAM.get_or_init(|| {
+ ensure_rpc_auth();
+ let (addr_tx, addr_rx) = std::sync::mpsc::sync_channel(1);
+ std::thread::Builder::new()
+ .name("prompt-scripted-upstream".into())
+ .spawn(move || {
+ let runtime = tokio::runtime::Builder::new_current_thread()
+ .enable_all()
+ .build()
+ .expect("build scripted upstream runtime");
+ runtime.block_on(async move {
+ let listener = tokio::net::TcpListener::bind("127.0.0.1:0")
+ .await
+ .expect("bind scripted upstream");
+ addr_tx.send(listener.local_addr().expect("scripted upstream addr"))
+ .expect("report scripted upstream addr");
+ axum::serve(listener, scripted_upstream_router())
+ .await
+ .expect("serve scripted upstream");
+ });
+ })
+ .expect("spawn scripted upstream");
+ addr_rx.recv().expect("scripted upstream startup")
+ })
+}
+
async fn post_json_rpc(rpc_base: &str, id: i64, method: &str, params: Value) -> Value {
let client = reqwest::Client::builder()
.timeout(Duration::from_secs(180))
@@ -471,7 +499,7 @@ async fn boot_stack(extra_config: &str) -> Stack {
EnvVarGuard::unset("VITE_BACKEND_URL"),
];
- let (mock_addr, mock_join) = serve_on_ephemeral(scripted_upstream_router()).await;
+ let mock_addr = scripted_upstream_addr();
let mock_origin = format!("http://{mock_addr}");
write_min_config(&openhuman_home, &mock_origin, extra_config);
write_min_config(
@@ -497,7 +525,7 @@ async fn boot_stack(extra_config: &str) -> Stack {
rpc_base,
_guards: guards,
_tmp: tmp,
- joins: vec![mock_join, rpc_join],
+ joins: vec![rpc_join],
}
}
@@ -655,7 +683,12 @@ async fn run_case_inner(case: Case) {
.expect("summarizer turn must finish");
}
Entry::WebChat | Entry::WebChatNoAutomaticSummary => {
- let client_id = format!("prompt-{}", case.agent);
+ // Cases in this module can exercise the same agent with distinct
+ // settings. Keep their durable session identities separate so a
+ // process-global session cache cannot resume a previous case.
+ let case_id = case.user_message.replace(' ', "-");
+ let client_id = format!("prompt-{}-{case_id}", case.agent);
+ let thread_id = format!("thread-{}-{case_id}", case.agent);
let (mut events, ready) =
spawn_sse_collector(format!("{}/events?client_id={client_id}", stack.rpc_base));
wait_for_sse_ready(ready).await;
@@ -665,7 +698,7 @@ async fn run_case_inner(case: Case) {
"openhuman.channel_web_chat",
json!({
"client_id": client_id,
- "thread_id": format!("thread-{}", case.agent),
+ "thread_id": thread_id,
"message": case.user_message,
"model_override": "e2e-mock-model",
}),
diff --git a/vendor/tinyagents b/vendor/tinyagents
index 322118dcfa..a08a8d504d 160000
--- a/vendor/tinyagents
+++ b/vendor/tinyagents
@@ -1 +1 @@
-Subproject commit 322118dcfa08843485f09a38254527ceb5c8fdac
+Subproject commit a08a8d504dace174d27b060cb2a9b59caf35b702
diff --git a/vendor/tinyjuice b/vendor/tinyjuice
index cb15efa6b0..2716010281 160000
--- a/vendor/tinyjuice
+++ b/vendor/tinyjuice
@@ -1 +1 @@
-Subproject commit cb15efa6b00dcf6fe8437b54b823463b2c2e42b8
+Subproject commit 27160102817c4730caebb43d8c365f852b2e8014