Skip to content

armgit / avibe

Public Imported from GitHub
0

Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.

fix(agent-core): bound provider silence at 300s and report a stall as a stall (#2387)

Call White113ae31da89c
diff --git a/core/agent_core/ai/_common.py b/core/agent_core/ai/_common.py
index bb55f9787..fb6a4a1b1 100644
--- a/core/agent_core/ai/_common.py
+++ b/core/agent_core/ai/_common.py
@@ -16,6 +16,7 @@ from urllib.parse import parse_qsl, unquote, unquote_to_bytes, urlencode, urlspl
import httpx
from core.agent_core.ai.errors import (
+ ProviderStalled,
_is_sensitive_key,
classify_error,
parse_retry_after,
@@ -35,6 +36,7 @@ from core.agent_core.messages import (
UserContent,
)
from core.agent_core.ai.provider import (
+ RETRYABLE_ERROR_KINDS,
BlockEnd,
Done,
MediaLoader,
@@ -64,13 +66,18 @@ class WireField:
children: tuple["WireField", ...] = ()
item_children: tuple["WireField", ...] = ()
-# A provider that never produces headers or pauses forever between chunks must
-# not hold an agent turn indefinitely. These bounds are deliberately shared by
-# every native adapter; the loop may retry the resulting network error only
-# when no model output has been emitted.
+# A provider that never answers or stops sending mid-stream must not hold an
+# agent turn forever, but a healthy one can stay silent for minutes: a
+# reasoning model before its first token, or a relay that buffers a long tool
+# call's arguments. Through Model Hub even the response headers wait for the
+# first model output. Codex, Claude Code, Pi, and OpenCode all allow 300s of
+# silence, so the same bound covers every wait on the provider: response
+# headers, the first chunk, and each next chunk. Connecting stays separately
+# short, so an unreachable provider still fails fast. Both bounds are shared
+# by every native adapter; the loop may retry the resulting error only when no
+# model output has been emitted.
CONNECT_TIMEOUT_S = 10.0
-TIME_TO_FIRST_BYTE_TIMEOUT_S = 30.0
-IDLE_CHUNK_TIMEOUT_S = 30.0
+PROVIDER_SILENCE_TIMEOUT_S = 300.0
CLEANUP_TIMEOUT_S = 10.0
MAX_CUMULATIVE_OUTPUT_CHARS = 32 * 1024 * 1024
# Conservative structural allowances, not a one-byte item counter. These cover
@@ -973,7 +980,7 @@ class StreamAssembler:
error = ProviderError(
kind=kind,
message=message,
- retryable=kind in {"rate_limit", "overloaded", "network", "server"} and not self.streamed,
+ retryable=kind in RETRYABLE_ERROR_KINDS and not self.streamed,
retry_after_s=parse_retry_after((headers or {}).get("retry-after")),
status=status,
partial=partial,
@@ -1367,7 +1374,6 @@ async def iter_sse_events(
parser = SSEParser()
iterator = response.aiter_bytes().__aiter__()
- first_chunk = True
while True:
if cancel.cancelled:
return
@@ -1375,17 +1381,12 @@ async def iter_sse_events(
chunk = await _await_network(
iterator.__anext__(),
cancel,
- timeout_s=(
- TIME_TO_FIRST_BYTE_TIMEOUT_S
- if first_chunk
- else IDLE_CHUNK_TIMEOUT_S
- ),
+ timeout_s=PROVIDER_SILENCE_TIMEOUT_S,
)
except StopAsyncIteration:
break
if chunk is None:
return
- first_chunk = False
for event in parser.feed(chunk):
yield event
for event in parser.finish():
@@ -1423,14 +1424,22 @@ async def drive_sse_stream(
if cancel.cancelled:
candidate = assembler.aborted(cancel.reason)
else:
- request = client.build_request(method, url, json=json_body, headers=headers)
+ # The transport bounds only connecting; the wait for response
+ # headers is the provider's silence, bounded below.
+ request = client.build_request(
+ method,
+ url,
+ json=json_body,
+ headers=headers,
+ timeout=httpx.Timeout(None, connect=CONNECT_TIMEOUT_S),
+ )
# Retain the opening task even if cancellation wins the await:
# its successful result still belongs to this driver's finally.
opening = asyncio.create_task(client.send(request, stream=True))
response = await _await_network(
opening,
cancel,
- timeout_s=CONNECT_TIMEOUT_S,
+ timeout_s=PROVIDER_SILENCE_TIMEOUT_S,
)
if response is None:
candidate = assembler.aborted(cancel.reason)
@@ -1536,7 +1545,10 @@ async def _await_network(
*,
timeout_s: float | None = None,
) -> _T | None:
- """Own one cancellable network await for opening, reads, and body reads."""
+ """Own one cancellable network await for opening, reads, and body reads.
+
+ Running out of ``timeout_s`` raises ``ProviderStalled``.
+ """
if cancel.cancelled:
close = getattr(awaitable, "close", None)
@@ -1553,14 +1565,12 @@ async def _await_network(
)
if not done:
await _cancel_and_join(operation)
- raise TimeoutError(
- f"provider network operation timed out after {timeout_s:.1f}s"
- )
+ raise ProviderStalled(timeout_s)
if cancellation in done and cancel.cancelled:
await _cancel_and_join(operation)
return None
return operation.result()
- except TimeoutError:
+ except ProviderStalled:
raise
except BaseException:
await _cancel_and_join(operation)
@@ -1620,7 +1630,6 @@ async def read_response_body(
"""Read an error body through the shared cancellation owner with a byte cap."""
iterator = response.aiter_bytes().__aiter__()
- first_chunk = True
chunks: list[bytes] = []
size = 0
while size < max_bytes:
@@ -1628,17 +1637,12 @@ async def read_response_body(
chunk = await _await_network(
iterator.__anext__(),
cancel,
- timeout_s=(
- TIME_TO_FIRST_BYTE_TIMEOUT_S
- if first_chunk
- else IDLE_CHUNK_TIMEOUT_S
- ),
+ timeout_s=PROVIDER_SILENCE_TIMEOUT_S,
)
except StopAsyncIteration:
break
if chunk is None:
return None
- first_chunk = False
if not chunk:
continue
remaining = max_bytes - size
diff --git a/core/agent_core/ai/errors.py b/core/agent_core/ai/errors.py
index 019af301e..dd3621e38 100644
--- a/core/agent_core/ai/errors.py
+++ b/core/agent_core/ai/errors.py
@@ -18,7 +18,15 @@ from urllib.parse import urlsplit
import httpx
from core.agent_core.messages import AssistantMessage
-from core.agent_core.ai.provider import ProviderError
+from core.agent_core.ai.provider import RETRYABLE_ERROR_KINDS, ProviderError
+
+class ProviderStalled(TimeoutError):
+ """The connected provider sent nothing for the whole silence bound."""
+
+ def __init__(self, timeout_s: float) -> None:
+ super().__init__(f"provider sent no data for {timeout_s:g}s")
+ self.timeout_s = timeout_s
+
_OVERFLOW_PATTERNS = (
r"prompt (?:is )?too long",
@@ -140,7 +148,7 @@ def classify_error(
exc=exc,
code=effective_code,
)
- retryable = kind in {"rate_limit", "overloaded", "network", "server"} and not streamed
+ retryable = kind in RETRYABLE_ERROR_KINDS and not streamed
return ProviderError(
kind=kind,
message=message,
@@ -266,6 +274,10 @@ def _classify_kind(
if is_overflow_message(message, status=status):
return "overflow"
if exc is not None:
+ # A stall is not a connection failure: the provider was reached and
+ # then stopped sending.
+ if isinstance(exc, ProviderStalled):
+ return "stalled"
if isinstance(
exc,
(
diff --git a/core/agent_core/ai/provider.py b/core/agent_core/ai/provider.py
index 5b62c5e01..b023bcf3c 100644
--- a/core/agent_core/ai/provider.py
+++ b/core/agent_core/ai/provider.py
@@ -15,9 +15,18 @@ from core.agent_core.messages import AssistantMessage, Message, ProtocolName
from core.agent_core.tools.base import ToolSpec
ErrorKind = Literal[
- "overflow", "rate_limit", "overloaded", "network", "server", "auth", "invalid_request", "aborted", "unknown"
+ "overflow",
+ "rate_limit",
+ "overloaded",
+ "network",
+ "stalled",
+ "server",
+ "auth",
+ "invalid_request",
+ "aborted",
+ "unknown",
]
-RETRYABLE_ERROR_KINDS: frozenset[str] = frozenset({"rate_limit", "overloaded", "network", "server"})
+RETRYABLE_ERROR_KINDS: frozenset[str] = frozenset({"rate_limit", "overloaded", "network", "stalled", "server"})
@dataclass(frozen=True)
diff --git a/docs/plans/agent-core-contracts/conversion-tables.md b/docs/plans/agent-core-contracts/conversion-tables.md
index 5f6fafc5a..46f622f3d 100644
--- a/docs/plans/agent-core-contracts/conversion-tables.md
+++ b/docs/plans/agent-core-contracts/conversion-tables.md
@@ -19,7 +19,7 @@ rules on top of those mappings.
| Missing tool results | The transform inserts `[tool call interrupted; no result recorded]` with `is_error=true`. |
| Origin | Direct requests use the endpoint origin. Gateway requests parse only `x-avibe-served-hop`, whose JSON object must contain exactly `provider`, `api`, and `model`. A missing or invalid report makes the response unverified: thinking and tool-call signatures are nulled, and redacted thinking is dropped before allocating a canonical slot, so later event indexes still identify their final message blocks. |
| Cancellation | `CancelToken` ends the HTTP stream and yields one non-retryable `ProviderError(kind="aborted")`. Opening, stream reads, error-body reads, media loads, and served-hop resolution all use the shared cancellation-aware await owner. |
-| Network timeouts | The shared lifecycle driver bounds connect/open at 10 seconds, time-to-first-byte at 30 seconds, and idle time between chunks at 30 seconds. Each timeout is a classified `ProviderError(kind="network")`, retryable only when no model output was emitted; a provider that never sends response headers cannot hang a turn. A bounded 10-second cancellation join detaches a non-cooperative transport task instead of extending the timeout indefinitely. |
+| Network timeouts | The shared lifecycle driver bounds connecting at 10 seconds; a connect failure or timeout is `ProviderError(kind="network")`. Every wait on a connected provider (response headers, the first chunk, and each next chunk) is bounded by the same 300-second silence bound, the stream idle bound of Codex (`stream_idle_timeout_ms`), Claude Code, Pi, and OpenCode: reasoning models and relays that buffer tool-call arguments stay silent far longer than a connect window, and through Model Hub the response headers wait for the first model output. Running out of the silence bound is `ProviderError(kind="stalled")`, never a connection failure. Both kinds are retryable only when no model output was emitted; a provider that never sends response headers cannot hang a turn. A bounded 10-second cancellation join detaches a non-cooperative transport task instead of extending the timeout indefinitely. |
| HTTP response status | Only 2xx responses enter an SSE translator. Redirects (3xx) are terminal `invalid_request` errors and are never followed implicitly; 4xx/5xx bodies use the shared status-aware classifier. |
| SSE memory and scan bounds | `SSEParser` caps an unfinished line at 8 MiB of decoded characters and an unfinished event's combined `data:` fields at 32 MiB of decoded characters. It scans each buffer with a cursor and compacts once per feed, so many short fields remain linear rather than repeatedly copying the suffix. Exceeding either bound is one terminal `invalid_request` provider error, with any assembled partial preserved. |
| Cumulative assembled-output bound | `StreamAssembler._account_output` is the only byte-accounting function. It covers text, thinking, signatures, opaque/reasoning details, tool arguments, serialized initial tool inputs, tool-call identities and aliases. Each content slot, tool state, or Anthropic block-kind entry adds a conservative 2048-byte structure allowance; each alias adds 512 bytes, plus its string payload. The cumulative accounting budget is 32 MiB across the stream, not an exact process-RSS promise (transport/parser buffers and transient materialization have separate costs). An over-budget mutation raises one terminal `invalid_request` error, preserving the assembled partial. |
@@ -138,7 +138,7 @@ or extracted message/code pair that its wire format makes available.
| OpenAI Responses | `unauthenticated`, `permission_denied`, `invalid_api_key` | `rate_limit`, `rate_limit_error` | `overloaded`, `server_error`, `service_unavailable` | `context_length_exceeded`, `request_too_large` |
HTTP `401/403` always map to `auth`, `413` to `overflow`, `429` to
`rate_limit` with `Retry-After`, and `5xx` to `server` or `overloaded`.
-Transport errors map to `network`. Every classification is non-retryable once
+Transport errors map to `network`, and the silence bound to `stalled`. Every classification is non-retryable once
the assembler has emitted visible content or a tool-call event.
## Endpoint identity and redaction ledger
diff --git a/docs/plans/agent-core-contracts/provider-event.schema.json b/docs/plans/agent-core-contracts/provider-event.schema.json
index 81f0674ff..d1c8149e3 100644
--- a/docs/plans/agent-core-contracts/provider-event.schema.json
+++ b/docs/plans/agent-core-contracts/provider-event.schema.json
@@ -40,7 +40,7 @@
"additionalProperties": false,
"properties": {
"type": { "const": "error" },
- "kind": { "enum": ["overflow", "rate_limit", "overloaded", "network", "server", "auth", "invalid_request", "aborted", "unknown"] },
+ "kind": { "enum": ["overflow", "rate_limit", "overloaded", "network", "stalled", "server", "auth", "invalid_request", "aborted", "unknown"] },
"retryable": { "type": "boolean" },
"retry_after_s": { "type": "number", "minimum": 0 },
"status": { "type": "integer", "description": "HTTP status, when there was one." },
diff --git a/docs/plans/agent-core-contracts/provider.md b/docs/plans/agent-core-contracts/provider.md
index a1ee4b6ef..b65439061 100644
--- a/docs/plans/agent-core-contracts/provider.md
+++ b/docs/plans/agent-core-contracts/provider.md
@@ -75,7 +75,7 @@ Error classification is part of the contract because the loop branches on it:
| `kind` | Meaning | Loop action |
| --- | --- | --- |
| `overflow` | the request exceeded the model's context (Pi's overflow patterns, HTTP 413, `context_length_exceeded`) | overflow recovery (plan §5.2) |
-| `rate_limit`, `overloaded`, `network`, `server` | transient | retry with backoff, honoring `retry_after_s`, only when nothing was streamed (no deltas, no `partial`), at most 3 retries within 120 s; then the run ends with that error. After streamed output the error is terminal for the request, matching Model Hub's first-byte rule |
+| `rate_limit`, `overloaded`, `network`, `stalled`, `server` | transient (`network`: the provider could not be reached; `stalled`: a connected provider sent nothing for the silence bound) | retry with backoff, honoring `retry_after_s`, only when nothing was streamed (no deltas, no `partial`), at most 3 retries within 120 s; then the run ends with that error. After streamed output the error is terminal for the request, matching Model Hub's first-byte rule |
| `auth`, `invalid_request` | not retryable | end the run with the error |
| `aborted` | cancelled by the caller | end the run as aborted |
| `unknown` | anything else | end the run with the error |
diff --git a/modules/agents/vibey/errors.py b/modules/agents/vibey/errors.py
index 833a380d4..bd64b974c 100644
--- a/modules/agents/vibey/errors.py
+++ b/modules/agents/vibey/errors.py
@@ -9,6 +9,7 @@ from __future__ import annotations
from typing import Optional
+from core.agent_core.ai._common import PROVIDER_SILENCE_TIMEOUT_S
from modules.agents.catalog import display_name_for_backend
from vibe.i18n import t as i18n_t
@@ -28,6 +29,7 @@ _KIND_KEYS: dict[str, str] = {
"rate_limit": "rateLimit",
"overloaded": "overloaded",
"network": "network",
+ "stalled": "stalled",
"server": "server",
"auth": "auth",
"invalid_request": "invalidRequest",
@@ -51,4 +53,9 @@ def error_key(kind: Optional[str], *, reason: Optional[str] = None) -> str:
def error_text(kind: Optional[str], lang: str, *, reason: Optional[str] = None) -> str:
- return i18n_t(error_key(kind, reason=reason), lang, backend=display_name_for_backend("vibey"))
+ return i18n_t(
+ error_key(kind, reason=reason),
+ lang,
+ backend=display_name_for_backend("vibey"),
+ minutes=f"{PROVIDER_SILENCE_TIMEOUT_S / 60:g}",
+ )
diff --git a/tests/agent_core/ai/test_provider_adapters.py b/tests/agent_core/ai/test_provider_adapters.py
index bec5e6326..581ff631f 100644
--- a/tests/agent_core/ai/test_provider_adapters.py
+++ b/tests/agent_core/ai/test_provider_adapters.py
@@ -3191,24 +3191,24 @@ class _NonCooperativeReadStream(httpx.AsyncByteStream):
@pytest.mark.asyncio
[email protected]("phase", ["open", "first_byte", "idle"])
-async def test_shared_driver_bounds_each_network_wait(
[email protected]("phase", ["headers", "first_byte", "idle", "after_output"])
+async def test_shared_driver_bounds_each_wait_on_a_silent_provider(
monkeypatch: pytest.MonkeyPatch,
phase: str,
) -> None:
import core.agent_core.ai._common as common
- monkeypatch.setattr(common, "CONNECT_TIMEOUT_S", 0.01)
- monkeypatch.setattr(common, "TIME_TO_FIRST_BYTE_TIMEOUT_S", 0.01)
- monkeypatch.setattr(common, "IDLE_CHUNK_TIMEOUT_S", 0.01)
+ monkeypatch.setattr(common, "PROVIDER_SILENCE_TIMEOUT_S", 0.01)
opened = asyncio.Event()
first_byte_stream = _StalledFirstByteStream()
idle_stream = _StalledStream(
- b'data: {"choices":[{"delta":{},"finish_reason":null}]}\n\n'
+ None
+ if phase == "after_output"
+ else b'data: {"choices":[{"delta":{},"finish_reason":null}]}\n\n'
)
async def handler(_: httpx.Request) -> httpx.Response:
- if phase == "open":
+ if phase == "headers":
opened.set()
await asyncio.Event().wait()
if phase == "first_byte":
@@ -3227,7 +3227,7 @@ async def test_shared_driver_bounds_each_network_wait(
task = asyncio.create_task(
_events(OpenAIChatAdapter(client), _request("openai_chat"))
)
- if phase == "open":
+ if phase == "headers":
await opened.wait()
elif phase == "first_byte":
await first_byte_stream.started.wait()
@@ -3235,24 +3235,98 @@ async def test_shared_driver_bounds_each_network_wait(
await idle_stream.started.wait()
events = await asyncio.wait_for(task, timeout=1)
+ # A connected provider that goes silent stalled; it is not a connection failure.
error = events[-1]
assert isinstance(error, ProviderError)
- assert error.kind == "network"
- assert error.retryable is True
- assert error.partial is None
+ assert error.kind == "stalled"
+ if phase == "after_output":
+ # Output already reached the user: the stall ends the request with what streamed.
+ assert error.retryable is False
+ assert error.partial is not None
+ assert [block.text for block in error.partial.content] == ["partial"]
+ else:
+ assert error.retryable is True
+ assert error.partial is None
if phase == "first_byte":
assert first_byte_stream.closed.is_set()
- elif phase == "idle":
+ elif phase != "headers":
assert idle_stream.closed.is_set()
+class _SlowButAliveStream(httpx.AsyncByteStream):
+ def __init__(self, chunks: list[bytes], gap_s: float) -> None:
+ self.chunks = chunks
+ self.gap_s = gap_s
+
+ async def __aiter__(self):
+ for chunk in self.chunks:
+ await asyncio.sleep(self.gap_s)
+ yield chunk
+
+
+async def test_slow_but_alive_provider_is_bounded_per_silence_not_per_stream(
+ monkeypatch: pytest.MonkeyPatch,
+) -> None:
+ import core.agent_core.ai._common as common
+
+ # Response headers arrive long after connecting would have timed out, and
+ # the stream outlasts the silence bound, but no single silence reaches it.
+ monkeypatch.setattr(common, "CONNECT_TIMEOUT_S", 0.01)
+ monkeypatch.setattr(common, "PROVIDER_SILENCE_TIMEOUT_S", 0.5)
+ words = [f"w{index} " for index in range(12)]
+ chunks = [
+ b'data: ' + json.dumps({"choices": [{"delta": {"content": word}, "finish_reason": None}]}).encode() + b"\n\n"
+ for word in words
+ ] + [b'data: {"choices":[{"delta":{},"finish_reason":"stop"}]}\n\n', b"data: [DONE]\n\n"]
+
+ async def handler(_: httpx.Request) -> httpx.Response:
+ await asyncio.sleep(0.1)
+ return httpx.Response(
+ 200,
+ headers={"content-type": "text/event-stream"},
+ stream=_SlowButAliveStream(chunks, gap_s=0.05),
+ )
+
+ async with httpx.AsyncClient(transport=httpx.MockTransport(handler)) as client:
+ events = await asyncio.wait_for(_events(OpenAIChatAdapter(client), _request("openai_chat")), timeout=5)
+
+ done = events[-1]
+ assert isinstance(done, Done)
+ assert done.message.content[0].text == "".join(words)
+
+
[email protected]("failure", [httpx.ConnectError, httpx.ConnectTimeout])
+async def test_only_connecting_is_bounded_by_the_transport_and_its_failure_is_network(
+ failure: type[httpx.TransportError],
+) -> None:
+ import core.agent_core.ai._common as common
+
+ seen: list[dict[str, float | None]] = []
+
+ def handler(request: httpx.Request) -> httpx.Response:
+ seen.append(request.extensions["timeout"])
+ raise failure("connect failed", request=request)
+
+ # A client of its own may carry read limits; the driver's request replaces them.
+ async with httpx.AsyncClient(transport=httpx.MockTransport(handler), timeout=5) as client:
+ events = await _events(OpenAIChatAdapter(client), _request("openai_chat"))
+
+ assert seen == [{"connect": common.CONNECT_TIMEOUT_S, "read": None, "write": None, "pool": None}]
+ error = events[-1]
+ assert isinstance(error, ProviderError)
+ assert error.kind == "network"
+ assert error.retryable is True
+
+
@pytest.mark.asyncio
async def test_non_cooperative_stream_cancellation_join_does_not_block_driver(
monkeypatch: pytest.MonkeyPatch,
) -> None:
import core.agent_core.ai._common as common
- monkeypatch.setattr(common, "TIME_TO_FIRST_BYTE_TIMEOUT_S", 0.01)
+ monkeypatch.setattr(common, "PROVIDER_SILENCE_TIMEOUT_S", 0.01)
monkeypatch.setattr(common, "CLEANUP_TIMEOUT_S", 0.01)
stream = _NonCooperativeReadStream()
@@ -3270,7 +3344,7 @@ async def test_non_cooperative_stream_cancellation_join_does_not_block_driver(
error = events[-1]
assert isinstance(error, ProviderError)
- assert error.kind == "network"
+ assert error.kind == "stalled"
assert error.retryable is True
assert stream.cancel_seen.is_set()
assert stream.cancel_count == 1
@@ -3338,7 +3412,7 @@ async def test_redirect_error_body_read_failure_is_terminal_invalid_request(
) -> None:
import core.agent_core.ai._common as common
- monkeypatch.setattr(common, "TIME_TO_FIRST_BYTE_TIMEOUT_S", 0.01)
+ monkeypatch.setattr(common, "PROVIDER_SILENCE_TIMEOUT_S", 0.01)
stream = _ErrorBodyReadFailure()
def handler(_: httpx.Request) -> httpx.Response:
diff --git a/tests/test_vibey_agent.py b/tests/test_vibey_agent.py
index fce4e192b..57108a67b 100644
--- a/tests/test_vibey_agent.py
+++ b/tests/test_vibey_agent.py
@@ -1134,6 +1134,23 @@ async def test_a_failed_run_shows_localized_copy_and_a_refusal_shows_its_explana
assert len(reported) == 2
[email protected]("language", ["en", "zh"])
+async def test_a_provider_stall_is_not_shown_as_a_connection_failure(
+ engine, session, tmp_path, published, language
+) -> None:
+ from core.agent_core.ai.provider import ProviderError
+
+ stall = ProviderError("stalled", "provider sent no data for 300s", False)
+ harness = _Harness(engine, tmp_path, "telegram", [[stall]], language=language)
+
+ await harness.agent.handle_message(harness.request("write the page"))
+
+ # The copy names the 300-second silence bound in minutes.
+ stalled_copy = i18n_t("vibeyAgent.error.stalled", language, minutes="5")
+ assert harness.controller.im_client.sent == [f"❌ {stalled_copy}"]
+ assert stalled_copy != i18n_t("vibeyAgent.error.network", language)
+
+
async def test_a_run_failure_is_reported_to_model_hub_like_the_other_backends(engine, session, tmp_path, published) -> None:
from core.agent_core.ai.provider import ProviderError
diff --git a/vibe/i18n/en.json b/vibe/i18n/en.json
index 9071f59a9..46881794d 100644
--- a/vibe/i18n/en.json
+++ b/vibe/i18n/en.json
@@ -1550,6 +1550,7 @@
"rateLimit": "The model provider is rate-limiting requests. Try again in a moment.",
"overloaded": "The model provider is overloaded. Try again in a moment.",
"network": "The model provider could not be reached. Check the network and the Model Hub source.",
+ "stalled": "The model provider sent no new data for more than {minutes} minutes, so this turn was stopped. Try again, or choose another model.",
"server": "The model provider returned a server error. Try again in a moment.",
"auth": "The model provider rejected the credentials of this route. Check the Model Hub source.",
"invalidRequest": "The model provider rejected the request.",
diff --git a/vibe/i18n/zh.json b/vibe/i18n/zh.json
index 02416ab4f..108445857 100644
--- a/vibe/i18n/zh.json
+++ b/vibe/i18n/zh.json
@@ -1550,6 +1550,7 @@
"rateLimit": "模型服务商正在限流,请稍后重试。",
"overloaded": "模型服务商当前过载,请稍后重试。",
"network": "无法连接模型服务商。请检查网络和 Model Hub 来源。",
+ "stalled": "模型服务商超过 {minutes} 分钟没有返回新数据,本轮已中止。可以重试,或换一个模型。",
"server": "模型服务商返回了服务器错误,请稍后重试。",
"auth": "模型服务商拒绝了此路由的凭据。请检查 Model Hub 来源。",
"invalidRequest": "模型服务商拒绝了这个请求。",