Skip to content

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

refactor(agent): simplify subagent outcome and read-only tool setup

Steven Enamakeld972e1e49694
diff --git a/crates/openhuman-core/src/agent/subagent_host/lifecycle.rs b/crates/openhuman-core/src/agent/subagent_host/lifecycle.rs
index 839ab89228..876e02700d 100644
--- a/crates/openhuman-core/src/agent/subagent_host/lifecycle.rs
+++ b/crates/openhuman-core/src/agent/subagent_host/lifecycle.rs
@@ -488,11 +488,8 @@ impl SubagentPlanner<crate::agent::tinyagents::host::OpenHumanRunContext, HostRe
definition: request.host_request.definition.clone(),
options,
});
- // The host execution leaf resolves the exact filtered tool snapshot
- // together with its executable instances and policy. A neutral
- // empty declaration prevents this transport plan from advertising
- // an authority it has not resolved. Role, ceiling, retry and result
- // policy stay at the harness defaults: the host applies its own.
+ // The host leaf resolves the real tool snapshot and policy; an empty
+ // declaration here advertises no unresolved authority.
Ok(PreparedSubagent::new(
request.task_key.task_id,
request.host_request.definition.id,
@@ -899,8 +896,7 @@ impl OpenHumanPersistence {
..ArtifactReference::default()
})
.collect(),
- schema_error: None,
- artifact_error: None,
+ ..SubagentOutcome::cancelled(String::new())
}
}
@@ -1215,8 +1211,7 @@ fn host_outcome_to_neutral(
..ArtifactReference::default()
})
.collect(),
- schema_error: None,
- artifact_error: None,
+ ..SubagentOutcome::cancelled(String::new())
}
}
diff --git a/crates/openhuman-core/src/agent/tinyagents/harness_assembly.rs b/crates/openhuman-core/src/agent/tinyagents/harness_assembly.rs
index 783f00dab4..d7f392e287 100644
--- a/crates/openhuman-core/src/agent/tinyagents/harness_assembly.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/harness_assembly.rs
@@ -342,20 +342,13 @@ pub(super) fn assemble_turn_harness(
// (byte cap, summarizer, memory-protocol note) has finished rewriting it,
// i.e. exactly what the model sees. Registered any later, a result whose
// visible note changed between calls would count as identical.
- //
- // Tools that declare a classified, read-only policy are passed as the
- // guard's read-only set so a read repeated after a write is not blocked.
- let read_only_tools: Arc<HashSet<String>> = Arc::new(
- tool_sets
- .iter()
- .flat_map(|set| set.iter())
- .filter(|tool| {
- let policy = tool.policy();
- policy.classified && policy.side_effects.read_only
- })
- .map(|tool| tool.name().to_string())
- .collect(),
- );
+ // Classified read-only tools are the guard's read-only set.
+ let read_only_tools: HashSet<String> = tool_sets
+ .iter()
+ .flat_map(|set| set.iter())
+ .filter(|t| t.policy().classified && t.policy().side_effects.read_only)
+ .map(|t| t.name().to_string())
+ .collect();
let repeat_progress = handle.as_ref().map(|handle| {
Arc::new(
RepeatProgressMiddleware::new(