Skip to content

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

refactor(subagent_host): trim redundant fields from neutral outcome extensions

Steven Enamakeldcbf421a9863
diff --git a/crates/openhuman-core/src/agent/subagent_host/lifecycle_outcome.rs b/crates/openhuman-core/src/agent/subagent_host/lifecycle_outcome.rs
index 9806d7f836..094a136646 100644
--- a/crates/openhuman-core/src/agent/subagent_host/lifecycle_outcome.rs
+++ b/crates/openhuman-core/src/agent/subagent_host/lifecycle_outcome.rs
@@ -13,24 +13,11 @@ pub(super) fn host_outcome_to_neutral(
let usage_cost = outcome.usage.cost();
let mut extensions = std::collections::BTreeMap::from_iter([
("agent_id".into(), serde_json::json!(definition.id)),
- ("task_id".into(), serde_json::json!(&outcome.task_id)),
("iterations".into(), serde_json::json!(outcome.iterations)),
- (
- "tier".into(),
- serde_json::json!(definition.agent_tier.as_str()),
- ),
- (
- "worker_thread_id".into(),
- serde_json::json!(options.worker_thread_id),
- ),
(
"skill_filter_override".into(),
serde_json::json!(options.skill_filter_override),
),
- (
- "model_override".into(),
- serde_json::json!(options.model_override),
- ),
(
"elapsed_ms".into(),
serde_json::json!(outcome.elapsed.as_millis() as u64),
diff --git a/crates/openhuman-core/src/agent/subagent_host/lifecycle_outcome_tests.rs b/crates/openhuman-core/src/agent/subagent_host/lifecycle_outcome_tests.rs
index f778c42c80..bf06d16311 100644
--- a/crates/openhuman-core/src/agent/subagent_host/lifecycle_outcome_tests.rs
+++ b/crates/openhuman-core/src/agent/subagent_host/lifecycle_outcome_tests.rs
@@ -77,6 +77,12 @@ fn host_outcome_terminal_record_round_trips_through_json_bytes() {
};
let neutral = host_outcome_to_neutral(outcome, definition, &options);
+ assert_eq!(neutral.extensions["agent_id"], definition.id);
+ assert_eq!(neutral.extensions["iterations"], 2);
+ assert!(!neutral.extensions.contains_key("task_id"));
+ assert!(!neutral.extensions.contains_key("tier"));
+ assert!(!neutral.extensions.contains_key("worker_thread_id"));
+ assert!(!neutral.extensions.contains_key("model_override"));
let encoded = serde_json::to_vec(&neutral).unwrap();
let decoded: tinyagents_orchestration::subagent::SubagentOutcome =
serde_json::from_slice(&encoded)