Skip to content

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

test: remove obsolete generated runtime context coverage test

Steven Enamakel75bb8142ee51
diff --git a/tests/raw_coverage/tools_erased_host_extension_raw_coverage_e2e.rs b/tests/raw_coverage/tools_erased_host_extension_raw_coverage_e2e.rs
index 497f7525cd..8f7950404e 100644
--- a/tests/raw_coverage/tools_erased_host_extension_raw_coverage_e2e.rs
+++ b/tests/raw_coverage/tools_erased_host_extension_raw_coverage_e2e.rs
@@ -20,8 +20,7 @@ use std::sync::Arc;
use serde_json::json;
-use openhuman_core::agent::tool_policy::{GeneratedToolRuntimeContext, GeneratedToolRuntimeRisk};
-use openhuman_core::tools::host_extensions::{generated_runtime_context, pack_registry_handle};
+use openhuman_core::tools::host_extensions::pack_registry_handle;
use openhuman_core::tools::toolpacks::registry::{CATALOG, PACKS};
use tinyagents_harness::tool::packs::{PackRegistryHandle, UseSkillTool};
use tinytools::Tool;
@@ -93,93 +92,3 @@ async fn a_pack_tools_registry_handle_reads_back_as_the_same_handle() {
discriminating between bound and unbound. Rendered: {rendered}"
);
}
-
-/// A generated tool's per-call runtime context survives the round trip, field
-/// for field.
-///
-/// The context is carried by value through `Box<dyn Any>`, so this asserts the
-/// fields the policy layer actually reads rather than only that *something*
-/// came back — a downcast to a same-shaped but different type would satisfy
-/// `is_some()` and still lose the policy inputs.
-///
-/// The producer here is a local fixture on purpose: no production tool
-/// implements `host_call_extension` (see `W8-test-findings.md`), so there is no
-/// shipped tool to drive this through. What is pinned is the seam itself.
-#[test]
-fn a_generated_tools_runtime_context_reads_back_with_its_policy_fields() {
- let context = generated_runtime_context(&GeneratedTool, &json!({"to": "someone"}))
- .expect("a tool that supplies a per-call context must yield it back");
-
- assert_eq!(context.provider_id, "mail.runtime");
- assert_eq!(context.capability_id, "email.send");
- assert_eq!(
- context.risk,
- GeneratedToolRuntimeRisk::ExternalWrite,
- "risk is what the policy layer gates on; losing it downgrades an \
- external write to the default"
- );
- assert_eq!(context.source_digest.as_deref(), Some("sha256:abc"));
- assert_eq!(context.approval_id.as_deref(), Some("approval-1"));
-}
-
-// ── fixtures ──────────────────────────────────────────────────────────────
-
-struct PlainTool;
-
-#[async_trait]
-impl Tool for PlainTool {
- fn name(&self) -> &str {
- "plain_tool"
- }
-
- fn description(&self) -> &str {
- "A tool that stores nothing on either erased extension."
- }
-
- fn parameters_schema(&self) -> Value {
- json!({"type": "object"})
- }
-
- async fn execute(&self, _args: Value) -> anyhow::Result<ToolResult> {
- Ok(ToolResult::success("ok"))
- }
-
- fn permission_level(&self) -> PermissionLevel {
- PermissionLevel::ReadOnly
- }
-}
-
-struct GeneratedTool;
-
-#[async_trait]
-impl Tool for GeneratedTool {
- fn name(&self) -> &str {
- "generated_tool"
- }
-
- fn description(&self) -> &str {
- "Stands in for a generated tool carrying a per-call runtime context."
- }
-
- fn parameters_schema(&self) -> Value {
- json!({"type": "object"})
- }
-
- async fn execute(&self, _args: Value) -> anyhow::Result<ToolResult> {
- Ok(ToolResult::success("sent"))
- }
-
- fn permission_level(&self) -> PermissionLevel {
- PermissionLevel::ReadOnly
- }
-
- fn host_call_extension(&self, _args: &Value) -> Option<Box<dyn Any + Send + Sync>> {
- Some(Box::new(GeneratedToolRuntimeContext {
- provider_id: "mail.runtime".to_string(),
- capability_id: "email.send".to_string(),
- risk: GeneratedToolRuntimeRisk::ExternalWrite,
- source_digest: Some("sha256:abc".to_string()),
- approval_id: Some("approval-1".to_string()),
- }))
- }
-}