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(show-runtime): classify explicit child exits by owner (#1665)

Call White2c6fcbe88efd
diff --git a/core/show_runtime.py b/core/show_runtime.py
index 53e176816..cce5d7f13 100644
--- a/core/show_runtime.py
+++ b/core/show_runtime.py
@@ -1401,6 +1401,7 @@ class ShowRuntimeManager:
runtime_evidence = ShowRuntimeFailureEvidence(
ShowRuntimeFailureDimension.RUNTIME,
runtime_reason,
+ provenance="configured" if self._command_explicit else None,
)
runtime_failure_class = classify_show_runtime_failure(runtime_evidence) if runtime_reason else None
availability = replace(
diff --git a/core/show_runtime_failures.py b/core/show_runtime_failures.py
index 995afb9c2..873f50ccb 100644
--- a/core/show_runtime_failures.py
+++ b/core/show_runtime_failures.py
@@ -91,6 +91,15 @@ _FAILURE_DECLARATION_ROWS = (
ShowRuntimeFailureClass.UNCLASSIFIED,
ShowRuntimeRecoveryAction.REPAIR,
),
+ ShowRuntimeFailureDeclaration(
+ "runtime_start_process_unavailable",
+ ShowRuntimeFailureDimension.RUNTIME,
+ "explicit-runtime-command",
+ ShowRuntimeFailureClass.CONFIGURED,
+ ShowRuntimeRecoveryAction.CHANGE_SETTING,
+ user_owned=True,
+ provenance="configured",
+ ),
ShowRuntimeFailureDeclaration(
"runtime_start_health_timeout",
ShowRuntimeFailureDimension.RUNTIME,
diff --git a/tests/test_ui_show_pages.py b/tests/test_ui_show_pages.py
index 4c208473f..081951960 100644
--- a/tests/test_ui_show_pages.py
+++ b/tests/test_ui_show_pages.py
@@ -8,11 +8,13 @@ import io
import json
import os
import re
+import shlex
import shutil
import socket
import ssl
import struct
import subprocess
+import sys
import tarfile
import textwrap
import threading
@@ -6614,6 +6616,28 @@ def test_show_runtime_failure_classification(dimension, reason, expected):
assert classify_show_runtime_failure(ShowRuntimeFailureEvidence(dimension, reason)) is expected
+ ("provenance", "expected_class", "expected_action"),
+ (
+ (None, ShowRuntimeFailureClass.UNCLASSIFIED, ShowRuntimeRecoveryAction.REPAIR),
+ ("configured", ShowRuntimeFailureClass.CONFIGURED, ShowRuntimeRecoveryAction.CHANGE_SETTING),
+ ),
+)
+def test_runtime_child_exit_classification_uses_command_owner(
+ provenance,
+ expected_class,
+ expected_action,
+):
+ evidence = ShowRuntimeFailureEvidence(
+ ShowRuntimeFailureDimension.RUNTIME,
+ "runtime_start_process_unavailable",
+ provenance,
+ )
+
+ assert classify_show_runtime_failure(evidence) is expected_class
+ assert show_runtime_recovery_action(evidence) is expected_action
+
+
@pytest.mark.parametrize(
("provenance", "expected_class", "expected_action"),
(
@@ -8126,6 +8150,31 @@ def test_show_runtime_manager_reports_url_timeout_separately(monkeypatch, tmp_pa
assert result.reason == "runtime_start_url_timeout"
+def test_explicit_runtime_child_exit_publishes_configured_recovery_evidence(monkeypatch, tmp_path):
+ started = tmp_path / "configured-runtime-started"
+ runtime_script = tmp_path / "configured-runtime.py"
+ runtime_script.write_text(
+ "from pathlib import Path\n"
+ "from time import sleep\n"
+ f"Path({str(started)!r}).touch()\n"
+ "sleep(0.05)\n",
+ encoding="utf-8",
+ )
+ monkeypatch.setenv("VIBE_SHOW_RUNTIME_BIN", shlex.join([sys.executable, str(runtime_script)]))
+ manager = ShowRuntimeManager(
+ workspace_root=tmp_path / "show",
+ runtime_dir=tmp_path / "runtime",
+ )
+ monkeypatch.setattr(manager, "_sweep_orphan_runtime_servers", lambda: None)
+
+ result = asyncio.run(manager.ensure())
+
+ assert started.exists()
+ assert result.reason == "runtime_start_process_unavailable"
+ assert result.failure_class is ShowRuntimeFailureClass.CONFIGURED
+ assert result.recovery_action is ShowRuntimeRecoveryAction.CHANGE_SETTING
+
+
def test_show_runtime_manager_rejects_process_that_exits_before_health(monkeypatch, tmp_path):
health_checks = []