Skip to content

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

fix(ci): align fixtures with current runtime contracts

Steven Enamakel82cd2b00f057
diff --git a/crates/openhuman-cli/src/bin/library_profile/mock.rs b/crates/openhuman-cli/src/bin/library_profile/mock.rs
index 43daa15af8..6c4f4bf7fe 100644
--- a/crates/openhuman-cli/src/bin/library_profile/mock.rs
+++ b/crates/openhuman-cli/src/bin/library_profile/mock.rs
@@ -6,10 +6,11 @@ use std::sync::{Arc, Mutex};
use std::time::Duration;
use async_trait::async_trait;
-use openhuman_core::inference::provider::types::{ChatResponse, ToolCall};
+use openhuman_core::inference::provider::types::ChatResponse;
use tinyinference_llm::message::{AssistantMessage, ContentBlock, Message};
use tinyinference_llm::model::{ChatModel, ModelRequest, ModelResponse};
use tinyinference_llm::tool::ToolCall as TinyAgentsToolCall;
+use tinytools_agent::dialect::NativeToolCall as ToolCall;
/// A plain `ChatResponse` carrying only text (no tool calls).
pub fn response(text: &str) -> ChatResponse {
diff --git a/crates/openhuman-core/src/inference/tokenjuice/mod_repl_module_tests.rs b/crates/openhuman-core/src/inference/tokenjuice/mod_repl_module_tests.rs
index b5991db003..24889a837c 100644
--- a/crates/openhuman-core/src/inference/tokenjuice/mod_repl_module_tests.rs
+++ b/crates/openhuman-core/src/inference/tokenjuice/mod_repl_module_tests.rs
@@ -38,7 +38,9 @@ async fn a_large_result_becomes_a_handle_the_repl_tools_can_query() {
"not compacted: {} bytes",
output.text.len()
);
- for name in REPL_TOOL_NAMES {
+ // The footer advertises slice/search, outline, and full recovery. Structured
+ // extraction remains callable, but is not a suggested recovery operation.
+ for name in ["juice_find", "juice_summarize", "juice_retrieve"] {
assert!(output.text.contains(name), "footer must name {name}");
}
let handle = output
diff --git a/crates/openhuman-core/src/inference/tokenjuice/repl_tools.rs b/crates/openhuman-core/src/inference/tokenjuice/repl_tools.rs
index 5df8619e30..47f2e0d0e1 100644
--- a/crates/openhuman-core/src/inference/tokenjuice/repl_tools.rs
+++ b/crates/openhuman-core/src/inference/tokenjuice/repl_tools.rs
@@ -26,7 +26,7 @@ use tinyjuice::cache::store::{CcrPutResult, CcrStore};
use tinyjuice::repl::ReplLimits;
use tinytools::{PermissionLevel, Tool, ToolResult};
-/// The tool names TinyJuice declares, and the ones the handle footer names.
+/// The query tools TinyJuice declares. The footer suggests a subset of these.
pub const REPL_TOOL_NAMES: &[&str] = &["juice_find", "juice_extract", "juice_summarize"];
pub fn is_repl_tool(name: &str) -> bool {
diff --git a/crates/openhuman-core/src/test_support/rpc.rs b/crates/openhuman-core/src/test_support/rpc.rs
index 3879f225c5..083cc9f4fd 100644
--- a/crates/openhuman-core/src/test_support/rpc.rs
+++ b/crates/openhuman-core/src/test_support/rpc.rs
@@ -10,7 +10,6 @@
//! the webview after this call so the renderer also starts from a blank slate.
use serde::Serialize;
-use serde_json::json;
use crate::config::Config;
use crate::config::{clear_active_user, default_root_openhuman_dir};
diff --git a/crates/openhuman-core/src/test_support/rpc_tests.rs b/crates/openhuman-core/src/test_support/rpc_tests.rs
index 2096f27f18..1f94ac5335 100644
--- a/crates/openhuman-core/src/test_support/rpc_tests.rs
+++ b/crates/openhuman-core/src/test_support/rpc_tests.rs
@@ -11,14 +11,18 @@ fn env_lock() -> std::sync::MutexGuard<'static, ()> {
.unwrap_or_else(|poisoned| poisoned.into_inner())
}
-#[tokio::test]
-async fn reset_rejects_when_e2e_mode_unset() {
+#[test]
+fn reset_rejects_when_e2e_mode_unset() {
let _guard = env_lock();
let prior = std::env::var(E2E_MODE_ENV_VAR).ok();
std::env::remove_var(E2E_MODE_ENV_VAR);
- let err = reset()
- .await
+ let runtime = tokio::runtime::Builder::new_current_thread()
+ .enable_all()
+ .build()
+ .unwrap();
+ let err = runtime
+ .block_on(reset())
.expect_err("unset E2E mode must reject test_reset");
match prior {
diff --git a/tests/in_process/agent_prompt_comprehension_e2e.rs b/tests/in_process/agent_prompt_comprehension_e2e.rs
index aa1eeb9f8e..f16486b2f3 100644
--- a/tests/in_process/agent_prompt_comprehension_e2e.rs
+++ b/tests/in_process/agent_prompt_comprehension_e2e.rs
@@ -527,8 +527,12 @@ where
/// How the case reaches its agent.
enum Entry {
+ /// Run the runtime-only summarizer directly; ingest no longer invokes it.
+ Summarizer,
/// A web-chat turn (the orchestrator, and specialists it hands off to).
WebChat,
+ /// Web chat with an explicit assertion that OnDemand ingest stays unary.
+ WebChatNoAutomaticSummary,
/// `openhuman.flows_build` — the workflow_builder directly.
FlowsBuild,
/// `openhuman.agent_triage_evaluate` with `dry_run` — trigger_triage directly.
@@ -634,7 +638,23 @@ async fn run_case_inner(case: Case) {
let stack = boot_stack(case.extra_config).await;
match case.entry {
- Entry::WebChat => {
+ Entry::Summarizer => {
+ use openhuman_core::inference::host_runtime::ops::{agent_chat_for, AgentChatTarget};
+ let mut config = openhuman_core::config::Config::load_or_init().await.unwrap();
+ agent_chat_for(
+ &mut config,
+ AgentChatTarget::AgentId("summarizer"),
+ case.user_message,
+ Some("e2e-mock-model".into()),
+ None,
+ None,
+ None,
+ None,
+ )
+ .await
+ .expect("summarizer turn must finish");
+ }
+ Entry::WebChat | Entry::WebChatNoAutomaticSummary => {
let client_id = format!("prompt-{}", case.agent);
let (mut events, ready) =
spawn_sse_collector(format!("{}/events?client_id={client_id}", stack.rpc_base));
@@ -764,6 +784,12 @@ async fn run_case_inner(case: Case) {
"[{agent}] {run} consecutive `{tool}` calls (cap {cap}); called {calls:?}"
);
}
+ if matches!(case.entry, Entry::WebChatNoAutomaticSummary) {
+ assert!(requests.len() >= 2, "the tool result must reach a subsequent model request");
+ assert!(requests.iter().all(|request| !system_text(request)
+ .contains("You compress a single oversized tool result")));
+ }
+
}
// ─── Cases ──────────────────────────────────────────────────────────────────
@@ -884,11 +910,32 @@ fn orchestrator_reaches_cron_through_the_scheduling_pack() {
});
}
-/// An oversized orchestrator tool result goes to TinyJuice's summary stage,
-/// which calls back for the summarizer's model — and the summarizer must run
-/// with no tools at all. TinyJuice decides whether a result is worth a summary,
-/// so the scripted tool returns a large one (~29 KB); a timestamp-sized result
-/// never reaches the summarizer.
+/// The OnDemand policy leaves ingest on the orchestrator; a large result must
+/// not silently add a unary summary model call to the scripted turn.
+#[test]
+fn oversized_tool_result_does_not_automatically_invoke_summarizer() {
+ run_case(Case {
+ agent: "orchestrator",
+ agent_marker: "## Routing\n\nFirst match wins:",
+ entry: Entry::WebChatNoAutomaticSummary,
+ user_message: "What is the state of my workspace?",
+ scripted_completions: vec![
+ call("shell", json!({ "command": "seq 1 6000" })),
+ text_completion("Your workspace has nothing notable."),
+ ],
+ must_call: &["shell"],
+ must_not_call: &[],
+ must_advertise: &["shell"],
+ must_not_advertise: &[],
+ advertises_nothing: false,
+ max_consecutive_calls_of: None,
+ extra_config: "summarizer_payload_threshold_tokens = 1",
+ });
+}
+
+/// The runtime-only summarizer advertises no tools on its actual model wire.
+/// Dispatch it explicitly: TinyJuice's OnDemand mode no longer invokes a
+/// summary model automatically when an oversized tool result is ingested.
#[test]
fn summarizer_advertises_no_tools() {
run_case(Case {
@@ -896,13 +943,9 @@ fn summarizer_advertises_no_tools() {
// The summarizer's prompt is TinyJuice's summary contract, verbatim
// (`tinyjuice::summarize::SYSTEM_PROMPT`, vendor/tinyjuice/src/summarize/prompt.md).
agent_marker: "You compress a single oversized tool result",
- entry: Entry::WebChat,
+ entry: Entry::Summarizer,
user_message: "What is the state of my workspace?",
- scripted_completions: vec![
- call("shell", json!({ "command": "seq 1 6000" })),
- text_completion("Workspace summary: nothing notable."),
- text_completion("Your workspace has nothing notable."),
- ],
+ scripted_completions: vec![text_completion("Workspace summary: nothing notable.")],
must_call: &[],
must_not_call: &[],
must_advertise: &[],