Skip to content

HarnessRouter Community Edition: the self-hosted, Apache-2.0 edition of the unified interface for agent harnesses. Run Codex, Claude Code, Hermes, PI, DSH, and more through one API, with sessions, streaming, files, cancellation, and failure handling. Implements the Unified Harness Protocol (UHP), an open standard. Your keys, your infrastructure.

The relay waits 600 s on a silent provider again (#407)

github-actions[bot]d41419814d87
diff --git a/docs/self-hosting-guide.md b/docs/self-hosting-guide.md
index 7a570e67..7fa9635a 100644
--- a/docs/self-hosting-guide.md
+++ b/docs/self-hosting-guide.md
@@ -948,7 +948,7 @@ docker build -t harnessrouter --build-arg WITH_BROWSER=1 .
| `HR_SANDBOX_TRUST` | `owner` | You own the box, the agent and the key, so the key is handed over directly rather than brokered. |
| `HARNESS_WORKSPACE` | `/data/workspaces` | One directory per session, on the volume, so a restart doesn't discard work in flight. |
| `HR_WORKSPACE_TTL_HOURS` | `72` | Idle session workspaces are removed after this. They rehydrate from their checkpoint, so this costs time, not work. `0` keeps them forever. |
-| `HR_RELAY_UPSTREAM_TIMEOUT_S` | `180` | How long one model call may go without sending anything before the turn is told the provider did not answer. Raise it (it was 600 before 0.31.0) if you run models that think for minutes without streaming: a few do at their highest thinking level. |
+| `HR_RELAY_UPSTREAM_TIMEOUT_S` | `600` | How long one model call may go without sending anything before the task is told the provider did not answer. Several model APIs send nothing while a model thinks (OpenAI's Chat Completions sends nothing at all), so a shorter wait cuts long thinking off. Lower it only if you would rather end a stuck call sooner than wait out a long think. It was `180` in 0.31.0 only. |
| `HR_ENTRA_AUTHORITY` | `https://login.microsoftonline.com` | Where an Azure connection that signs in with Microsoft Entra asks for its token. A sovereign cloud names its own. |
| `HARNESS_RESP_HOLD_S` | `3` | How long the gateway lets the runner hold a request for a turn's events. `0` asks every 1.2 s as before 0.30.1. |
| `HARNESS_INTERNAL_KEY` | generated | Per-container; never leaves the process tree. |
diff --git a/docs/support-matrix-notes.md b/docs/support-matrix-notes.md
index 55f724f7..f2485f00 100644
--- a/docs/support-matrix-notes.md
+++ b/docs/support-matrix-notes.md
@@ -2876,7 +2876,7 @@ them (thinking tokens at none, low, high):
Not run on the hosted service at the time of writing: the Gemini CLI base, and most bases at more
than one model.
-## How long a thinking model says nothing, and the relay's wait (2026-10-06, 0.31.0)
+## How long a thinking model says nothing, and the relay's wait (2026-10-06, 0.31.0 and 0.31.1)
The relay ends a model call that sends no event for `HR_RELAY_UPSTREAM_TIMEOUT_S`. The default was
600 s and is 180 s from 0.31.0, the value the hosted service runs. Before changing it the cost was
@@ -2917,6 +2917,47 @@ and this default with these numbers in front of him. An operator who runs such m
on such routes raises the variable; the bases that speak the Responses API to OpenAI models (Codex,
hermes, opencode, kilo) were not exposed in any cell.
+**The decision was reversed the same day (0.31.1): the default is 600 s again.** Asked to find a way
+to make the three silent cells speak, a second measurement found the silence was not three cells. The
+same problem and levels, each call watched for 430 s, now also straight at the vendors and through
+OpenRouter, and with every request field that might ask a route to show its thinking:
+
+| Chat Completions, longest run with no event | TokenRouter | Vercel | OpenRouter | the vendor itself |
+|---|---:|---:|---:|---:|
+| gpt-5.5, xhigh | over 430 s (3 of 3) | 11 s | 61 s | OpenAI over 430 s; Azure over 430 s |
+| gemini-3.1-pro-preview, high | 187 s, 234 s | 4.5 s | 4.8 s | Google 141 s |
+| claude-opus-5.5, xhigh | | 211 s | 10.6 s | not measured |
+
+- **OpenAI's Chat Completions API sends nothing while a reasoning model thinks**, and that is the
+ API, not a reseller: five calls of five passed 430 s without an event, direct, on Azure and through
+ TokenRouter (where even the status line waits for the first token: headers at 201 s in the first
+ measurement). `stream_options.include_usage` and `include_reasoning` change nothing; `reasoning` is
+ refused as an unknown parameter. On the Responses API the same model sent an event at least every
+ 30 s on all three, and about every 13 s with `reasoning.summary: "auto"`.
+- **Gemini** on Google's own endpoint speaks when asked with
+ `extra_body.google.thinking_config.include_thoughts: true` (longest gap 4.6 s), but the thoughts
+ arrive inside `delta.content` as `<thought>...</thought>`, with the answer after the closing tag in
+ the same chunk, so a base would show them as its answer. Through TokenRouter the field does nothing.
+- **Claude Opus 5.5 through Vercel** speaks when asked with `providerOptions.anthropic.thinking:
+ {"type": "adaptive", "display": "summarized"}`: a 255 s think with a longest gap of 6.8 s, in
+ `delta.reasoning` and `reasoning_details`, not in the content. `reasoning: {"enabled": true}` and
+ `include_reasoning` do nothing (195 s and 209 s of keep-alive lines).
+- OpenRouter spoke on all three models, and Vercel on OpenAI's and Google's.
+
+So at 180 s every base that speaks Chat Completions to an OpenAI model was exposed at a high level on
+a hard problem, and that is most bases. On those routes a call that is thinking and a call that is
+stuck look the same on the wire. Richard was offered the two request-field fixes and a longer wait
+for OpenAI's chat calls alone, and chose the old wait for everything. Neither fix was built; the
+fields above are recorded for whoever wants a shorter wait later. One sample per cell unless said,
+and how long a model thinks on one problem varies widely (the same Claude call took 29 s and 211 s).
+
+The same problem as a real task on the 0.31.1 candidate (pi, gemini-3.1-pro-preview through
+TokenRouter, thinking level high). With the wait set to 180 s, as 0.31.0 shipped it: the relay cut the
+model call four times, 183 s apart, pi retried each time, and the task failed after 737 s with "the
+provider did not answer". At the default, five runs: all five completed, after 28, 125, 179, 212 and
+494 s, with no cut; gpt-5.5 at xhigh straight at OpenAI completed after 128 s. So the shorter wait did
+not end a slow task sooner: it turned a task that finishes into one that fails four waits later.
+
## An Azure connection that signs in with Microsoft Entra (2026-10-06, 0.31.0)
For an organization that issues no API keys for its Azure resources: the connection is an application
diff --git a/runner/dsh_driver.py b/runner/dsh_driver.py
index 8e18f446..8b32768f 100644
--- a/runner/dsh_driver.py
+++ b/runner/dsh_driver.py
@@ -40,13 +40,13 @@ _effort_refused: set = set() # models whose provider refused the level on this
def _upstream_wait() -> float:
"""How long this relay waits on the provider: for the answer to begin, and in a stream for the
next EVENT. The runner's own figure (HR_RELAY_UPSTREAM_TIMEOUT_S, handed over by _build_dsh),
- 180 s when it is absent or not a positive number (the runner's default; see
- _relay_upstream_timeout in server.py for what that costs and buys)."""
+ 600 s when it is absent or not a positive number (the runner's default; see
+ _relay_upstream_timeout in server.py for why it is not shorter)."""
try:
- v = float(os.environ.get("HR_RELAY_UPSTREAM_TIMEOUT_S") or 180)
+ v = float(os.environ.get("HR_RELAY_UPSTREAM_TIMEOUT_S") or 600)
except ValueError:
- return 180.0
- return v if v > 0 else 180.0
+ return 600.0
+ return v if v > 0 else 600.0
UPSTREAM_WAIT_S = _upstream_wait()
diff --git a/runner/server.py b/runner/server.py
index 2b52006c..3bca9263 100644
--- a/runner/server.py
+++ b/runner/server.py
@@ -4958,17 +4958,23 @@ def _adapt_custom_auth(auth):
# request and then goes silent is indistinguishable from a working turn: the cap fires first and the
# turn is cancelled with no served model, no tool call and no reason.
#
-# The default is 180 s since 2026-10-06 (it was 600 s), the hosted service's value and Richard's
-# decision for both, made with this cost in front of him: a model that thinks without sending
-# anything is cut off. Measured that day, one hard problem at each model's highest level, streamed:
-# on most routes thinking arrives as events and the longest gap was seconds (13 of 16 cells, 0.7 to
-# 61 s), but three cells sent nothing for over 200 s before answering: gpt-5.5 and gemini-3.1-pro
-# on Chat Completions through TokenRouter (201 s and 205 s, not one byte), and claude-opus-5.5
-# through Vercel (211 s of keep-alive lines). Those end here as a timeout the turn reports. What the
-# shorter wait buys is the other case measured the same hour: a call that never answered at all in
-# 1,200 s now ends in three minutes. An operator who runs such models at such levels raises
-# HR_RELAY_UPSTREAM_TIMEOUT_S. A value that is not a positive number is ignored.
-_RELAY_WAIT_DEFAULT_S = 180.0
+# The default is the 600 s this relay has always waited, far under MAX_TURN_SECONDS, because a model
+# that thinks without sending anything is an answer on its way and not a failure. It was 180 s for
+# one release (0.31.0) and went back the same day, 2026-10-06, both on Richard's decision, once the
+# silence had been measured route by route (one hard problem at each model's highest level, streamed,
+# each call watched for 430 s; the table is in docs/support-matrix-notes.md):
+# - OpenAI's Chat Completions API sends nothing at all while a reasoning model thinks. gpt-5.5 sent
+# no event in 430 s in 5 of 5 calls: direct, on Azure, and through TokenRouter, where even the
+# status line waits for the first token. No request field changes it. Most bases speak this API.
+# - Gemini 3.1 pro is silent on Google's own endpoint (141 s) and through TokenRouter (187 to 234 s).
+# - Claude Opus 5.5 through Vercel sent 211 s of keep-alive lines and no event.
+# On those routes a call that is thinking and a call that is stuck look the same on the wire, so no
+# short wait tells them apart; the same hour a call that never answered at all in 1,200 s was seen,
+# and it holds a turn for this long. An instance whose own cap is shorter sets this lower: the
+# support-matrix suite caps a turn at 600 s, so the instance it measures runs with
+# HR_RELAY_UPSTREAM_TIMEOUT_S=180 (seven of fourteen tour families were "not settled in 600s" on
+# 2026-09-29 with the two equal). A value that is not a positive number is ignored.
+_RELAY_WAIT_DEFAULT_S = 600.0
def _relay_upstream_timeout() -> float:
diff --git a/runner/tests/test_dsh_driver_stream_liveness.py b/runner/tests/test_dsh_driver_stream_liveness.py
index b474484c..1a547249 100644
--- a/runner/tests/test_dsh_driver_stream_liveness.py
+++ b/runner/tests/test_dsh_driver_stream_liveness.py
@@ -108,11 +108,11 @@ def test_keep_alive_lines_alone_end_the_call_with_the_reason(monkeypatch):
assert b'"code": "upstream_unavailable"' in body and b"no data" in body
-def test_the_wait_is_the_runners_figure_and_180_without_it(monkeypatch):
+def test_the_wait_is_the_runners_figure_and_600_without_it(monkeypatch):
monkeypatch.delenv("HR_RELAY_UPSTREAM_TIMEOUT_S", raising=False)
- assert dsh_driver._upstream_wait() == 180
- monkeypatch.setenv("HR_RELAY_UPSTREAM_TIMEOUT_S", "600")
assert dsh_driver._upstream_wait() == 600
+ monkeypatch.setenv("HR_RELAY_UPSTREAM_TIMEOUT_S", "180")
+ assert dsh_driver._upstream_wait() == 180
for junk in ("", "0", "-1", "soon"):
monkeypatch.setenv("HR_RELAY_UPSTREAM_TIMEOUT_S", junk)
- assert dsh_driver._upstream_wait() == 180, junk
+ assert dsh_driver._upstream_wait() == 600, junk
diff --git a/runner/tests/test_relay_upstream_failure.py b/runner/tests/test_relay_upstream_failure.py
index e475cf70..193f8bd4 100644
--- a/runner/tests/test_relay_upstream_failure.py
+++ b/runner/tests/test_relay_upstream_failure.py
@@ -198,20 +198,21 @@ def test_a_provider_that_goes_silent_is_reported_as_a_timeout_not_waited_on_fore
assert up.requests == 1, "a timeout is not retried: the provider may be generating, and billing"
-def test_the_upstream_wait_is_three_minutes_unless_the_operator_says_otherwise(monkeypatch):
- """Under the turn cap, so a silent provider is reported by the relay rather than discovered by
- the cap. 180 s since 2026-10-06, decided with its cost measured: three model and route cells
- were silent for 201, 205 and 211 s before answering a hard problem at their highest thinking
- level, and those end as a timeout at this default; a call that never answered at all ends in
- three minutes instead of ten. An operator who runs such models raises the variable."""
+def test_the_upstream_wait_is_bounded_below_the_turn_cap_and_no_shorter_than_it_ever_was(monkeypatch):
+ """Under the cap, so a silent provider is reported by the relay rather than discovered by the
+ cap; and not under the 600 s this relay always waited, because a model that thinks without
+ sending anything is an answer on its way. Measured 2026-10-06: OpenAI's Chat Completions API sent
+ no event in 430 s in 5 of 5 calls at the highest level, and most bases speak it. The default was
+ 180 s for one release and cut exactly those. An instance with a shorter cap of its own (the
+ support-matrix suite's 600 s) sets the variable."""
monkeypatch.delenv("HR_RELAY_UPSTREAM_TIMEOUT_S", raising=False)
- assert rs._relay_upstream_timeout() == 180
- assert rs._relay_upstream_timeout() < rs.MAX_TURN_SECONDS
- monkeypatch.setenv("HR_RELAY_UPSTREAM_TIMEOUT_S", "600")
assert rs._relay_upstream_timeout() == 600
+ assert rs._relay_upstream_timeout() < rs.MAX_TURN_SECONDS
+ monkeypatch.setenv("HR_RELAY_UPSTREAM_TIMEOUT_S", "180")
+ assert rs._relay_upstream_timeout() == 180
for junk in ("", "0", "-5", "soon"):
monkeypatch.setenv("HR_RELAY_UPSTREAM_TIMEOUT_S", junk)
- assert rs._relay_upstream_timeout() == 180, junk
+ assert rs._relay_upstream_timeout() == 600, junk
def test_a_stream_that_stalls_is_not_ended_as_a_complete_answer(monkeypatch):