Skip to content

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

test(orchestrator): tighten prompt tests to match rewritten grounding block

Steven Enamakel91f69bfa336d
diff --git a/crates/openhuman-core/src/agent/registry/agents/orchestrator/prompt_tests.rs b/crates/openhuman-core/src/agent/registry/agents/orchestrator/prompt_tests.rs
index d479cdc6a1..1702ec0ce9 100644
--- a/crates/openhuman-core/src/agent/registry/agents/orchestrator/prompt_tests.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/orchestrator/prompt_tests.rs
@@ -445,9 +445,7 @@ fn delegation_guide_adds_local_guardrail_for_text_protocol() {
// Additive: the always-delegate contract for real service requests
// is preserved — the guardrail narrows, it does not remove it.
assert!(
- guide.contains(
- "Never claim you cannot access a connected service without first attempting delegation"
- ),
+ guide.contains("Never claim you cannot access one without delegating first"),
"always-delegate contract must remain for genuine service asks ({format:?})"
);
}
@@ -463,9 +461,7 @@ fn delegation_guide_omits_local_guardrail_for_native() {
!guide.contains("### When NOT to delegate"),
"native providers must keep the delegation guide unchanged"
);
- assert!(guide.contains(
- "Never claim you cannot access a connected service without first attempting delegation"
- ));
+ assert!(guide.contains("Never claim you cannot access one without delegating first"));
}
// With no connected integrations the section is omitted for every format —
@@ -547,12 +543,42 @@ fn build_routes_prompt_heavy_domains_to_specialists() {
#[test]
fn build_includes_evidence_aware_synthesis_contract() {
+ // Folded into the grounding block, which also carries the shared heading
+ // so `SystemPromptBuilder::build` does not append the global copy twice.
+ let body = build(&ctx_with(&[])).unwrap();
+ assert!(body.contains("## Grounding and tool use"));
+ assert_eq!(body.matches("## Grounding and tool use").count(), 1);
+ assert!(body.contains("`Evidence used`"));
+ assert!(body.contains("`Failed tool calls`"));
+ assert!(body.contains("Do not introduce facts its evidence does not support"));
+ assert!(body.contains("truncated, oversized, partial or unavailable"));
+ assert!(body.contains("Preserve numeric evidence exactly"));
+ assert!(body.contains("Your tools are exactly the ones listed in this prompt"));
+}
+
+#[test]
+fn build_never_mandates_plan_review_and_allows_a_lead_in() {
+ // The chat orchestrator no longer holds `request_plan_review`: a research
+ // question must never park the turn behind an approval card. The lead-in
+ // rule is the flip side: text and tool calls in one message.
let body = build(&ctx_with(&[])).unwrap();
- assert!(body.contains("## Evidence-aware synthesis"));
- assert!(body.contains("Evidence used"));
- assert!(body.contains("Failed tool calls"));
- assert!(body.contains("Do not introduce facts"));
- assert!(body.contains("truncated, oversized, partial, or unavailable"));
+ assert!(!body.contains("request_plan_review"), "{body}");
+ assert!(!body.contains("before doing any of the work"));
+ assert!(body.contains("Don't stop with a plan: execute it."));
+ assert!(body.contains("## Plans"));
+}
+
+#[test]
+fn build_stays_inside_the_hermetic_byte_budget() {
+ // The whole point of the rewrite (latency RCA, 2026-09-22): the hermetic
+ // orchestrator body, identity included, fits in 8 KiB. Signed-in sessions
+ // add installed skills, integrations and MCP servers on top.
+ let body = build(&ctx_with(&[])).unwrap();
+ assert!(
+ body.len() <= 8 * 1024,
+ "orchestrator prompt body is {} bytes, budget is 8192",
+ body.len()
+ );
}
#[test]