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.

chore(merge): sync origin/master into avibe-agent

cyh86abbfd3989c
diff --cc core/agent_auth_service.py
index 4d7e29343,5a96db257..5b2603eb7
--- a/core/agent_auth_service.py
+++ b/core/agent_auth_service.py
@@@ -16,8 -16,7 +16,8 @@@ import uui
from collections.abc import Mapping
from dataclasses import dataclass, field
from datetime import datetime, timedelta, timezone
- from typing import Any, Callable, Coroutine, Optional
+ from typing import TYPE_CHECKING, Any, Callable, Coroutine, Optional
+from modules.agents.catalog import AGENT_BACKENDS, NATIVE_CLI_BACKENDS
from core.backend_failure import terminal_backend_failure_output
from core.backend_restart import NativeCredentialLease, NativeMigrationBlockedError, finish_native_operation
@@@ -2319,21 -2400,41 +2409,57 @@@ class AgentAuthService
logger.info("Registered %s backend after runtime config refresh", backend)
return True
+ async def _recover_after_live_registration(self, backend: str) -> None:
+ """A backend registered after startup: its recovery owner hands over to the registered adapter.
+
+ For ``avibe`` the controller's single ``AvibeRecovery`` retires any pending retry
+ (an unregistered adapter's) and runs the next pass on the registered adapter, so
+ two adapters never settle the same Session at once.
+ """
+ recovery = getattr(self.controller, "avibe_recovery", None) if backend == "avibe" else None
+ if recovery is None:
+ return
+ try:
+ await recovery.start()
+ except Exception:
+ logger.exception("Failed to recover %s runtime state after live registration", backend)
+
+ async def renew_backend_runtime(self, backend: str, config_save: bool = False) -> None:
+ """Apply persisted runtime config.
+
+ An enabled backend renews in place without waiting for or interrupting
+ work, so each runtime unit moves at its next turn, and a newly enabled
+ backend registers at once. Disabling is the one exception: the user
+ turned the backend off, so its work stops now.
+ """
+ runtime_config = self._load_backend_runtime_config(backend)
+ if runtime_config is None:
+ await self._stop_disabled_backend(backend, unregister=True)
+ return
+ if getattr(runtime_config, "enabled", True) is not False:
+ # A disable's pending retry must not interrupt work admitted from now on.
+ self._enablements[backend] = self._enablements.get(backend, 0) + 1
+ if getattr(runtime_config, "enabled", True) is not False and self._register_missing_backend_agent(
+ backend, runtime_config
+ ):
+ if backend == "opencode":
+ await self._restore_polls_after_enable()
++ await self._recover_after_live_registration(backend)
+ return
+ agent_service = getattr(self.controller, "agent_service", None)
+ agent = getattr(agent_service, "agents", {}).get(backend) if agent_service else None
+ # Claude stays registered while disabled; disabling it stops its work.
+ newly_disabled = getattr(runtime_config, "enabled", True) is False and (
+ getattr(getattr(self.controller.config, backend, None), "enabled", True) is not False
+ )
+ renew = getattr(agent, "renew_runtime", None)
+ if callable(renew):
+ await renew(runtime_config, config_save=config_save)
+ if newly_disabled:
+ await self._stop_disabled_backend(backend, unregister=False)
+ return
+ self._sync_builtin_default_agents()
+
async def _refresh_backend_runtime(self, backend: str) -> None:
coordinator = getattr(self.controller, "backend_restart_coordinator", None)
if coordinator is not None:
diff --cc core/controller.py
index 3e463283f,d7463fbf6..61b60d568
--- a/core/controller.py
+++ b/core/controller.py
@@@ -1013,22 -1010,26 +1023,35 @@@ class Controller
return
opencode_agent = self.agent_service.agents.get("opencode")
if opencode_agent and hasattr(opencode_agent, "restore_active_polls"):
- try:
- restored = await opencode_agent.restore_active_polls(platforms) # type: ignore[attr-defined]
- if restored > 0:
- logger.info(f"Restored {restored} active OpenCode poll(s)")
- except Exception as e:
- logger.error(f"Failed to restore active polls: {e}", exc_info=True)
+ restored = await opencode_agent.restore_active_polls(platforms) # type: ignore[attr-defined]
+ if restored > 0:
+ logger.info(f"Restored {restored} active OpenCode poll(s)")
+
+ async def restore_polls_on_ready_transports(self) -> None:
+ """Restore durable OpenCode polls on every transport that can deliver now.
+
+ IM-ready events restore polls at startup. OpenCode enabled in a running
+ controller missed them, so this runs once it registers. Raises when the
+ restore fails, so its caller can retry it; a restore skips every poll
+ already running, so a retry is safe.
+ """
+ platforms = {"avibe"}
+ for platform in list(getattr(self, "im_clients", {}) or {}):
+ if self.is_im_transport_ready(platform):
+ platforms.add(platform)
+ if self.primary_platform in platforms:
+ platforms.add("")
+ await self._restore_active_polls_or_raise(platforms)
+ async def _recover_avibe_agent_runtime_state(self) -> None:
+ """Settle what the previous process left of the Avibe Agent's work (T2, T3 admission, J5).
+
+ Not gated on ``agents.avibe.enabled``: a foreground job the previous process left
+ running must be handed to its Watch even when the backend admits no new Turns.
+ ``avibe_recovery`` is the single owner, retrying until every Session has settled.
+ """
+ await self.avibe_recovery.start()
+
async def _on_im_ready(self, *, platform: str) -> None:
"""Restore transport-owned state only after that transport can deliver."""
logger.info("IM transport ready, restoring state for %s", platform)
diff --cc core/handlers/model_hub/provenance.py
index 9c5ae98c3,a7c736624..0f1e4bdc1
--- a/core/handlers/model_hub/provenance.py
+++ b/core/handlers/model_hub/provenance.py
@@@ -46,38 -47,11 +47,43 @@@ SupplyState = Literal["waiting", "inter
ScopeKey = tuple[BackendName, str]
logger = logging.getLogger(__name__)
+SERVED_HOP_HEADER = "x-avibe-served-hop"
+SERVED_HOP_HEADER_MAX_BYTES = 4096
+
+
+class ServedHopHeaderTooLarge(ValueError):
+ """The exact origin cannot be transported in the bounded consumer header."""
+
+
+class PreparedGatewayRouteConflict(ValueError):
+ """An Avibe launch would replace another request's still-owned route."""
+
+
+@dataclass(frozen=True)
+class HopOrigin:
+ """Source identity captured at admission, before mutable config can change."""
+
+ provider: str
+ api: str
+ model: str
+
+ def payload(self) -> dict[str, str]:
+ return {"provider": self.provider, "api": self.api, "model": self.model}
+
+ def response_headers(self) -> dict[str, str]:
+ # JSON escapes keep arbitrary Unicode model ids safe in HTTP headers.
+ value = json.dumps(self.payload(), ensure_ascii=True, separators=(",", ":"))
+ # ensure_ascii makes character count equal to wire byte count.
+ if len(value) > SERVED_HOP_HEADER_MAX_BYTES:
+ raise ServedHopHeaderTooLarge("Served-hop header exceeds its transport bound")
+ return {SERVED_HOP_HEADER: value}
+
+
+ # The user ended the turn: a Stop, or turning its backend off. Its outcome is
+ # canceled, never a provider stream failure.
+ _USER_CANCELLATIONS = frozenset({SETTLED_BY_STOPPED, SETTLED_BY_BACKEND_DISABLED})
+
+
@dataclass(frozen=True)
class AttemptIdentity:
source_id: str
diff --cc core/handlers/model_hub/service.py
index 57df1a465,a337905e8..9636c98f7
--- a/core/handlers/model_hub/service.py
+++ b/core/handlers/model_hub/service.py
@@@ -5120,37 -5071,28 +5120,28 @@@ class ModelHubService
)
async def set_agent_mode(self, backend: str, mode: object) -> dict:
- if mode not in {"hub", "direct"}:
+ if mode not in {"hub", "direct"} or (backend == "avibe" and mode != "hub"):
raise ModelHubError("mode_switch_blocked")
- from core.backend_restart import NativeMigrationBlockedError
- # Either direction serializes with takeover and retires the managed
- # runtime under the shared guard, which interrupts running work: a
- # turn left running would keep using the mode it started in, and the
- # Hub refuses a backend that has left it. Mode-only consent never
+ # A mode is a launch input like any other: running work finishes in the
+ # mode it started in, and each runtime moves at its next turn, so the
+ # switch interrupts nothing. The gateway keeps serving a Hub turn that
+ # was admitted before a switch to Direct. Mode-only consent never
# imports a login: native auth stays native beside the Hub, where the
# migration dialog can still take it over later.
+ name = cast(BackendName, backend)
async with self._migration_lock:
async with self._mutation_lock:
- current = self.store.load()
- agent = self._agent(current, backend)
+ previous = self.store.load()
+ agent = self._agent(previous, backend)
if agent.mode == mode:
- return self._agent_payload(current, agent)
- if mode == "hub":
- # Refuse a switch that would be refused anyway before the
- # guard destroys any work.
+ # A committed switch is applied only once the runtime has
+ # adopted it; a retry of the same mode finishes that.
+ if name not in self._pending_builtin_catalog_refresh:
+ return self._agent_payload(previous, agent)
+ committed = previous
+ else:
try:
- blocked = await self._native_config_blocks_launch(current, backend)
- except (TakeoverStateError, OSError):
- raise ModelHubError("mode_switch_blocked", status=409) from None
- if blocked:
- raise ModelHubError("mode_switch_blocked", status=409)
- try:
- async with self.migration_guard((backend,), external_processes=False) as verify_idle:
- async with self._mutation_lock:
- # Recheck idleness after the last asynchronous drain.
- await verify_idle()
- previous = self.store.load()
if mode == "hub" and await self._native_config_blocks_launch(previous, backend):
raise ModelHubError("mode_switch_blocked", status=409)
config = self._clone_config(previous)
diff --cc core/message_dispatcher.py
index 0cd8a8995,a607bb202..ba9c2ef6f
--- a/core/message_dispatcher.py
+++ b/core/message_dispatcher.py
@@@ -3641,9 -3629,41 +3638,42 @@@ class ConsolidatedMessageDispatcher
canonical_type == "assistant"
and level != "process"
and target_context.platform == "avibe"
- and self._is_interim_worthy(persist_text)
):
- persist_agent_message(target_context, "interim", persist_text, citations=citations)
+ # The bubble is the agent's words like a reply, so it gets the same
+ # button parse, and only the remaining body decides if it is one.
+ interim = process_reply(
+ raw_text,
+ include_quick_replies=getattr(
+ self.controller.config, "reply_enhancements", True
+ ),
+ allow_unseparated_quick_replies=self._supports_quick_replies(
+ target_context
+ ),
+ keep_file_links=True,
+ )
+ if self._is_interim_worthy(interim.text):
+ interim_row = persist_agent_message(
+ target_context,
+ "interim",
+ interim.text,
+ quick_replies=[
+ b.text for b in _written_buttons(interim.buttons, citations)
+ ]
+ or None,
+ citations=citations,
+ )
+ # Persist the intermediate log row BEFORE the mute filter so muted
+ # assistant / tool_call messages still land in the store (product
+ # requirement: the process log is complete even when a channel hides it).
+ # Only a narration whose bubble was stored is left out of Activity.
+ persist_agent_message(
+ target_context,
+ canonical_type,
+ persist_text,
+ citations=citations,
+ metadata={TRANSCRIPT_COPY_KEY: "interim"} if interim_row else None,
++ existing_row_id=existing_row_id,
+ )
# The row above is the only copy of an intermediate message that carries a
# sidecar. Everything left below is what the channel is shown - the concise
diff --cc core/session_turns.py
index 18872b86a,b21c857aa..3da94e552
--- a/core/session_turns.py
+++ b/core/session_turns.py
@@@ -6544,18 -6495,6 +6546,22 @@@ class SessionTurnManager
by anything else.
"""
+ language = self._controller_language()
- text = i18n_t(message_key, language)
++ text = i18n_t(
++ message_key,
++ language,
++ agent=i18n_t(f"backend.{backend}", language) if backend else "",
++ )
+ metadata: dict[str, Any] = {"turn_id": turn_id or None, "replayed": True}
+ watch_ids = self._recovered_watch_ids(session_id, turn_id)
+ handed_over = _HANDED_OVER_NOTICE_KEYS.get(message_key)
+ if watch_ids and handed_over is not None:
+ one, many = handed_over
+ if len(watch_ids) == 1:
+ text = i18n_t(one, language, watch=watch_ids[0])
+ else:
+ text = i18n_t(many, language, watches=", ".join(watch_ids))
+ metadata["watch_ids"] = watch_ids
try:
delivered = await self.controller.emit_agent_message(
context,
diff --cc modules/agents/model_hub.py
index 51e79814d,ae04dd953..a932dd0dc
--- a/modules/agents/model_hub.py
+++ b/modules/agents/model_hub.py
@@@ -980,15 -956,10 +998,16 @@@ class ModelHubRuntimeRouter
*,
process_scope: Optional[str] = None,
turn_id: Optional[str] = None,
+ config: ModelHubConfig | None = None,
) -> ModelHubLaunch:
requested_model = str(requested_model or "").strip()
- config = self.service.store.load()
+ config = config if config is not None else self.service.store.load()
+ if backend == "avibe" and (
+ config.agents[backend].mode != "hub" or self.turn_gateway is None
+ ):
+ # An in-process consumer requires the routing gateway, including
+ # failover and served-hop attribution; the raw engine is not one.
+ raise ModelHubError("mapping_target_unavailable", status=409)
config, resolution = await self._resolve_turn(
config,
backend,
diff --cc tests/test_backend_restart.py
index 6c36f8402,4ea77b9f6..87ad3e3b2
--- a/tests/test_backend_restart.py
+++ b/tests/test_backend_restart.py
@@@ -8,7 -8,7 +8,8 @@@ import pytes
from core.backend_restart import BackendRestartCoordinator, NativeCredentialLease, NativeMigrationBlockedError
from core.controller import Controller
+from modules.agents.catalog import AGENT_BACKENDS
+ from core.run_settlement import SETTLED_BY_BACKEND_DISABLED
class _AgentService:
@@@ -197,104 -130,14 +131,34 @@@ def test_controller_rejects_unknown_bac
controller.backend_restart_coordinator.request_restart.assert_not_awaited()
- def test_application_projection_tracks_prepare_drain_failure_retry_and_registration():
- async def run():
- service = _AgentService()
- service.agents = {"opencode": object(), "claude": object()}
- controller = _controller(service)
- refresh = AsyncMock()
- coordinator = BackendRestartCoordinator(controller, refresh, poll_interval=0.001)
- assert coordinator.snapshot("opencode") == {"state": "applied"}
- assert coordinator.snapshot("codex") == {"state": "unavailable"}
-
- preparing = asyncio.Event()
- release = asyncio.Event()
-
- async def prepare(_backend):
- preparing.set()
- await release.wait()
-
- service.prepare_backend_restart = prepare
- request = asyncio.create_task(coordinator.request_restart("opencode"))
- await preparing.wait()
- assert coordinator.snapshot("opencode") == {"state": "draining"}
- assert coordinator.snapshot("claude") == {"state": "applied"}
- service.active = True
- release.set()
- assert await request == "draining"
- assert coordinator.snapshot("opencode") == {"state": "draining"}
- refresh.side_effect = RuntimeError("application failed")
- service.active = False
- with pytest.raises(RuntimeError, match="application failed"):
- await coordinator.wait("opencode")
- assert coordinator.snapshot("opencode") == {"state": "failed", "error": "application failed"}
- assert coordinator.snapshot("claude") == {"state": "applied"}
-
- refresh.side_effect = None
- assert await coordinator.request_restart("opencode") == "restarted"
- assert coordinator.snapshot("opencode") == {"state": "applied"}
- service.agents.pop("opencode")
- assert coordinator.snapshot("opencode") == {"state": "unavailable"}
-
- asyncio.run(run())
-
-
[email protected]("backend", [backend for backend in AGENT_BACKENDS if backend != "claude"])
+def test_application_projection_accepts_disabled_optional_compat_backends(backend):
+ """No registered runtime is expected only after its compat section is disabled."""
+ from config.v2_compat import to_app_config
+ from config.v2_config import V2Config
+
+ config = V2Config.default()
+ getattr(config.agents, backend).enabled = False
+ controller = SimpleNamespace(
+ config=to_app_config(config, resolve_agent_paths=False),
+ agent_service=SimpleNamespace(agents={}),
+ )
- coordinator = BackendRestartCoordinator(controller, AsyncMock())
++ coordinator = BackendRestartCoordinator(controller, AsyncMock(), renew=AsyncMock())
+ assert coordinator.snapshot(backend) == {"state": "applied", "disabled": True}
+
+ getattr(config.agents, backend).enabled = True
+ controller.config = to_app_config(config, resolve_agent_paths=False)
+ assert coordinator.snapshot(backend) == {"state": "unavailable"}
+
+
- @pytest.mark.parametrize("failure", [RuntimeError("prepare failed"), asyncio.CancelledError()])
- def test_application_projection_retains_prepare_failure_and_cancellation(failure):
- async def run():
- service = _AgentService()
- service.agents = {"opencode": object()}
- service.prepare_backend_restart = AsyncMock(side_effect=failure)
- controller = _controller(service)
- coordinator = BackendRestartCoordinator(controller, AsyncMock())
- with pytest.raises(type(failure)):
- await coordinator.request_restart("opencode")
- assert coordinator.snapshot("opencode")["state"] == "failed"
- assert not service.draining
- controller.session_turns.end_backend_drain.assert_awaited_once_with("opencode", resume_deferred=False)
-
- asyncio.run(run())
+ def test_runtime_gen_008_idle_maintenance_runs_behind_closed_admission_then_renews():
+ """RUNTIME-GEN-008: an unattended CLI update renews after its install.
+ Admission is closed only while the CLI is replaced, so no turn launches a
+ half-installed binary. The runtime then renews in place rather than being
+ torn down, and messages held meanwhile resume on it.
+ """
- def test_cancelled_application_remains_failed_after_task_is_removed():
- async def run():
- service = _AgentService()
- service.agents = {"opencode": object()}
- service.active = True
- coordinator = BackendRestartCoordinator(_controller(service), AsyncMock())
- await coordinator.request_restart("opencode")
- await asyncio.sleep(0)
- task = coordinator._tasks["opencode"]
- task.cancel()
- with pytest.raises(asyncio.CancelledError):
- await task
- assert coordinator.snapshot("opencode") == {"state": "failed", "error": "cancelled"}
- assert not service.draining
-
- asyncio.run(run())
-
-
- def test_idle_maintenance_runs_behind_closed_admission_then_refreshes():
async def run():
service = _AgentService()
controller = _controller(service)
diff --cc tests/test_codex_agent.py
index 862aaef55,f2da6a783..228e52990
--- a/tests/test_codex_agent.py
+++ b/tests/test_codex_agent.py
@@@ -6462,43 -6656,30 +6657,31 @@@ class CodexGenerationAcquisitionTests(u
is_initialized=False,
is_alive=False,
has_pending_notifications=False,
- runtime_fingerprint="direct",
stop=AsyncMock(),
)
- agent._transports[cwd] = dead
- agent._transport_cwd_inodes[cwd] = os.stat(cwd).st_ino
- agent._runtime_ownership_snapshot_for_cwd = Mock(
- return_value=SimpleNamespace(
- blocks_transport_replacement=True,
- blocks_dead_transport_replacement=True,
- )
- )
+ self.ownership.blocks_transport_replacement = True
+ self.ownership.blocks_dead_transport_replacement = True
+ dead_generation = install_codex_transport(agent, cwd, dead)
+ fresh = self._fresh()
- with self.assertRaisesRegex(RuntimeError, "durable owner"):
- await agent._get_or_create_transport(cwd)
+ with patch.object(_MODULE, "CodexTransport", return_value=fresh):
+ binding = await agent._acquire_generation(cwd)
+ self.assertIs(binding.generation.runtime.transport, fresh)
dead.stop.assert_not_awaited()
- self.assertIs(agent._transports[cwd], dead)
-
- async def test_runtime_change_preserves_transport_with_pid_run_owner(self):
- import tempfile
+ self.assertIn(dead_generation, agent._units[cwd].generations)
+ async def test_runtime_change_keeps_a_predecessor_with_a_pid_run_owner(self):
agent = self._agent()
with tempfile.TemporaryDirectory() as cwd:
- existing = SimpleNamespace(
- is_initialized=True,
- runtime_fingerprint="direct",
- stop=AsyncMock(),
- )
- agent._transports[cwd] = existing
- agent._transport_cwd_inodes[cwd] = os.stat(cwd).st_ino
- agent._runtime_ownership_snapshot_for_cwd = Mock(
- return_value=SimpleNamespace(blocks_transport_replacement=True)
- )
+ existing = self._fresh()
+ with patch.object(_MODULE, "CodexTransport", return_value=existing):
+ previous = await agent._acquire_generation(cwd)
+ await previous.release()
+ self.ownership.blocks_transport_replacement = True
launch = SimpleNamespace(
+ backend="codex",
channel="hub",
- fingerprint="hub:replacement",
gateway_base_url="http://127.0.0.1:8317",
gateway_token="ephemeral-token",
)
diff --cc tests/test_codex_catalog_retention.py
index f7e2aa332,aa97bb81a..0ed5d1f98
--- a/tests/test_codex_catalog_retention.py
+++ b/tests/test_codex_catalog_retention.py
@@@ -319,15 -315,15 +315,15 @@@ async def test_agent_launch_keeps_pin_a
# An extra argument must not override the path whose lifetime we protect.
value.codex_config.extra_args = ["-c", 'model_catalog_json="/obsolete/catalog.json"']
launch = SimpleNamespace(
- backend="codex", channel="hub", fingerprint="hub:test",
- channel="hub",
++ backend="codex", channel="hub",
gateway_base_url="http://127.0.0.1:1", gateway_token="fixture-only",
)
- starting = asyncio.create_task(value._get_or_create_transport(str(tmp_path), launch))
+ starting = asyncio.create_task(value._acquire_generation(str(tmp_path), launch))
try:
await asyncio.wait_for(initialized.wait(), 5)
- path = value._model_hub_catalog.path
+ path = next(iter(value._model_hub_catalogs.values())).path
assert argv[-1] == f"model_catalog_json={json.dumps(str(path))}"
- await value.invalidate_model_hub_runtime()
+ await value.adopt_model_hub_catalog()
churn()
assert path in retained()
finish.set()
diff --cc tests/test_settings_handler.py
index c5f83202d,76e6407bd..d1b32a93f
--- a/tests/test_settings_handler.py
+++ b/tests/test_settings_handler.py
@@@ -527,10 -529,9 +527,10 @@@ def test_gather_routing_modal_data_only
data = asyncio.run(handler._gather_routing_modal_data(context))
assert data.current_backend == "opencode"
- assert data.registered_backends == ["opencode", "claude", "codex"]
+ assert set(data.registered_backends) == set(AGENT_BACKENDS)
+ assert data.registered_backends[0] == "opencode"
assert server.calls == [
- "ensure_running",
+ "current_server",
"agents:/tmp/workspace",
"models:/tmp/workspace",
"config:/tmp/workspace",
@@@ -624,9 -624,9 +624,9 @@@ def test_gather_routing_modal_data_hide
data = asyncio.run(handler._gather_routing_modal_data(context))
- assert data.registered_backends == ["opencode"]
+ assert data.registered_backends == ["opencode", "avibe"]
assert server.calls == [
- "ensure_running",
+ "current_server",
"agents:/tmp/workspace",
"models:/tmp/workspace",
"config:/tmp/workspace",
@@@ -647,10 -647,10 +647,10 @@@ def test_gather_routing_modal_data_fall
data = asyncio.run(handler._gather_routing_modal_data(context))
assert data.current_backend == "opencode"
- assert data.registered_backends == ["opencode", "codex"]
+ assert data.registered_backends == ["opencode", "avibe", "codex"]
assert data.opencode_agents == [{"name": "build"}]
assert server.calls == [
- "ensure_running",
+ "current_server",
"agents:/tmp/workspace",
"models:/tmp/workspace",
"config:/tmp/workspace",
diff --cc vibe/api.py
index 73a62f358,0251db2c2..db0ae6a4a
--- a/vibe/api.py
+++ b/vibe/api.py
@@@ -109,11 -107,8 +109,10 @@@ from modules.agents.catalog import
agent_backend_descriptors,
display_name_for_backend,
is_agent_backend,
+ is_native_cli_backend,
latest_probe_for_backend,
- runtime_refresh_success_message,
supports_runtime_refresh,
+ supports_install,
supports_web_oauth,
)
from modules.agents.subagent_router import list_codex_subagents
diff --cc vibe/i18n/en.json
index dea0c7c8d,2eb1c8a99..9562ca1b2
--- a/vibe/i18n/en.json
+++ b/vibe/i18n/en.json
@@@ -1046,10 -1042,9 +1048,11 @@@
},
"turn": {
"interrupted": {
- "backendRefresh": "⚠️ This turn was interrupted — its Agent runtime was restarted while it was still running, for example after switching between the Model Hub and direct mode or saving Agent settings. Send the request again if the work still needs doing.",
+ "backendRefresh": "⚠️ This turn was interrupted — its Agent runtime had to be replaced while it was still running, for example by a credential migration. Send the request again if the work still needs doing.",
+ "backendDisabled": "⏹ This turn was stopped because {agent} was turned off. Turn it on again in Settings, then send the request again if the work still needs doing.",
- "serviceRestart": "⚠️ This turn was interrupted — the Avibe service restarted while it was still running. Send the request again if the work still needs doing."
+ "serviceRestart": "⚠️ This turn was interrupted — the Avibe service restarted while it was still running. Send the request again if the work still needs doing.",
+ "serviceRestartWatch": "⚠️ This turn was interrupted — the Avibe service restarted while it was still running. Its running command continues as Watch {watch}, and the result will follow here.",
+ "serviceRestartWatches": "⚠️ This turn was interrupted — the Avibe service restarted while it was still running. Its running commands continue as Watches {watches}, and their results will follow here."
}
},
"runtime": {
diff --cc vibe/i18n/zh.json
index 80bbb6842,c85b837f5..f4c0c690d
--- a/vibe/i18n/zh.json
+++ b/vibe/i18n/zh.json
@@@ -1046,10 -1042,9 +1048,11 @@@
},
"turn": {
"interrupted": {
- "backendRefresh": "⚠️ 本轮执行被中断——它运行期间 Agent 运行时被重启(例如在模型网关和直连之间切换,或保存了 Agent 设置)。如果这项工作仍然需要完成,请重新发送请求。",
+ "backendRefresh": "⚠️ 本轮执行被中断——它运行期间 Agent 运行时不得不被替换(例如凭据迁移)。如果这项工作仍需完成,请重新发送请求。",
+ "backendDisabled": "⏹ 本轮执行已停止,因为 {agent} 已被关闭。请在设置中重新开启它;如果这项工作仍需完成,再重新发送请求。",
- "serviceRestart": "⚠️ 本轮执行被中断——Avibe 服务在它运行期间重启。如果这项工作仍然需要完成,请重新发送请求。"
+ "serviceRestart": "⚠️ 本轮执行被中断——Avibe 服务在它运行期间重启。如果这项工作仍然需要完成,请重新发送请求。",
+ "serviceRestartWatch": "⚠️ 本轮执行被中断——Avibe 服务在它运行期间重启。正在运行的命令已作为 Watch {watch} 继续执行,结果会发到这里。",
+ "serviceRestartWatches": "⚠️ 本轮执行被中断——Avibe 服务在它运行期间重启。正在运行的命令已作为 Watch {watches} 继续执行,结果会发到这里。"
}
},
"runtime": {