Skip to content

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

fix(web_chat): classify per-model-call timeout as turn_timeout

Steven Enamakelda13beb8f317
diff --git a/crates/openhuman-core/src/web_chat/web_errors/timeout.rs b/crates/openhuman-core/src/web_chat/web_errors/timeout.rs
index 52e3e9d13e..7491c991f9 100644
--- a/crates/openhuman-core/src/web_chat/web_errors/timeout.rs
+++ b/crates/openhuman-core/src/web_chat/web_errors/timeout.rs
@@ -28,11 +28,20 @@ pub(crate) fn turn_timeout_error_message(secs: u64) -> String {
/// wall-clock deadline`, so both wall-clock phrasings are anchored here. This
/// routes the loop's graceful budget-exhaustion terminal event to the dedicated
/// `turn_timeout` copy instead of the generic catch-all.
+///
+/// The per-model-call ceiling (`RunLimits::max_model_call_ms`) is anchored by
+/// its own phrase. The harness raises it as `TinyAgentsError::CallTimeout`
+/// (retryable), which renders `call timed out: model call for run `..`
+/// exceeded its per-model-call ceiling (.. ms)` — it no longer carries the
+/// `run timed out:` prefix the run-budget `Timeout` has, so without this anchor
+/// a wedged call that exhausts its retries falls through to the generic
+/// `inference` bucket instead of `turn_timeout` (#6375).
pub(crate) fn is_turn_timeout_error(err: &str) -> bool {
err.contains(TURN_TIMEOUT_MARKER)
|| err.contains("run timed out:")
|| err.contains("exceeded its remaining wall-clock budget")
|| err.contains("exceeded its wall-clock deadline")
+ || err.contains("exceeded its per-model-call ceiling")
}
/// True when `err` is the **outer** web-turn backstop firing —
diff --git a/crates/openhuman-core/src/web_chat/web_tests_start_chat_ingress_tests.rs b/crates/openhuman-core/src/web_chat/web_tests_start_chat_ingress_tests.rs
index 03417b785d..bbe17e9132 100644
--- a/crates/openhuman-core/src/web_chat/web_tests_start_chat_ingress_tests.rs
+++ b/crates/openhuman-core/src/web_chat/web_tests_start_chat_ingress_tests.rs
@@ -541,6 +541,9 @@ fn classify_inference_error_harness_wall_clock_timeout_is_turn_timeout() {
"run timed out: model call for run `abc123` exceeded its remaining wall-clock budget (600000 ms)",
"run timed out: tool call for run `abc123` exceeded its remaining wall-clock budget (12345 ms)",
"run `abc123` exceeded its wall-clock deadline",
+ // A wedged call bounded by the per-model-call ceiling is a retryable
+ // `CallTimeout`, rendered with the `call timed out:` prefix (#6375).
+ "call timed out: model call for run `abc123` exceeded its per-model-call ceiling (2000 ms)",
] {
let ClassifiedError {
error_type: category,
diff --git a/tests/agent_harness_e2e.rs b/tests/agent_harness_e2e.rs
index 047aab3ac7..d5e400f57b 100644
--- a/tests/agent_harness_e2e.rs
+++ b/tests/agent_harness_e2e.rs
@@ -3082,7 +3082,6 @@ async fn provider_sse_tool_args_accumulation() {
/// that never answers in time must terminate the turn in seconds, and the
/// terminal event must name the per-call bound.
#[test]
-#[ignore = "TODO(#6375): web chat reports a per-model-call timeout (2s ceiling) as chat_error error_type=inference (retryable, provider) instead of turn_timeout; run: RUST_MIN_STACK=16777216 cargo test -p openhuman-cli --features <product> --test agent_harness_e2e model_call_ceiling -- --ignored"]
fn model_call_ceiling_bounds_a_wedged_call_below_the_turn_deadline() {
run_on_agent_stack(
"model_call_ceiling",