Skip to content

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

fix: complete explicit thread model migration

Steven Enamakel527b6435a2c5
diff --git a/crates/openhuman-core/src/agent/harness/session/turn/core/harness_turn.rs b/crates/openhuman-core/src/agent/harness/session/turn/core/harness_turn.rs
index 24f4480abd..3ce92a3932 100644
--- a/crates/openhuman-core/src/agent/harness/session/turn/core/harness_turn.rs
+++ b/crates/openhuman-core/src/agent/harness/session/turn/core/harness_turn.rs
@@ -526,7 +526,7 @@ impl Agent {
// Charge this turn's usage against the thread's active goal (parity with
// the legacy engine) so budgeted goals progress to `budget_limited` and
// continuation scheduling reads a live budget. Self-guarding + best-effort
- // — a no-op when there is no active goal for the ambient thread.
+ // — a no-op when this run has no active explicit thread goal.
crate::agent::goals::runtime::account_turn_against_goal(
&self.workspace_dir,
self.thread_id(),
diff --git a/crates/openhuman-core/src/agent/harness/subagent_runner/extract_tool.rs b/crates/openhuman-core/src/agent/harness/subagent_runner/extract_tool.rs
index 6b9fad6e14..b59af41085 100644
--- a/crates/openhuman-core/src/agent/harness/subagent_runner/extract_tool.rs
+++ b/crates/openhuman-core/src/agent/harness/subagent_runner/extract_tool.rs
@@ -456,7 +456,7 @@ impl ExtractFromResultTool {
let call_seq = self.next_call_seq();
let provider_result = self
.source
- .build_summarizer(&self.model, EXTRACT_TEMPERATURE, thread_id)
+ .build_summarizer(&self.model, EXTRACT_TEMPERATURE, thread_id)?
.invoke(
&(),
ModelRequest::new(vec![
diff --git a/crates/openhuman-core/src/agent/tinyagents/tinyagents_tests.rs b/crates/openhuman-core/src/agent/tinyagents/tinyagents_tests.rs
index 5adb8de2cc..7e52d451a5 100644
--- a/crates/openhuman-core/src/agent/tinyagents/tinyagents_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/tinyagents_tests.rs
@@ -50,7 +50,7 @@ fn crate_native_text_mode_disables_native_tools_on_workload_fallbacks() {
let models = TurnModelSource::new_crate_native("chat", Arc::new(config))
.with_text_mode()
- .build("chat-v1", 0.0, Some(32_000))
+ .build("chat-v1", 0.0, Some(32_000), None)
.expect("text-mode turn models build");
assert!(
@@ -78,7 +78,7 @@ fn direct_model_turn_source_builds_without_provider_adapter() {
assert!(source.direct_model.is_some());
let models = source
- .build("mock-model", 0.0, Some(32_000))
+ .build("mock-model", 0.0, Some(32_000), None)
.expect("direct model source builds");
assert_eq!(models.provider_id(), "injected");
assert_eq!(models.context_window(), Some(32_000));
diff --git a/crates/openhuman-core/src/inference/provider/openhuman_backend_model.rs b/crates/openhuman-core/src/inference/provider/openhuman_backend_model.rs
index 680f6be43b..28ce74f617 100644
--- a/crates/openhuman-core/src/inference/provider/openhuman_backend_model.rs
+++ b/crates/openhuman-core/src/inference/provider/openhuman_backend_model.rs
@@ -456,10 +456,8 @@ fn project_managed_usage(mut response: ModelResponse) -> ModelResponse {
response
}
-/// Inject the current run's thread into provider options. Root entrypoints that
-/// have not yet migrated to the explicit run carrier still establish this
-/// scope; the shared-runner cutover preserves that boundary until those routes
-/// pass `OpenHumanRunContext.thread_id` end-to-end.
+/// Inject this managed model's explicitly owned thread into provider options.
+/// This backend-only wire extension is never inferred from ambient state.
fn with_thread_id(request: ModelRequest, thread_id: Option<&str>) -> ModelRequest {
let Some(thread_id) = thread_id else {
return request;