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(workbench): carry Vibey's Models next step as data, and fail a supply refusal once (#2517)

Call White6d370d9e37db
diff --git a/core/agent_auth_service.py b/core/agent_auth_service.py
index 6d0fa87d1..77acfff8e 100644
--- a/core/agent_auth_service.py
+++ b/core/agent_auth_service.py
@@ -944,15 +944,15 @@ class AgentAuthService:
When the Model Hub leaves it no model now (``hub_supply_block``: disabled, gateway off,
no source), that cause is the answer, as it is for a Turn; otherwise the guidance is.
"""
- from modules.agents.model_hub import ModelSupplyRefusal, hub_supply_refusal, models_next_step
+ from modules.agents.model_hub import hub_supply_refusal, models_next_step_text
refusal = await asyncio.to_thread(hub_supply_refusal, self.controller, backend, self._lang())
if refusal is not None:
- answer, cause = f"❌ {refusal}", refusal
+ answer, fixed_in_models = f"❌ {refusal}", refusal.fixed_in_models
else:
- answer = self._t("command.setup.builtinBackend", backend=display_name_for_backend(backend))
- cause = ModelSupplyRefusal(answer, fixed_in_models=True)
- next_step = models_next_step(self.controller, context, cause=cause)
+ answer, fixed_in_models = self._t("command.setup.builtinBackend", backend=display_name_for_backend(backend)), True
+ # `/setup` is an IM command, so it carries the IM form of the step.
+ next_step = models_next_step_text(self.controller) if fixed_in_models else None
await self._send_message(context, "\n".join(line for line in (answer, next_step) if line))
async def start_setup(
diff --git a/core/backend_failure.py b/core/backend_failure.py
index 02d636fd5..1589a3acd 100644
--- a/core/backend_failure.py
+++ b/core/backend_failure.py
@@ -392,27 +392,39 @@ async def emit_backend_failure(
return alone is not enough to distinguish a delivered message from a lost one.
"""
- from modules.agents.model_hub import is_model_hub_refusal, models_next_step
+ from core.message_context import resolve_context_platform
+ from modules.agents.model_hub import (
+ MODELS_NEXT_STEP,
+ is_model_hub_refusal,
+ models_next_step_text,
+ refusal_fixed_in_models,
+ )
backend_name = str(backend or "backend").strip() or "backend"
error, visible = _failure_texts(backend_name, diagnostic, display_text)
hub_failure = _model_hub_failure(controller, context, request, backend_name)
if hub_failure is not None and hub_failure[0] is not None:
visible = hub_failure[0]
- # A Model Hub refusal whose fix is in Models ends with where to make it.
- next_step = models_next_step(
- controller,
- context,
- cause=cause,
- outcome=hub_failure[2] if hub_failure is not None and hub_failure[0] is not None else None,
- )
- if next_step:
- visible = f"{visible}\n{next_step}"
terminal = _terminal_output(request, output)
if hub_failure is not None and hub_failure[1] and not getattr(controller, "shutdown_requested", False):
terminal = replace(
terminal, metadata={**terminal.metadata, "local_error_detail": hub_failure[1]},
)
+ # A Model Hub refusal whose fix is in Models ends with where to make it. The Workbench
+ # draws notices as plain text, so it gets the step as data and renders its own link;
+ # IM gets the line itself. The form follows where the notice goes, after a scheduled or
+ # Harness override; a restart's copy below replaces the refusal, and its step with it.
+ if getattr(controller, "shutdown_requested", False) is not True and refusal_fixed_in_models(
+ cause=cause,
+ outcome=hub_failure[2] if hub_failure is not None and hub_failure[0] is not None else None,
+ ):
+ platform = resolve_context_platform(
+ routed_delivery_context(context), fallback_platform=getattr(controller, "primary_platform", None),
+ )
+ if platform == "avibe":
+ terminal = replace(terminal, metadata={**terminal.metadata, "failure_next_step": MODELS_NEXT_STEP})
+ else:
+ visible = f"{visible}\n{models_next_step_text(controller)}"
harness_run_id = harness_run_identity(context, request)
owns_failure_contract = bool(
_turn_failure_identity(context, request) or harness_run_id
diff --git a/core/handlers/message_handler.py b/core/handlers/message_handler.py
index 46d303a05..2e9368da0 100644
--- a/core/handlers/message_handler.py
+++ b/core/handlers/message_handler.py
@@ -11,8 +11,10 @@ from core.audio_asr import (
)
from core.agent_input import AgentInputMetadata
from core.backend_failure import emit_backend_failure
+from core.delivery_target import routed_delivery_context
from core.message_output import HARNESS_PROMPT_ECHO_SPEC_KEY
from core.message_context import (
+ resolve_context_platform,
resolve_context_thread_id,
)
from core.native_dispatch_phase import (
@@ -893,11 +895,24 @@ class MessageHandler(BaseHandler):
request: AgentRequest | None,
error: BaseException,
) -> None:
- """Report one backend dispatch failure through the shared live boundary."""
+ """Report one backend dispatch failure through the shared live boundary.
- error_text = self.formatter.format_error(
- self._t("error.processMessageFailed", error=str(error))
- )
+ Like every backend failure notice, the text carries no markup: the Workbench draws
+ notices as plain text. An IM sends it as its own markup, so the raw error is escaped
+ by the formatter of the platform the notice goes to, never the primary one's.
+ A Model Hub supply refusal is already the user's copy and names its own cause.
+ """
+
+ from modules.agents.model_hub import ModelSupplyRefusal
+
+ if isinstance(error, ModelSupplyRefusal):
+ error_text = f"❌ {error}"
+ else:
+ detail = str(error)
+ target = routed_delivery_context(context)
+ if resolve_context_platform(target) != "avibe":
+ detail = self._get_formatter(target).escape_special_chars(detail)
+ error_text = f"❌ {self._t('error.processMessageFailed', error=detail)}"
await emit_backend_failure(
self.controller,
context,
diff --git a/docs/plans/vibey-default-agent.md b/docs/plans/vibey-default-agent.md
index 8f48376e5..c8b0fa981 100644
--- a/docs/plans/vibey-default-agent.md
+++ b/docs/plans/vibey-default-agent.md
@@ -83,10 +83,17 @@ On master before this change:
`modules/agents/model_hub.py`. This covers:
- the supply blocks other than `hub_disabled`;
- the built-in backend's missing model;
- - route refusals whose copy already sends the reader to Models.
-- **On the Workbench,** the requester is known, so the step depends on them:
- - a caller with `can_manage_instance` (the gate on `/settings/models`) gets a link to `/settings/models`;
- - anyone else gets `errors.askAdminForModels`, never a link they would be bounced from.
+ - route refusals whose copy already sends the reader to Models;
+ - an Agent model that is not in its backend's model list (`model_unlisted`), including one a person emptied the list
+ of. The list and the Agent row stay as the person left them; the step points to where the list is kept. Like the
+ supply refusals, this refusal already holds its input for an explicit retry.
+- **On the Workbench,** notices are drawn as plain text, never Markdown: a notice can carry provider or upstream text,
+ and that must not become clickable. So the step travels as data, not text. The notice's metadata says
+ `failure_next_step: "models"`, and the Workbench draws the step from its own copy, for the viewer:
+ - a viewer with `can_manage_instance` (the gate on `/settings/models`) gets an **Open Models** button;
+ - anyone else gets "Ask an Avibe admin to fix this in Models.", never a link they would be bounced from.
+- **The form follows where the notice goes:** a scheduled or Harness Turn whose notices go to an IM channel gets the
+ IM line. A restart's copy replaces the refusal, and its step with it.
- **In IM,** no identity maps an IM user to a Workbench principal. So the step is the same for everyone and makes no
claim about the requester's access:
- With Avibe Cloud paired, `errors.modelsNextStepImUrl` offers `workbench_url('/settings/models')` as information.
@@ -103,6 +110,12 @@ On master before this change:
- the setup card note
- the Settings → Backends list badge
- the backend page notice and its Models link
+- **One refusal, held.** A supply refusal fails the same way until someone changes Models, so its input is held for
+ an explicit retry (prewrite failure evidence `model_supply_refusal`) instead of spending the automatic startup
+ retries. IM has no Retry control, so there the held input waits in the Session's queue, where the Workbench
+ retries or removes it; the person's next message still runs. The notice is plain text: a supply refusal is shown as
+ its own copy (`❌ …`), with no "Error:" wrapper and no formatter markup. Another dispatch error is escaped for the
+ IM it goes to, never for the Workbench.
- **No fallback.** A turn sent to an Agent that cannot run is refused. It is never re-routed: the first turn pins its
Agent to the Session, so a fallback would silently become permanent.
@@ -135,8 +148,8 @@ On master before this change:
| Key | en | zh |
|---|---|---|
| `errors.modelSourceRequired` (server, new) | {backend} has no model source yet. Add an API key or a subscription in Models. | {backend} 还没有模型来源。请在「模型」页添加 API Key 或订阅。 |
-| `errors.openModelsLink` (server, new; Workbench) | [Open Models]({url}) | [打开「模型」页]({url}) |
-| `errors.askAdminForModels` (server, new; Workbench) | Ask an Avibe admin to fix this in Models. | 请联系 Avibe 管理员在「模型」页处理。 |
+| `chat.failureNextStep.openModels` (UI, new; Workbench) | Open Models | 打开「模型」页 |
+| `chat.failureNextStep.askAdmin` (UI, new; Workbench) | Ask an Avibe admin to fix this in Models. | 请联系 Avibe 管理员在「模型」页处理。 |
| `errors.modelsNextStepImUrl` (server, new; IM) | Someone who manages this Avibe can fix it in Models: {url} | 管理这个 Avibe 的人可以在「模型」页处理:{url} |
| `errors.modelsNextStepIm` (server, new; IM) | Someone who manages this Avibe can fix it in Models, in the Avibe Workbench. | 管理这个 Avibe 的人可以在 Avibe 工作台的「模型」页处理。 |
| `command.setup.builtinBackend` (server, new) | {backend} gets its models from Model Hub and needs no sign-in. Add or manage model sources in Models. | {backend} 通过模型网关获取模型,无需单独登录。请在「模型」页添加或管理模型来源。 |
@@ -202,9 +215,8 @@ and a closed-loop case in `tests/scenarios/auth_setup/test_auth_setup_scenarios.
be a separate product decision.
- Without a qualifying native selection, the starting model comes only from what models.dev can describe. An endpoint
whose models it does not know, and that lists no native selection, still needs one click on Vibey's setup card.
-- Route refusals and the gateway-off copy keep their own "in Models" clause. The appended §2 step adds the link, or
- tells a requester who cannot open Models to ask an admin. The two lines can overlap; only the step varies by
- requester.
+- Route refusals and the gateway-off copy keep their own "in Models" clause. The §2 step (the Workbench's button or
+ admin hint, or the IM line) adds the way there. The two can overlap; only the step varies by viewer or surface.
- Setup completion keeps its existing fallback, the second writer named in §1's invariants. If Vibey cannot run at
completion, which takes a source models.dev cannot describe and no pick, the existing rule records the first
runnable CLI assistant. Otherwise setup would finish on a default that cannot run.
diff --git a/modules/agents/model_hub.py b/modules/agents/model_hub.py
index 13fb31cc8..92994b8ab 100644
--- a/modules/agents/model_hub.py
+++ b/modules/agents/model_hub.py
@@ -372,8 +372,11 @@ _HUB_SUPPLY_REFUSALS = {
"gateway_off": "errors.modelGatewayOff",
"no_source": "errors.modelSourceRequired",
}
-# The turn-outcome copy that already sends its reader to Models.
-_MODELS_ROUTE_REFUSALS = frozenset({"modelHub.launch.interrupted", "modelHub.launch.route_unconfigured"})
+# The turn-outcome copy whose fix is in Models: it sends its reader there, or names a backend's
+# model list, which Models keeps (a model the person removed from the list, even its last one).
+_MODELS_ROUTE_REFUSALS = frozenset(
+ {"modelHub.launch.interrupted", "modelHub.launch.route_unconfigured", "modelHub.launch.model_unlisted"}
+)
MODELS_PAGE_PATH = "/settings/models"
@@ -410,62 +413,53 @@ def is_model_hub_refusal(error: BaseException | None) -> bool:
return isinstance(error, ModelSupplyRefusal) or turn_refusal(error) is not None
-def models_next_step(
- controller: Any,
- context: Any,
+# The structured next step a Workbench notice carries; the Workbench draws it from its own copy.
+MODELS_NEXT_STEP = "models"
+SUPPLY_REFUSAL_RETRY_REASON = "model_supply_refusal"
+
+
+def refusal_fixed_in_models(
*,
cause: BaseException | None = None,
outcome: TurnOutcomeProjectionInput | None = None,
-) -> str | None:
- """The line that ends a refused turn whose fix is in Models, else ``None``.
+) -> bool:
+ """Whether a refused turn's fix is in Models.
- A supply refusal says whether Models fixes it; a turn outcome does when its own
- copy already sends the reader there. The Workbench knows its requester: one who
- manages the instance gets the link, anyone else is told to ask an admin. No IM
- identity maps to a Workbench principal, so an IM refusal makes no claim about its
- requester: it says who can fix it, offering Avibe Cloud's public URL when there is one.
+ A supply refusal says so itself; a turn outcome does when its own copy already
+ sends the reader there.
"""
if isinstance(cause, ModelSupplyRefusal):
- fixed_in_models = cause.fixed_in_models
- else:
- refused = outcome if outcome is not None else turn_refusal(cause)
- copy = project_turn_outcome_copy(refused) if refused is not None else None
- fixed_in_models = copy is not None and copy.key in _MODELS_ROUTE_REFUSALS
- if not fixed_in_models:
- return None
- language = _language(controller)
- if _context_platform(controller, context) == "avibe":
- if _workbench_caller_manages_instance(context):
- return t("errors.openModelsLink", language, url=MODELS_PAGE_PATH)
- return t("errors.askAdminForModels", language)
+ return cause.fixed_in_models
+ refused = outcome if outcome is not None else turn_refusal(cause)
+ copy = project_turn_outcome_copy(refused) if refused is not None else None
+ return copy is not None and copy.key in _MODELS_ROUTE_REFUSALS
+
+
+def models_next_step_text(controller: Any) -> str:
+ """The IM line that ends a refusal whose fix is in Models.
+
+ No IM identity maps to a Workbench principal, so the line makes no claim about its
+ requester: it says who can fix it, offering Avibe Cloud's public URL when there is one.
+ The Workbench draws its own next step from ``MODELS_NEXT_STEP`` instead.
+ """
+
from core.avibe_cloud import workbench_url
+ language = _language(controller)
url = workbench_url(MODELS_PAGE_PATH, getattr(controller, "config", None))
return t("errors.modelsNextStepImUrl", language, url=url) if url else t("errors.modelsNextStepIm", language)
-def _context_platform(controller: Any, context: Any) -> str | None:
- return (
- getattr(context, "platform", None)
- or (getattr(context, "platform_specific", None) or {}).get("platform")
- or getattr(controller, "primary_platform", None)
- )
-
+def hold_refused_input(context: Any) -> None:
+ """Keep an input the Model Hub refused for want of a model for an explicit retry.
-def _workbench_caller_manages_instance(context: Any) -> bool:
- """Whether the Workbench caller passes the gate on Models (``can_manage_instance``)."""
-
- from core.caller_context import caller_context_from_platform_payload, caller_resource_user_context
- from storage.resource_access_service import current_resource_context
+ A supply refusal fails the same way until someone changes Models, so it must not
+ spend the automatic startup retries a transient failure gets.
+ """
- caller = caller_context_from_platform_payload(getattr(context, "platform_specific", None), message=context)
- remote = caller.is_remote if caller is not None else str(getattr(context, "user_id", "")).startswith("remote:")
- if not remote:
- return True # The local Workbench is the instance owner's.
- # A remote caller is judged by its own authorization snapshot; a missing one fails closed.
- snapshot = caller_resource_user_context(caller) if caller is not None else None
- return current_resource_context(snapshot or {}, is_remote=True).can_manage_instance
+ if context is not None:
+ mark_prewrite_recovery_required(context, SUPPLY_REFUSAL_RETRY_REASON)
def _hold_unrunnable_input(context: Any, error: ModelHubError) -> None:
diff --git a/modules/agents/service.py b/modules/agents/service.py
index f7573b8c3..6c7de63be 100644
--- a/modules/agents/service.py
+++ b/modules/agents/service.py
@@ -477,7 +477,7 @@ class AgentService:
await self._begin_turn_status(request.context)
from core.agent_model_selection import require_agent_model
from modules.agents.catalog import AGENT_BACKENDS, is_builtin_backend
- from modules.agents.model_hub import ModelSupplyRefusal, hub_supply_refusal
+ from modules.agents.model_hub import ModelSupplyRefusal, hold_refused_input, hub_supply_refusal
if agent.name in AGENT_BACKENDS:
has_subagent_model = request.subagent_model is not None
@@ -487,6 +487,7 @@ class AgentService:
# When the Model Hub is why there is no model to select, say so, not "select a model".
refusal = await asyncio.to_thread(hub_supply_refusal, self.controller, agent.name, language)
if refusal is not None:
+ hold_refused_input(request.context)
raise refusal
try:
selected_model = require_agent_model(requested_model, agent.name, language)
@@ -494,6 +495,7 @@ class AgentService:
if not is_builtin_backend(agent.name):
raise
# A built-in backend's models all come from its Model Hub list, so Models is the fix.
+ hold_refused_input(request.context)
raise ModelSupplyRefusal(str(exc), fixed_in_models=True) from None
if has_subagent_model:
request.subagent_model = selected_model
diff --git a/modules/agents/vibey/agent.py b/modules/agents/vibey/agent.py
index 4a79ee899..69ccdfb99 100644
--- a/modules/agents/vibey/agent.py
+++ b/modules/agents/vibey/agent.py
@@ -1234,13 +1234,15 @@ class VibeyAgent(BaseAgent):
)
async def _fail_preflight(self, request: AgentRequest, error: BaseException) -> None:
- from modules.agents.model_hub import hub_supply_refusal, launch_refusal_copy
+ from modules.agents.model_hub import hold_refused_input, hub_supply_refusal, launch_refusal_copy
logger.warning("Vibey could not resolve its model route: %s", error)
language = self._language()
# Every route runs through the Model Hub: when it leaves Vibey no model (disabled, its gateway
# off, no source), that explains the failure, and the supply refusal is the failure's cause.
supply = await asyncio.to_thread(hub_supply_refusal, self.controller, BACKEND, language)
+ if supply is not None:
+ hold_refused_input(request.context)
refusal = str(supply) if supply is not None else (
launch_refusal_copy(self.controller, error) or error_text(None, language)
)
diff --git a/tests/test_agent_service.py b/tests/test_agent_service.py
index 09531ae81..83844974e 100644
--- a/tests/test_agent_service.py
+++ b/tests/test_agent_service.py
@@ -382,6 +382,7 @@ def test_a_missing_model_the_model_hub_explains_names_the_model_hub(
monkeypatch, backend, hub_switch, gateway_enabled, has_source, refusal, fixed_in_models
):
"""The Avibe Agent's models come only through the Model Hub: while it cannot supply any, choosing a model is not the fix."""
+ from core.native_dispatch_phase import DISPATCH_PHASE_PREWRITE, prewrite_failure_evidence, set_dispatch_phase
from modules.agents.model_hub import ModelSupplyRefusal
from tests.scenario_harness.model_hub import config_with_sources, source
@@ -400,6 +401,7 @@ def test_a_missing_model_the_model_hub_explains_names_the_model_hub(
request = _request("hello")
request.vibe_agent_model = None
request.failure_handler = AsyncMock(return_value=True)
+ set_dispatch_phase(request.context, DISPATCH_PHASE_PREWRITE)
with pytest.raises(ValueError, match=refusal) as refused:
await service.handle_message(backend, request)
@@ -407,9 +409,15 @@ def test_a_missing_model_the_model_hub_explains_names_the_model_hub(
# Whether Models is where the fix is decides the notice's next step.
if fixed_in_models is None:
assert not isinstance(refused.value, ModelSupplyRefusal)
+ assert prewrite_failure_evidence(request.context) == {}
else:
assert isinstance(refused.value, ModelSupplyRefusal)
assert refused.value.fixed_in_models is fixed_in_models
+ # A supply refusal fails the same way until Models changes, so the input waits for an
+ # explicit retry rather than spending the automatic startup retries.
+ assert prewrite_failure_evidence(request.context) == {
+ "reason": "model_supply_refusal", "requires_explicit_retry": True,
+ }
asyncio.run(run())
diff --git a/tests/test_codex_request_routing.py b/tests/test_codex_request_routing.py
index 133fb1958..d8e24b3aa 100644
--- a/tests/test_codex_request_routing.py
+++ b/tests/test_codex_request_routing.py
@@ -345,7 +345,7 @@ async def test_codex_turn_on_an_unlisted_model_fails_once_with_the_shared_copy(t
controller.agent_auth_service = SimpleNamespace(
maybe_emit_auth_recovery_message=AsyncMock(return_value=True),
)
- context = SimpleNamespace(platform_specific={})
+ context = SimpleNamespace(platform="avibe", platform_specific={})
set_dispatch_phase(context, DISPATCH_PHASE_PREWRITE)
request = SimpleNamespace(
base_session_id="session-1", working_path=str(tmp_path),
@@ -370,6 +370,8 @@ async def test_codex_turn_on_an_unlisted_model_fails_once_with_the_shared_copy(t
controller.agent_auth_service.maybe_emit_auth_recovery_message.assert_not_awaited()
notify = controller.emit_agent_message.await_args_list[0]
assert notify.args[1:3] == ("notify", f"❌ {unlisted_model_copy('codex', language)}")
+ # The list is kept in Models: the Workbench draws the way there from the notice's data.
+ assert notify.kwargs["output"].metadata["failure_next_step"] == "models"
assert prewrite_failure_evidence(context) == {
"reason": "model_hub_model_unlisted", "requires_explicit_retry": True,
}
diff --git a/tests/test_message_handler_typing.py b/tests/test_message_handler_typing.py
index 2eafc2a14..d963eaac9 100644
--- a/tests/test_message_handler_typing.py
+++ b/tests/test_message_handler_typing.py
@@ -114,7 +114,11 @@ class _StubIMClient:
self.reactions = []
self.sent_messages = []
self.removed_keyboards = []
- self.formatter = type("Formatter", (), {"format_error": staticmethod(lambda text: text)})()
+ self.formatter = type(
+ "Formatter",
+ (),
+ {"format_error": staticmethod(lambda text: text), "escape_special_chars": staticmethod(lambda text: text)},
+ )()
def should_use_thread_for_reply(self):
return False
@@ -639,7 +643,7 @@ class MessageHandlerTypingTests(unittest.IsolatedAsyncioTestCase):
notify_call, call = controller.emit_agent_message.await_args_list
self.assertEqual(
notify_call.args[:3],
- (context, "notify", "Error: context preparation failed"),
+ (context, "notify", "❌ Error: context preparation failed"),
)
self.assertEqual(call.args[:3], (context, "result", ""))
output = call.kwargs["output"]
@@ -987,7 +991,7 @@ class MessageHandlerTypingTests(unittest.IsolatedAsyncioTestCase):
self.assertEqual(controller.im_client.clear_calls, [("wx-chat", "wx-user")])
self.assertFalse(captured_requests[0].typing_indicator_active)
self.assertIsNone(captured_requests[0].typing_indicator_task)
- self.assertEqual(controller.im_client.sent_messages, [("wx-chat", "Error: agent failed")])
+ self.assertEqual(controller.im_client.sent_messages, [("wx-chat", "❌ Error: agent failed")])
def _capture_typing_tasks(self, controller):
tasks = []
@@ -1791,10 +1795,10 @@ class MessageHandlerTypingTests(unittest.IsolatedAsyncioTestCase):
result = await handler.handle_scheduled_message(context, "hello")
self.assertEqual(result, "boom")
- self.assertEqual(controller.im_client.sent_messages, [("C1", "Error: boom")])
+ self.assertEqual(controller.im_client.sent_messages, [("C1", "❌ Error: boom")])
self.assertEqual(controller.emit_agent_message.await_count, 2)
notify_call, _terminal_call = controller.emit_agent_message.await_args_list
- self.assertEqual(notify_call.args[:3], (context, "notify", "Error: boom"))
+ self.assertEqual(notify_call.args[:3], (context, "notify", "❌ Error: boom"))
terminal_output = controller.emit_agent_message.await_args.kwargs["output"]
self.assertEqual(
terminal_output.metadata["turn_failure_notification"],
@@ -1842,7 +1846,7 @@ class MessageHandlerTypingTests(unittest.IsolatedAsyncioTestCase):
result = await handler.handle_scheduled_message(context, "hello")
self.assertEqual(result, "'backend config'")
- self.assertEqual(controller.im_client.sent_messages, [("C1", "Error: 'backend config'")])
+ self.assertEqual(controller.im_client.sent_messages, [("C1", "❌ Error: 'backend config'")])
self.assertEqual(controller.emit_agent_message.await_count, 2)
self.assertNotIn("not available", controller.im_client.sent_messages[0][1])
@@ -1981,5 +1985,45 @@ class MessageHandlerTypingTests(unittest.IsolatedAsyncioTestCase):
await handler._remove_ack_reaction(context, request)
+ async def test_a_dispatch_failure_notice_is_plain_and_a_supply_refusal_is_its_own_copy(self):
+ """The Workbench draws notices as plain text, so no formatter markup or escape reaches one.
+
+ The primary IM platform's formatter is not the Workbench's: its ``*Error*`` showed
+ literally there. An IM sends the notice as its own markup, so the raw error is escaped
+ there, or a ``<@U1>`` in it would mention someone. A supply refusal is already the
+ user's copy, so it is not wrapped in a second "Error:".
+ """
+ from modules.agents.model_hub import ModelSupplyRefusal
+
+ controller = _StubController(platform="slack", ack_mode="reaction", typing_result=True)
+ controller.im_client.formatter = type(
+ "SlackFormatter",
+ (),
+ {
+ "format_error": staticmethod(lambda text: f"❌ *Error*: {text}"),
+ "escape_special_chars": staticmethod(lambda text: text.replace("<", "&lt;").replace(">", "&gt;")),
+ },
+ )()
+ handler = MessageHandler(controller)
+ workbench = MessageContext(user_id="u1", channel_id="ses-1", platform="avibe")
+ slack = MessageContext(user_id="u1", channel_id="C1", platform="slack")
+ refusal = ModelSupplyRefusal("Vibey has no model source yet.", fixed_in_models=True)
+
+ emitted = AsyncMock()
+ # This suite loads the handler module on its own, so patch the globals it actually reads.
+ with patch.dict(MessageHandler._emit_agent_dispatch_failure.__globals__, emit_backend_failure=emitted):
+ await handler._emit_agent_dispatch_failure(workbench, None, refusal)
+ await handler._emit_agent_dispatch_failure(workbench, None, RuntimeError("<@U1> socket closed"))
+ await handler._emit_agent_dispatch_failure(slack, None, RuntimeError("<@U1> socket closed"))
+
+ texts = [call.kwargs["display_text"] for call in emitted.await_args_list]
+ assert texts == [
+ "❌ Vibey has no model source yet.",
+ f"❌ {handler._t('error.processMessageFailed', error='<@U1> socket closed')}",
+ f"❌ {handler._t('error.processMessageFailed', error='&lt;@U1&gt; socket closed')}",
+ ]
+ assert [call.kwargs["cause"] for call in emitted.await_args_list][0] is refusal
+
+
if __name__ == "__main__":
unittest.main()
diff --git a/tests/test_model_hub_failure_presentation.py b/tests/test_model_hub_failure_presentation.py
index be44b6522..9b223c108 100644
--- a/tests/test_model_hub_failure_presentation.py
+++ b/tests/test_model_hub_failure_presentation.py
@@ -396,32 +396,35 @@ def _next_step_controller(language: str, *, public_url: str | None):
)
-def _remote_workbench_context(role: str) -> MessageContext:
- snapshot = {"sub": "member-1", "vibe_instance_role": role, "vibe_instance_access_source": "email"}
- return MessageContext(
- user_id="remote:member-1", channel_id="proj-1", platform="avibe",
- platform_specific={"agent_session_id": "ses-1", "message_metadata": {"resource_user_context": snapshot}},
- )
+_WORKBENCH = MessageContext(user_id="local", channel_id="proj-1", platform="avibe", platform_specific={})
+_IM = MessageContext(user_id="U1", channel_id="C1", platform="slack", platform_specific={})
+# A scheduled or Harness Turn in a Workbench Session whose notices go to an IM channel.
+_ROUTED_TO_IM = MessageContext(
+ user_id="local", channel_id="proj-1", platform="avibe",
+ platform_specific={"delivery_override": {"platform": "slack", "channel_id": "C1"}},
+)
-_LOCAL_WORKBENCH = MessageContext(user_id="local", channel_id="proj-1", platform="avibe", platform_specific={})
-_IM = MessageContext(user_id="U1", channel_id="C1", platform="slack", platform_specific={})
+def _notice(controller):
+ """The visible text and metadata of the notice a failure emitted."""
+ notify = controller.emit_agent_message.await_args_list[0]
+ return notify.args[2], notify.kwargs["output"].metadata
@pytest.mark.parametrize("language", ["en", "zh"])
@pytest.mark.parametrize(
- ("context", "public_url", "key", "url"),
+ ("context", "public_url", "line_key", "url"),
[
- # The Workbench knows its requester: it links to Models only for one who can open it.
- (_LOCAL_WORKBENCH, None, "errors.openModelsLink", "/settings/models"),
- (_remote_workbench_context("member"), None, "errors.openModelsLink", "/settings/models"),
- (_remote_workbench_context("editor"), None, "errors.askAdminForModels", None),
+ # The Workbench draws notices as plain text: the step rides as data, and the body stays the refusal.
+ (_WORKBENCH, "https://team.avibe.bot", None, None),
# No IM identity maps to a Workbench principal: IM says who can fix it, with the public URL when there is one.
(_IM, "https://team.avibe.bot", "errors.modelsNextStepImUrl", "https://team.avibe.bot/settings/models"),
(_IM, None, "errors.modelsNextStepIm", None),
+ # The form follows where the notice goes, not the Session it came from.
+ (_ROUTED_TO_IM, "https://team.avibe.bot", "errors.modelsNextStepImUrl", "https://team.avibe.bot/settings/models"),
],
)
-async def test_a_refusal_fixed_in_models_ends_with_where_to_fix_it(language, context, public_url, key, url):
+async def test_a_refusal_fixed_in_models_ends_with_where_to_fix_it(language, context, public_url, line_key, url):
from modules.agents.model_hub import ModelSupplyRefusal
controller = _next_step_controller(language, public_url=public_url)
@@ -429,10 +432,16 @@ async def test_a_refusal_fixed_in_models_ends_with_where_to_fix_it(language, con
await emit_backend_failure(controller, context, "vibey", str(refusal), display_text=f"❌ {refusal}", cause=refusal)
- next_step = t(key, language, url=url) if url else t(key, language)
- assert controller.emit_agent_message.await_args_list[0].args[2] == f"❌ {refusal}\n{next_step}"
+ text, metadata = _notice(controller)
+ if line_key is None:
+ assert (text, metadata.get("failure_next_step")) == (f"❌ {refusal}", "models")
+ assert "](" not in text
+ else:
+ line = t(line_key, language, url=url) if url else t(line_key, language)
+ assert (text, metadata.get("failure_next_step")) == (f"❌ {refusal}\n{line}", None)
[email protected]("context", [_WORKBENCH, _IM])
@pytest.mark.parametrize(
"cause",
[
@@ -442,7 +451,7 @@ async def test_a_refusal_fixed_in_models_ends_with_where_to_fix_it(language, con
"native",
],
)
-async def test_a_failure_models_cannot_fix_gets_no_next_step(cause):
+async def test_a_failure_models_cannot_fix_gets_no_next_step(context, cause):
from modules.agents.model_hub import ModelSupplyRefusal
controller = _next_step_controller("en", public_url="https://team.avibe.bot")
@@ -451,23 +460,40 @@ async def test_a_failure_models_cannot_fix_gets_no_next_step(cause):
if cause == "hub_disabled" else RuntimeError("process exited")
)
- await emit_backend_failure(controller, _LOCAL_WORKBENCH, "vibey", str(error), display_text=f"❌ {error}", cause=error)
+ await emit_backend_failure(controller, context, "vibey", str(error), display_text=f"❌ {error}", cause=error)
+
+ text, metadata = _notice(controller)
+ assert (text, metadata.get("failure_next_step")) == (f"❌ {error}", None)
+
+
[email protected]("context", [_WORKBENCH, _IM])
+async def test_a_restart_replaces_the_refusal_and_its_next_step(context):
+ from modules.agents.model_hub import ModelSupplyRefusal
+
+ controller = _next_step_controller("en", public_url="https://team.avibe.bot")
+ controller.shutdown_requested = True
+ refusal = ModelSupplyRefusal("Vibey has no model source yet.", fixed_in_models=True)
+
+ await emit_backend_failure(controller, context, "vibey", str(refusal), display_text=f"❌ {refusal}", cause=refusal)
- assert controller.emit_agent_message.await_args_list[0].args[2] == f"❌ {error}"
+ text, metadata = _notice(controller)
+ assert (text, metadata.get("failure_next_step")) == (t("turn.interrupted.serviceRestart", "en"), None)
@pytest.mark.parametrize(
- ("discriminator", "supply_state", "linked"),
+ ("discriminator", "supply_state", "pointed"),
[
- # Copy that already sends its reader to Models ends with the way there...
+ # Copy whose fix is in Models carries the way there: it sends the reader there, or names a model
+ # list Models keeps, as when a person removed the Agent's model, even the list's last one...
("route_unconfigured", "interrupted", True),
("blocked_supply_state", "interrupted", True),
+ ("model_unlisted", "interrupted", True),
# ...and copy that does not, such as a source still cooling down, does not.
("blocked_supply_state", "waiting", False),
],
)
-async def test_a_route_refusal_links_models_only_when_its_copy_sends_the_reader_there(
- discriminator, supply_state, linked,
+async def test_a_route_refusal_points_to_models_only_when_its_copy_sends_the_reader_there(
+ discriminator, supply_state, pointed,
):
from core.handlers.model_hub.service import ModelHubError
@@ -483,7 +509,7 @@ async def test_a_route_refusal_links_models_only_when_its_copy_sends_the_reader_
controller = _next_step_controller("en", public_url=None)
copy = render_turn_outcome_copy(outcome, "en")
- await emit_backend_failure(controller, _LOCAL_WORKBENCH, "claude", str(refused), display_text=copy, cause=refused)
+ await emit_backend_failure(controller, _WORKBENCH, "claude", str(refused), display_text=copy, cause=refused)
- link = t("errors.openModelsLink", "en", url="/settings/models")
- assert controller.emit_agent_message.await_args_list[0].args[2] == (f"{copy}\n{link}" if linked else copy)
+ text, metadata = _notice(controller)
+ assert (text, metadata.get("failure_next_step")) == (copy, "models" if pointed else None)
diff --git a/tests/test_multi_platform_runtime.py b/tests/test_multi_platform_runtime.py
index 31ce9af56..763b081e5 100644
--- a/tests/test_multi_platform_runtime.py
+++ b/tests/test_multi_platform_runtime.py
@@ -26,7 +26,7 @@ from core.native_dispatch_phase import (
from core.processing_indicator import ProcessingIndicatorService
from core.resource_governance import AgentResourceFailure
from modules.agents.base import AgentRequest
-from modules.agents.model_hub import OpenCodeOverlay, launch_for_context
+from modules.agents.model_hub import OpenCodeOverlay, launch_for_context, models_next_step_text
from modules.agents.service import AgentService
from modules.agents.opencode.agent import OpenCodeAgent
from modules.agents.opencode.server import (
@@ -248,7 +248,8 @@ def test_opencode_turn_on_an_unlisted_model_fails_once_with_the_shared_copy(
controller.agent_auth_service.maybe_emit_auth_recovery_message.assert_not_awaited()
notices = [call.args[2] for call in controller.emit_agent_message.await_args_list if call.args[1] == "notify"]
- assert notices == [f"❌ {unlisted_model_copy('opencode', language)}"]
+ # The list is kept in Models, so IM ends the refusal with where to fix it.
+ assert notices == [f"❌ {unlisted_model_copy('opencode', language)}\n{models_next_step_text(controller)}"]
assert prewrite_failure_evidence(context) == {
"reason": "model_hub_model_unlisted", "requires_explicit_retry": True,
}
diff --git a/tests/test_session_delivery_fsm.py b/tests/test_session_delivery_fsm.py
index 91a1efc69..e9ad20dcf 100644
--- a/tests/test_session_delivery_fsm.py
+++ b/tests/test_session_delivery_fsm.py
@@ -5226,6 +5226,31 @@ async def test_concurrent_start_refusal_does_not_spend_or_reset_prewrite_budget(
assert delivery_store.requires_explicit_start_retry(retained)
+async def test_a_held_input_does_not_block_a_new_message(managers):
+ """MESSAGE-DELIVERY-031: a hold keeps its input for an explicit retry; an IM person, who
+ has no Retry control, still gets a new message through."""
+ manager, restarted, engine, _other, starts = managers
+ held = await manager.deliver(
+ DeliveryRequest(session_id="ses_fsm", priority="p1", content="first"), context=_context(),
+ )
+ manager._settle_durable_prewrite_failure(
+ starts[-1][0], outcome=SETTLED_BY_NO_TERMINAL_RESULT,
+ failure_evidence={"reason": "model_supply_refusal", "requires_explicit_retry": True},
+ )
+ await restarted.recover_durable_delivery_state("ses_fsm")
+ assert delivery_store.requires_explicit_start_retry(_row(engine, held.delivery_id))
+ count = len(starts)
+
+ follow_up = await manager.deliver(
+ DeliveryRequest(session_id="ses_fsm", priority="p1", content="second"), context=_context(),
+ )
+
+ assert follow_up.state == "claimed"
+ assert [text for _, text in starts[count:]] == ["second"]
+ assert delivery_store.requires_explicit_start_retry(_row(engine, held.delivery_id))
+
+
@pytest.mark.anyio
async def test_prewrite_batched_retry_budget_is_per_input(managers):
manager, restarted, engine, _other, starts = managers
diff --git a/tests/test_vibey_agent.py b/tests/test_vibey_agent.py
index b5b93ce89..6eb49aaa7 100644
--- a/tests/test_vibey_agent.py
+++ b/tests/test_vibey_agent.py
@@ -1455,6 +1455,10 @@ async def test_a_refused_model_route_fails_before_the_input_is_written(
hub.enabled = gateway_enabled
harness.controller.model_hub_service = SimpleNamespace(store=SimpleNamespace(load=lambda: hub))
request = harness.request("hello")
+ # The shared turn pipeline opens every Turn in the prewrite phase (MessageHandler._handle_turn).
+ from core.native_dispatch_phase import DISPATCH_PHASE_PREWRITE, set_dispatch_phase
+
+ set_dispatch_phase(request.context, DISPATCH_PHASE_PREWRITE)
await harness.agent.handle_message(request)
assert harness.controller.started == []
@@ -1473,6 +1477,11 @@ async def test_a_refused_model_route_fails_before_the_input_is_written(
expected = "Vibey's run failed."
assert harness.controller.im_client.sent == [f"❌ {expected}"]
assert [terminal["is_error"] for terminal in harness.controller.terminals] == [True]
+ # A supply refusal holds its input for an explicit retry; an unclassified failure keeps the automatic ones.
+ from core.native_dispatch_phase import prewrite_failure_evidence
+
+ held = prewrite_failure_evidence(request.context).get("requires_explicit_retry") is True
+ assert held is (hub_switch == "0" or not gateway_enabled or not has_source)
# --- settlement and run shape -----------------------------------------------------------
diff --git a/ui/src/components/workbench/ChatPage.tsx b/ui/src/components/workbench/ChatPage.tsx
index f07b9c1de..8d63641c0 100644
--- a/ui/src/components/workbench/ChatPage.tsx
+++ b/ui/src/components/workbench/ChatPage.tsx
@@ -65,6 +65,7 @@ import {
import { AnnotationMessage } from './AnnotationMessage';
import { FailureDetails } from './FailureDetails';
import { FailureRetry } from './FailureRetry';
+import { FailureNextStep } from './FailureNextStep';
import { AGENT_BUBBLE, SYSTEM_BUBBLE, USER_BUBBLE } from './chatBubble';
import { RoleAvatar } from './RoleAvatar';
import { SenderHead } from './SenderHead';
@@ -4926,14 +4927,17 @@ export const MessageRow = memo(function MessageRow({
<FailureDetails message={message} />
</span>
</div>
- {onFailureRetry && (
- <FailureRetry
- message={message}
- readOnly={readOnly}
- disabled={retryDisabled}
- onRetry={onFailureRetry}
- />
- )}
+ <div className="flex flex-wrap items-center gap-1.5 empty:hidden">
+ <FailureNextStep message={message} />
+ {onFailureRetry && (
+ <FailureRetry
+ message={message}
+ readOnly={readOnly}
+ disabled={retryDisabled}
+ onRetry={onFailureRetry}
+ />
+ )}
+ </div>
{time}
</div>
</div>
diff --git a/ui/src/components/workbench/FailureNextStep.test.tsx b/ui/src/components/workbench/FailureNextStep.test.tsx
new file mode 100644
index 000000000..cd758998c
--- /dev/null
+++ b/ui/src/components/workbench/FailureNextStep.test.tsx
@@ -0,0 +1,63 @@
+/** @vitest-environment jsdom */
+import { cleanup, fireEvent, render, screen } from '@testing-library/react';
+import { afterEach, describe, expect, it } from 'vitest';
+import { createInstance } from 'i18next';
+import { I18nextProvider, initReactI18next } from 'react-i18next';
+import { MemoryRouter, Route, Routes } from 'react-router-dom';
+
+import type { WorkbenchMessage } from '../../context/ApiContext';
+import { InstanceAuthorizationContext } from '../../context/InstanceAuthorizationContext';
+import { DENIED_INSTANCE_CAPABILITIES } from '../../lib/sessionInfo';
+import en from '../../i18n/en.json';
+import { FailureNextStep } from './FailureNextStep';
+
+const i18n = createInstance();
+void i18n.use(initReactI18next).init({
+ lng: 'en', resources: { en: { translation: en } }, interpolation: { escapeValue: false },
+});
+// The body is the server's plain text; the step rides as data beside it.
+const refusal = {
+ id: 'notice', session_id: 'session', type: 'notify', author: 'agent', source: 'agent',
+ text: '❌ Vibey has no model source yet. Add an API key or a subscription in Models.', content: {},
+ metadata: { event: 'backend_failure', failure_id: 'failed', turn_id: 'turn-1', failure_next_step: 'models' },
+} as WorkbenchMessage;
+
+function mount(message: WorkbenchMessage, canManage: boolean) {
+ const authorization = {
+ remote: true, instanceKind: null, instanceRole: null,
+ capabilities: { ...DENIED_INSTANCE_CAPABILITIES, can_chat: true, can_manage_instance: canManage },
+ };
+ return render(
+ <I18nextProvider i18n={i18n}>
+ <InstanceAuthorizationContext.Provider value={authorization as never}>
+ <MemoryRouter initialEntries={['/chat/session']}>
+ <Routes>
+ <Route path="/chat/session" element={<FailureNextStep message={message} />} />
+ <Route path="/settings/models" element={<p>Models page</p>} />
+ </Routes>
+ </MemoryRouter>
+ </InstanceAuthorizationContext.Provider>
+ </I18nextProvider>,
+ );
+}
+
+afterEach(cleanup);
+
+describe('FailureNextStep', () => {
+ it('opens Models for a caller who manages the instance', () => {
+ mount(refusal, true);
+ fireEvent.click(screen.getByRole('button', { name: 'Open Models' }));
+ expect(screen.getByText('Models page')).toBeTruthy();
+ });
+
+ it('tells anyone else who can fix it, with no link', () => {
+ mount(refusal, false);
+ expect(screen.getByText('Ask an Avibe admin to fix this in Models.')).toBeTruthy();
+ expect(screen.queryByRole('button')).toBeNull();
+ });
+
+ it('draws nothing for a notice without the step', () => {
+ const { container } = mount({ ...refusal, metadata: { ...refusal.metadata, failure_next_step: undefined } }, true);
+ expect(container.textContent).toBe('');
+ });
+});
diff --git a/ui/src/components/workbench/FailureNextStep.tsx b/ui/src/components/workbench/FailureNextStep.tsx
new file mode 100644
index 000000000..3edd55f16
--- /dev/null
+++ b/ui/src/components/workbench/FailureNextStep.tsx
@@ -0,0 +1,36 @@
+import { ArrowRight } from 'lucide-react';
+import { useTranslation } from 'react-i18next';
+import { useLocation, useNavigate } from 'react-router-dom';
+
+import type { WorkbenchMessage } from '../../context/ApiContext';
+import { useInstanceAuthorization } from '../../context/InstanceAuthorizationContext';
+import { isBackendFailureNotice } from '../../lib/chatMessageTypes';
+import { settingsOverlayContinuationState } from '../../lib/settingsOverlay';
+import { MODEL_HUB_SETTINGS_PATH } from '../settings/models/modelHubRoutes';
+import { Button } from '../ui/button';
+
+/** The step a failure notice names as data (`failure_next_step`), drawn from the Workbench's
+ * own copy: a notice is plain text, so any link in it comes from here, never from its body.
+ * Models is for those who manage the instance; anyone else is told who can fix it. Opening Models
+ * writes nothing to the Session, so a read-only transcript shows the step too. */
+export function FailureNextStep({ message }: { message: WorkbenchMessage }) {
+ const { t } = useTranslation();
+ const navigate = useNavigate();
+ const location = useLocation();
+ const { capabilities } = useInstanceAuthorization();
+ if (!isBackendFailureNotice(message) || message.metadata?.failure_next_step !== 'models') return null;
+ if (!capabilities.can_manage_instance) {
+ return <span className="px-0.5 text-[11px] text-muted-foreground">{t('chat.failureNextStep.askAdmin')}</span>;
+ }
+ return (
+ <Button
+ type="button"
+ size="2xs"
+ variant="secondary"
+ onClick={() => navigate(MODEL_HUB_SETTINGS_PATH, { state: settingsOverlayContinuationState(location) })}
+ >
+ {t('chat.failureNextStep.openModels')}
+ <ArrowRight />
+ </Button>
+ );
+}
diff --git a/ui/src/i18n/en.json b/ui/src/i18n/en.json
index 0eb9e15a8..e2e643cbc 100644
--- a/ui/src/i18n/en.json
+++ b/ui/src/i18n/en.json
@@ -4634,6 +4634,10 @@
},
"notifyLabel": "Notify",
"retryRequested": "Retry requested",
+ "failureNextStep": {
+ "openModels": "Open Models",
+ "askAdmin": "Ask an Avibe admin to fix this in Models."
+ },
"retryFailed": "Could not request retry. You can try again safely.",
"collapse": "Collapse",
"turnInProgress": "A turn is already running — wait for the reply.",
diff --git a/ui/src/i18n/zh.json b/ui/src/i18n/zh.json
index 2232fa589..3034433bb 100644
--- a/ui/src/i18n/zh.json
+++ b/ui/src/i18n/zh.json
@@ -4634,6 +4634,10 @@
},
"notifyLabel": "通知",
"retryRequested": "已请求重试",
+ "failureNextStep": {
+ "openModels": "打开「模型」页",
+ "askAdmin": "请联系 Avibe 管理员在「模型」页处理。"
+ },
"retryFailed": "未能提交重试,可以再次点击。",
"collapse": "收起",
"turnInProgress": "当前回合还在进行中,请等待回复后再发送。",
diff --git a/vibe/i18n/en.json b/vibe/i18n/en.json
index 75e20b850..b10cc4f8f 100644
--- a/vibe/i18n/en.json
+++ b/vibe/i18n/en.json
@@ -11,8 +11,6 @@
"modelSourceRequired": "{backend} has no model source yet. Add an API key or a subscription in Models.",
"modelsNextStepImUrl": "Someone who manages this Avibe can fix it in Models: {url}",
"modelsNextStepIm": "Someone who manages this Avibe can fix it in Models, in the Avibe Workbench.",
- "openModelsLink": "[Open Models]({url})",
- "askAdminForModels": "Ask an Avibe admin to fix this in Models.",
"opencodeModelProviderRequired": "Select an OpenCode model with a provider in Avibe, or configure its Model Hub route."
},
"status": {
diff --git a/vibe/i18n/zh.json b/vibe/i18n/zh.json
index 2e185ddac..b9508dfb1 100644
--- a/vibe/i18n/zh.json
+++ b/vibe/i18n/zh.json
@@ -11,8 +11,6 @@
"modelSourceRequired": "{backend} 还没有模型来源。请在「模型」页添加 API Key 或订阅。",
"modelsNextStepImUrl": "管理这个 Avibe 的人可以在「模型」页处理:{url}",
"modelsNextStepIm": "管理这个 Avibe 的人可以在 Avibe 工作台的「模型」页处理。",
- "openModelsLink": "[打开「模型」页]({url})",
- "askAdminForModels": "请联系 Avibe 管理员在「模型」页处理。",
"opencodeModelProviderRequired": "请在 Avibe 中选择带供应商的 OpenCode 模型,或配置它的 Model Hub 路由。"
},
"status": {