Skip to content

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

fix(caps_host): remove duplicated agent run trait methods

Steven Enamakel97e2421293c1
diff --git a/crates/openhuman-core/src/flows/caps_host/service.rs b/crates/openhuman-core/src/flows/caps_host/service.rs
index 66e2f774e4..81a0e876d8 100644
--- a/crates/openhuman-core/src/flows/caps_host/service.rs
+++ b/crates/openhuman-core/src/flows/caps_host/service.rs
@@ -358,130 +358,3 @@ fn valid_agent_request_id(id: &str) -> bool {
#[cfg(test)]
#[path = "service_tests.rs"]
mod tests;
- }
- });
- Ok(runs::AgentRunHandle { handle })
- }
-
- async fn agent_events(
- &self,
- request: runs::AgentEventsRequest,
- ) -> tinybus::Result<runs::AgentEventsResponse> {
- let state = self
- .0
- .agent_runs
- .lock()
- .await
- .get(&request.handle)
- .cloned()
- .ok_or_else(|| tinybus::Error::failed("unknown agent run handle"))?;
- let state = state.lock().await;
- if let Some(error) = &state.error {
- return Err(tinybus::Error::failed(error));
- }
- Ok(runs::AgentEventsResponse {
- events: state
- .events
- .iter()
- .filter(|event| event.seq > request.cursor)
- .take(runs::MAX_AGENT_EVENTS_PAGE)
- .cloned()
- .collect(),
- done: state.done,
- outcome: state.done.then(|| state.outcome.clone()).flatten(),
- })
- }
-
- async fn resolve_agent(&self, id: String) -> tinybus::Result<Option<runs::AgentDefinition>> {
- let binding = Arc::clone(&self.0);
- let scope = Arc::clone(&binding);
- scope
- .within(async move {
- crate::agent::harness::host_definition::AgentDefinitionRegistry::init_global(
- &binding.config.workspace_dir,
- )
- .map_err(|error| error.to_string())?;
- let registry =
- crate::agent::harness::host_definition::AgentDefinitionRegistry::current();
- registry
- .and_then(|registry| registry.get(&id).cloned())
- .map(to_bus_agent_definition)
- .transpose()
- })
- .await
- .map_err(bus_error)
- }
-
- async fn list_agents(&self) -> tinybus::Result<Vec<runs::AgentDefinition>> {
- let binding = Arc::clone(&self.0);
- let scope = Arc::clone(&binding);
- scope
- .within(async move {
- crate::agent::harness::host_definition::AgentDefinitionRegistry::init_global(
- &binding.config.workspace_dir,
- )
- .map_err(|error| error.to_string())?;
- let registry =
- crate::agent::harness::host_definition::AgentDefinitionRegistry::current();
- registry
- .map(|registry| {
- registry
- .list()
- .into_iter()
- .cloned()
- .map(to_bus_agent_definition)
- .collect()
- })
- .unwrap_or_else(|| Ok(Vec::new()))
- })
- .await
- .map_err(bus_error)
- }
-
- async fn resolve_context(
- &self,
- _request: runs::ResolveContextRequest,
- ) -> tinybus::Result<Option<runs::ContextBlock>> {
- Ok(None)
- }
-
- async fn resolve_tools(
- &self,
- _request: runs::ResolveToolsRequest,
- ) -> tinybus::Result<Vec<runs::ToolDescriptor>> {
- Ok(Vec::new())
- }
-
- async fn resolve_workdir(
- &self,
- _request: runs::ResolveWorkdirRequest,
- ) -> tinybus::Result<runs::WorkdirCheck> {
- Ok(runs::WorkdirCheck::Unmanaged)
- }
-
- async fn approval_decide(
- &self,
- request: runs::ApprovalRequest,
- ) -> tinybus::Result<runs::ApprovalOutcome> {
- if request
- .run_id
- .as_deref()
- .is_some_and(|run_id| run_id != self.0.run_id.as_str())
- {
- return Err(tinybus::Error::failed(
- "workflow approval request does not match its bound run",
- ));
- }
- // The module owns graph approval rows and projects them through the
- // durable run record. Repeated calls intentionally return Pending;
- // the module retries this request after `Runs.ResumeRun` carries the
- // human's node decision. Acting-tool approvals remain on ApprovalGate.
- Ok(runs::ApprovalOutcome::Pending)
- }
-
- async fn approval_cancel(&self, _request: runs::ApprovalCancelRequest) -> tinybus::Result<()> {
- // Graph approval rows are module-owned; cancellation is represented
- // by the module's run lifecycle and does not cancel tool approvals.
- Ok(())
- }
-}