Skip to content

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

refactor(agent): tidy imports and inline goal status check

Steven Enamakelea94917330e8
diff --git a/crates/openhuman-core/src/agent/session_host/runtime_session.rs b/crates/openhuman-core/src/agent/session_host/runtime_session.rs
index e17ea7fd75..6cb8b50e28 100644
--- a/crates/openhuman-core/src/agent/session_host/runtime_session.rs
+++ b/crates/openhuman-core/src/agent/session_host/runtime_session.rs
@@ -19,12 +19,18 @@ pub(super) use turn::begin_turn_resume;
use std::sync::Arc;
use anyhow::Result;
+use tinyagents_graph::goals::ThreadGoalStatus;
use tinyagents_runtime::{
CommitReceipt, ResumePreparation, SessionBuilder, SessionTerminal, ToolSnapshot,
TranscriptTarget, TurnPreparation,
};
use tinyinference_llm::message::Message;
+use super::announcement_notes::{
+ integration_announcement_note, mcp_announcement_note, skill_announcement_note,
+ skill_retraction_note,
+};
+use super::types::OpenHumanSessionHost;
use crate::agent::{
message_convert::{user_message_from_text, user_text_with_markers},
session_host::{
@@ -33,12 +39,6 @@ use crate::agent::{
tinyagents::{host::OpenHumanRunContext, TurnContextMiddleware},
};
-use super::announcement_notes::{
- integration_announcement_note, mcp_announcement_note, skill_announcement_note,
- skill_retraction_note,
-};
-use super::types::OpenHumanSessionHost;
-
#[path = "runtime_session_progress.rs"]
mod progress;
@@ -422,12 +422,7 @@ impl OpenHumanTurnPrelude {
)
.await;
match loaded {
- Some(goal)
- if matches!(
- goal.status,
- tinyagents_graph::goals::ThreadGoalStatus::Paused
- ) =>
- {
+ Some(goal) if matches!(goal.status, ThreadGoalStatus::Paused) => {
crate::agent::goals::runtime::resume_for_thread(
&self.workspace_dir,
self.thread_id.as_deref(),
diff --git a/crates/openhuman-core/src/agent/subagent_host/ops/runner.rs b/crates/openhuman-core/src/agent/subagent_host/ops/runner.rs
index 826d6f0c44..568bef1813 100644
--- a/crates/openhuman-core/src/agent/subagent_host/ops/runner.rs
+++ b/crates/openhuman-core/src/agent/subagent_host/ops/runner.rs
@@ -11,6 +11,7 @@ use std::sync::Arc;
use std::time::Instant;
use crate::agent::harness::agent_graph::{AgentTurnRequest, AgentTurnUsage};
+use crate::agent::harness::artifact_offload::{new_artifact_offload, offload_oversized_result};
use crate::agent::harness::definition::{
validate_tier_transition, AgentDefinition, AgentDefinitionRegistry, AgentTier, IterationPolicy,
PromptSource, SandboxMode as AgentSandboxMode,
@@ -31,17 +32,12 @@ use crate::agent::subagent_host::types::{
SubagentMode, SubagentRunError, SubagentRunOptions, SubagentRunOutcome,
};
use crate::inference::provider::AGENT_TURN_MAX_OUTPUT_TOKENS;
+use tinyagents_harness::artifacts::{
+ effective_offload_threshold, extract_artifact_paths, note_artifact_handoff,
+ DEFAULT_OFFLOAD_THRESHOLD_BYTES, HANDOFF_STAGE_RECORDED,
+};
use tinytools::{SandboxMode as TinyagentsSandboxMode, ToolSpec, WorkspaceDescriptor};
use tinytools_std::file_state::with_file_state_agent_id;
-use {
- crate::agent::harness::artifact_offload::new_artifact_offload,
- crate::agent::harness::artifact_offload::offload_oversized_result,
- tinyagents_harness::artifacts::effective_offload_threshold,
- tinyagents_harness::artifacts::extract_artifact_paths,
- tinyagents_harness::artifacts::note_artifact_handoff,
- tinyagents_harness::artifacts::DEFAULT_OFFLOAD_THRESHOLD_BYTES,
- tinyagents_harness::artifacts::HANDOFF_STAGE_RECORDED,
-};
use super::prompt::{
append_artifact_offload_contract, append_subagent_role_contract, dedup_tool_specs_by_name,