Skip to content

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

chore: files changed crates/openhuman-core/src/inference/provider/openhuman_backend_model.rs,crates/

Steven Enamakel2f09bbaa07ae
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 08c41f4ac2..058059197f 100644
--- a/crates/openhuman-core/src/inference/provider/openhuman_backend_model.rs
+++ b/crates/openhuman-core/src/inference/provider/openhuman_backend_model.rs
@@ -441,9 +441,10 @@ pub(crate) fn without_reasoning(mut request: ModelRequest) -> ModelRequest {
/// upstream.
///
/// Sources, highest first: a `reasoning` object the caller already put in
-/// provider options (left alone); the request's provider-neutral
+/// provider options (left alone); the [`without_reasoning`] hint, which marks
+/// one helper call specifically; the request's provider-neutral
/// `ModelRequest::reasoning` (the user's thinking level, from the harness
-/// `RunPolicy::default_reasoning`); the [`without_reasoning`] hint. The
+/// `RunPolicy::default_reasoning`). The
/// neutral field is consumed here, so the OpenAI-compatible transport does not
/// also emit a top-level `reasoning_effort` for the same choice.
fn apply_reasoning_hint(mut request: ModelRequest) -> ModelRequest {
@@ -455,10 +456,11 @@ fn apply_reasoning_hint(mut request: ModelRequest) -> ModelRequest {
.get(REASONING_OFF_METADATA_KEY)
.and_then(Value::as_bool)
.unwrap_or(false);
- let wire = match request.reasoning.take() {
- Some(reasoning) => managed_reasoning_wire(&reasoning),
- None if wants_off => Some(serde_json::json!({ "enabled": false })),
- None => None,
+ let neutral = request.reasoning.take();
+ let wire = if wants_off {
+ Some(serde_json::json!({ "enabled": false }))
+ } else {
+ neutral.as_ref().and_then(managed_reasoning_wire)
};
let Some(wire) = wire else {
return request;
diff --git a/crates/openhuman-core/src/inference/provider/openhuman_backend_model_tests.rs b/crates/openhuman-core/src/inference/provider/openhuman_backend_model_tests.rs
index 1ca9a52ebf..33daa3f05b 100644
--- a/crates/openhuman-core/src/inference/provider/openhuman_backend_model_tests.rs
+++ b/crates/openhuman-core/src/inference/provider/openhuman_backend_model_tests.rs
@@ -380,7 +380,7 @@ fn request_reasoning_budget_becomes_max_tokens() {
}
#[test]
-fn request_reasoning_wins_over_the_suggestion_off_hint() {
+fn suggestion_off_hint_wins_over_request_reasoning() {
use tinyinference_llm::model::{ReasoningConfig, ReasoningEffort};
let request = apply_reasoning_hint(
without_reasoning(ModelRequest::new(vec![Message::user("hi")]))
@@ -388,7 +388,7 @@ fn request_reasoning_wins_over_the_suggestion_off_hint() {
);
assert_eq!(
request.provider_options["reasoning"],
- serde_json::json!({ "effort": "low" })
+ serde_json::json!({ "enabled": false })
);
}