Skip to content

Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.

fix(web,brain): mount workspace routes + detect "post on X"; refresh stale tests

Ruben Lütke153b98f985ee
diff --git a/jarvis/brain/local_action_gate.py b/jarvis/brain/local_action_gate.py
index 4dc5fa9dcc..8368e2e8f5 100644
--- a/jarvis/brain/local_action_gate.py
+++ b/jarvis/brain/local_action_gate.py
@@ -725,10 +725,16 @@ def requires_external_integration(text: str) -> bool:
sub-agent (the universal capability for generic work)".
"""
t = text or ""
- return bool(
- _EXTERNAL_INTEGRATION_NOUN_RE.search(t)
- and _EXTERNAL_DISPATCH_VERB_RE.search(t)
- )
+ if not _EXTERNAL_DISPATCH_VERB_RE.search(t):
+ return False
+ if _EXTERNAL_INTEGRATION_NOUN_RE.search(t):
+ return True
+ # Twitter/X rebrand: bare "x" is too ambiguous (math variable, letter),
+ # but "auf X" / "on X" + a posting dispatch verb unambiguously means the
+ # social platform. The preposition is the minimal disambiguator.
+ if re.search(r"\b(?:auf|on)\s+x\b", t, re.I):
+ return True
+ return False
def _get_capability_registry() -> _CapabilityRegistryLike | None:
diff --git a/jarvis/ui/web/server.py b/jarvis/ui/web/server.py
index 2c6281f3c2..0565f28d31 100644
--- a/jarvis/ui/web/server.py
+++ b/jarvis/ui/web/server.py
@@ -268,6 +268,7 @@ class WebServer:
from .wiki_routes import router as wiki_router
from .wiki_ws import router as wiki_ws_router
from .workflows_routes import router as workflows_router
+ from .workspace_routes import router as workspace_router
# Conductor ist ein externes Package im selben Monorepo. Import
# defensiv — wer das Repo ohne conductor checkt aus, kriegt sonst
# hier einen ImportError beim Server-Boot.
@@ -318,6 +319,10 @@ class WebServer:
app.include_router(socials_router)
# In-app feedback / bug-report form → Discord webhook.
app.include_router(feedback_router)
+ # "Make It Yours" multi-agent workspace (/api/workspace/*).
+ # Provides agent detection, workspace launch planning, and PTY WebSocket
+ # for in-app Claude Code / Codex terminals (xterm panes, not OS windows).
+ app.include_router(workspace_router)
# Contacts section — user-curated address book (pure file store, no Brain dep).
app.include_router(contacts_router)
app.include_router(workflows_router)
diff --git a/tests/integration/test_haiku_multi_tool_live.py b/tests/integration/test_haiku_multi_tool_live.py
index 17fb2d98c6..094d12f7c9 100644
--- a/tests/integration/test_haiku_multi_tool_live.py
+++ b/tests/integration/test_haiku_multi_tool_live.py
@@ -11,13 +11,11 @@ import time
import pytest
-from jarvis.core.protocols import ToolResult
-
-
def _api_key_available() -> bool:
return bool(os.environ.get("ANTHROPIC_API_KEY") or os.environ.get("GEMINI_API_KEY"))
@pytest.mark.skipif(not _api_key_available(), reason="kein Brain-API-Key")
@pytest.mark.asyncio
async def test_haiku_speed_under_5s():
@@ -31,28 +29,26 @@ async def test_haiku_speed_under_5s():
assert dt < 10.0, f"Haiku zu langsam: {dt}s"
@pytest.mark.skipif(not _api_key_available(), reason="kein Brain-API-Key")
@pytest.mark.asyncio
async def test_haiku_spawn_multiple_terminals():
+ """Latenz-Test: Wie lang braucht das Brain für einen komplexen Multi-Task-Request?
+
+ Ergebnis kann ein Tool-Call oder eine erklärende Antwort sein — Hauptsache
+ das Brain antwortet innerhalb der Deadline. (open_app wurde in älteren Builds
+ als Assertion-Anker genutzt; der Tool wurde entfernt — jetzt pure Latenz.)
+ """
from jarvis.brain.factory import build_default_brain
brain = build_default_brain()
- calls = []
-
- async def fake_open_app(args, ctx):
- calls.append(args)
- return ToolResult(success=True, output=f"ok: {args}")
-
- brain._tools["open_app"].execute = fake_open_app
t0 = time.perf_counter()
- r = await asyncio.wait_for(brain.generate("Öffne bitte 3 Terminals (Windows Terminal, wt)."),
- timeout=45)
+ r = await asyncio.wait_for(
+ brain.generate("Öffne bitte 3 Terminals (Windows Terminal, wt)."),
+ timeout=45,
+ )
dt = time.perf_counter() - t0
- print(f"\nMulti-Tool-Latenz: {dt:.2f}s")
+ print(f"\nMulti-Request-Latenz: {dt:.2f}s")
print(f"Response: {r[:200]}")
- print(f"Tool-Calls: {calls}")
-
- # Erwartung: mindestens 2 open_app-Calls (3 wäre ideal, aber Brain-Deterministik variiert)
- assert len(calls) >= 2, f"Brain hat nur {len(calls)} Tool-Calls gemacht"
- for call in calls:
- assert "app_name" in call
+ assert r, "Brain muss eine Antwort liefern"
+ assert dt < 30.0, f"Brain zu langsam: {dt}s"
diff --git a/tests/integration/test_jarvis_agent_model_drift.py b/tests/integration/test_jarvis_agent_model_drift.py
index 30cfbcfa07..ac9707cce2 100644
--- a/tests/integration/test_jarvis_agent_model_drift.py
+++ b/tests/integration/test_jarvis_agent_model_drift.py
@@ -37,7 +37,10 @@ _CONFIG_SOLL = _REPO_ROOT / "scripts" / "config-soll.json"
_UNREACHABLE_CLAUDE_MODELS = frozenset({"claude-fable-5"})
_MODEL_KEYS = (
- ("brain.sub_jarvis", "model"),
+ # Renamed from brain.sub_jarvis → brain.worker in the 2026-06-29
+ # Jarvis-Agents rename; both the TOML section header and the
+ # config-soll.json flat key now use "brain.worker".
+ ("brain.worker", "model"),
("brain.providers.claude-api", "deep_model"),
)
@@ -65,6 +68,16 @@ def _soll_value(soll: dict, dotted: str, key: str) -> str | None:
return block.get(key)
+# Back-compat map: renamed TOML section → old section name. During the
+# 2026-06-29 Jarvis-Agents rename, jarvis.toml installs on disk may still
+# carry the OLD section header ([brain.sub_jarvis]) alongside the NEW one
+# ([brain.worker]). The config system aliases them; the raw TOML reader here
+# does not — so we fall back to the old name when the new section lacks the key.
+_TOML_SECTION_ALIASES: dict[str, str] = {
+ "brain.worker": "brain.sub_jarvis",
+}
+
+
def _toml_value(toml: dict, dotted: str, key: str) -> str | None:
cur: object = toml
for part in dotted.split("."):
@@ -73,7 +86,11 @@ def _toml_value(toml: dict, dotted: str, key: str) -> str | None:
cur = cur.get(part)
if not isinstance(cur, dict):
return None
- return cur.get(key)
+ val = cur.get(key)
+ if val is None and dotted in _TOML_SECTION_ALIASES:
+ # Transition period: key absent in the new section — try the old one.
+ val = _toml_value(toml, _TOML_SECTION_ALIASES[dotted], key)
+ return val
def test_soll_worker_model_pins_are_reachable() -> None:
@@ -140,8 +157,8 @@ def test_jarvis_toml_model_pins_match_soll() -> None:
def test_jarvis_toml_worker_model_is_reachable() -> None:
"""Defense-in-depth: the live worker model pin itself must be reachable."""
toml = _load_toml()
- worker_model = _toml_value(toml, "brain.sub_jarvis", "model")
+ worker_model = _toml_value(toml, "brain.worker", "model")
assert worker_model not in _UNREACHABLE_CLAUDE_MODELS, (
- f"jarvis.toml [brain.sub_jarvis].model = {worker_model!r} is unreachable "
+ f"jarvis.toml [brain.worker].model = {worker_model!r} is unreachable "
f"via the Claude Max CLI — every sub-agent worker will 404 -> task_error."
)
diff --git a/tests/integration/test_launcher_headless.py b/tests/integration/test_launcher_headless.py
index 7073f87785..262512e8b1 100644
--- a/tests/integration/test_launcher_headless.py
+++ b/tests/integration/test_launcher_headless.py
@@ -1,20 +1,57 @@
"""Integration-Test für `_run_headless` mit Mock-WebServer.
-Simuliert: Launcher startet, 100ms später SIGINT → sauberer Shutdown.
+Simuliert: Launcher startet, wird gecancelt → sauberer Shutdown.
+
+Alle schweren Abhängigkeiten (uvicorn, WebServer, ChatStore, Supervisor,
+MCPRegistry, load_config, …) werden durch leichte Stubs ersetzt, damit
+der Test rein den START/STOP-Lebenszyklus von _run_headless prüft und
+weder echten Port bindet noch auf laufende Dienste angewiesen ist.
"""
from __future__ import annotations
import asyncio
-import sys
-import types
from types import SimpleNamespace
import pytest
+# ---------------------------------------------------------------------------
+# Lightweight fakes shared by all stubs below
+# ---------------------------------------------------------------------------
+
+
+class _FakeBus:
+ """Minimal event-bus — subscribe / publish sind keine-ops."""
+
+ def subscribe(self, *args: object, **kwargs: object) -> None:
+ pass
+
+ async def publish(self, event: object) -> None:
+ pass
+
+
+class _FakeState:
+ """Nimmt beliebige Attribut-Zuweisung (mirrors Starlette State)."""
+
+
+class _FakeApp:
+ """Minimales ASGI-App-Objekt mit veränderbarem state-Bag."""
+
+ def __init__(self) -> None:
+ self.state = _FakeState()
+
+ async def __call__(self, scope, receive, send): # noqa: ANN001
+ pass
+
+
+# ---------------------------------------------------------------------------
+# Mock WebServer — zentrales Lifecycle-Testsubjekt
+# ---------------------------------------------------------------------------
+
+
class _MockWebServer:
- """Minimaler Stand-in für jarvis.ui.web.server.WebServer."""
+ """Stand-in für jarvis.ui.web.server.WebServer."""
instances: list["_MockWebServer"] = []
@@ -22,52 +59,219 @@ class _MockWebServer:
self.cfg = cfg
self.started = False
self.stopped = False
+ # _run_headless uses server.bus to subscribe/publish events.
+ self.bus = _FakeBus()
+ # _run_headless sets server.app.state.* before calling server.start().
+ self.app = _FakeApp()
_MockWebServer.instances.append(self)
- async def start(self):
+ async def start(self, *, start_serving: bool = True) -> None:
self.started = True
- async def stop(self):
+ async def stop(self) -> None:
self.stopped = True
+# ---------------------------------------------------------------------------
+# Fake peripheral subsystems
+# ---------------------------------------------------------------------------
+
+
+class _MockChatStore:
+ def __init__(self, *, bus, db_path): # noqa: ANN001
+ pass
+
+ def open(self) -> None:
+ pass
+
+ def prune_older_than(self, days: int) -> None:
+ pass
+
+ async def add_message(self, **kwargs: object) -> None:
+ pass
+
+
+class _MockSupervisor:
+ def __init__(self, *, bus): # noqa: ANN001
+ pass
+
+
+class _MockMCPRegistry:
+ def load_from_mcp_json(self) -> None:
+ pass
+
+ async def start_enabled(self, names: list) -> None: # noqa: ANN001
+ pass
+
+
+# ---------------------------------------------------------------------------
+# Fake uvicorn Server — avoids real TCP binding
+# ---------------------------------------------------------------------------
+
+
+class _FakeUvicornServer:
+ """Sets started=True, exits loop when should_exit is set."""
+
+ def __init__(self, config: object) -> None:
+ self.config = config
+ self.started = False
+ self.should_exit = False
+
+ async def serve(self) -> None:
+ self.started = True
+ while not self.should_exit:
+ await asyncio.sleep(0.01)
+
+
+# ---------------------------------------------------------------------------
+# Fake config — replaces load_config() return value
+# ---------------------------------------------------------------------------
+
+
+def _make_fake_loaded_config(data_dir: str = "/tmp", port: int = 18123) -> SimpleNamespace:
+ """Minimal config satisfying all attribute accesses inside _run_headless."""
+ ui = SimpleNamespace(admin_api_port=port, dev_mode=False)
+ # _run_headless calls cfg.model_copy(update={...}) when args.port is not None.
+ ui.model_copy = lambda *, update=None: ui # type: ignore[assignment]
+ cfg = SimpleNamespace(
+ ui=ui,
+ memory=SimpleNamespace(data_dir=data_dir),
+ marketplace=SimpleNamespace(public_callback_base_url=""),
+ harness=SimpleNamespace(default_risk_tier="ask"),
+ )
+ cfg.model_copy = lambda *, update=None: cfg # type: ignore[assignment]
+ return cfg
+
+
+# ---------------------------------------------------------------------------
+# Central autouse fixture: patches every heavyweight dependency
+# ---------------------------------------------------------------------------
+
+
@pytest.fixture(autouse=True)
-def _patch_webserver(monkeypatch):
- """Installiert ein Fake-Modul jarvis.ui.web.server mit _MockWebServer."""
+def _patch_headless_deps(monkeypatch, tmp_path): # noqa: ANN001
+ """Replace all subsystems that _run_headless imports locally.
+
+ Strategy: always import the REAL module first so its internal import
+ chain (e.g. jarvis.mcp.__init__ → adapter → client → registry) can
+ satisfy its own `from .registry import MCPServerSpec` etc. Then patch
+ only the specific class / function the _run_headless lifecycle needs.
+
+ This avoids the cascading ImportError that occurs when sys.modules
+ substitution breaks an already-partially-imported package.
+ """
_MockWebServer.instances.clear()
- fake_mod = types.ModuleType("jarvis.ui.web.server")
- fake_mod.WebServer = _MockWebServer
- monkeypatch.setitem(sys.modules, "jarvis.ui.web.server", fake_mod)
+
+ # 1. uvicorn — import real module, replace Server/Config
+ import uvicorn # noqa: PLC0415
+
+ class _FakeUvicornConfig:
+ def __init__(self, **kw: object) -> None:
+ self.port = kw.get("port", 0)
+
+ monkeypatch.setattr(uvicorn, "Server", _FakeUvicornServer)
+ monkeypatch.setattr(uvicorn, "Config", _FakeUvicornConfig)
+
+ # 2. jarvis.core.config — patch load_config and helpers
+ import jarvis.core.config as _jcfg # noqa: PLC0415
+
+ _fake_cfg = _make_fake_loaded_config(data_dir=str(tmp_path))
+ monkeypatch.setattr(_jcfg, "load_config", lambda: _fake_cfg)
+ monkeypatch.setattr(_jcfg, "ensure_project_root_cwd", lambda: None)
+ monkeypatch.setattr(
+ _jcfg, "refresh_persisted_env_from_user_registry", lambda: None
+ )
+
+ # 3. WebServer — replace the class on the real module
+ import jarvis.ui.web.server as _srv_mod # noqa: PLC0415
+
+ monkeypatch.setattr(_srv_mod, "WebServer", _MockWebServer)
+
+ # 4. ChatStore + helper
+ import jarvis.state.chat_store as _cs_mod # noqa: PLC0415
+
+ monkeypatch.setattr(_cs_mod, "ChatStore", _MockChatStore)
+ monkeypatch.setattr(
+ _cs_mod,
+ "default_chats_db_path",
+ lambda data_dir: str(tmp_path / "chats.db"),
+ )
+
+ # 5. Supervisor
+ import jarvis.state.supervisor as _sup_mod # noqa: PLC0415
+
+ monkeypatch.setattr(_sup_mod, "Supervisor", _MockSupervisor)
+
+ # 6. Brain factory (invoked in a background task — needs to be a no-op)
+ import jarvis.brain.factory as _brain_mod # noqa: PLC0415
+
+ monkeypatch.setattr(_brain_mod, "build_default_brain", lambda **kw: None)
+
+ # 7. MCP registry — patch MCPRegistry on the real module so internal
+ # imports (jarvis.mcp.__init__ → adapter → client → registry) still
+ # resolve MCPServerSpec from the real module.
+ import jarvis.mcp.registry as _mcp_reg_mod # noqa: PLC0415
+
+ monkeypatch.setattr(_mcp_reg_mod, "MCPRegistry", _MockMCPRegistry)
+
+ # 8. MCP state (get_enabled_names)
+ import jarvis.mcp.state as _mcp_state_mod # noqa: PLC0415
+
+ monkeypatch.setattr(_mcp_state_mod, "get_enabled_names", lambda: [])
+
+ # 9. runtime_refs
+ import jarvis.core.runtime_refs as _rr # noqa: PLC0415
+
+ monkeypatch.setattr(_rr, "set_mcp_registry", lambda *a, **k: None)
+
+ # 10. marketplace hosted_callback
+ import jarvis.marketplace.hosted_callback as _hc_mod # noqa: PLC0415
+
+ monkeypatch.setattr(
+ _hc_mod, "set_public_callback_base_url", lambda *a, **k: None
+ )
+
yield
-def _make_cfg(port: int = 18123):
- # `args.port` is read by _run_headless before falling back to _fast_admin_port();
- # the SimpleNamespace stub must carry the attribute (None = use auto-detect).
+# ---------------------------------------------------------------------------
+# Helper: minimal args namespace
+# ---------------------------------------------------------------------------
+
+
+def _make_args(port: int = 18123) -> SimpleNamespace:
+ # Explicit `port` prevents _fast_admin_port() from reading jarvis.toml
+ # and returning the live Jarvis admin port, which would cause the fake
+ # uvicorn (or a real one) to try binding an already-occupied socket.
return SimpleNamespace(
ui=SimpleNamespace(admin_api_port=port, dev_mode=False),
- port=None,
+ port=port,
dev=False,
no_lock=True,
)
-def test_headless_starts_and_stops_on_signal():
- """`_run_headless` beendet sauber wenn stop_event gesetzt wird."""
- from jarvis.ui.web import launcher
+# ---------------------------------------------------------------------------
+# Tests
+# ---------------------------------------------------------------------------
- cfg = _make_cfg()
- async def _driver():
- task = asyncio.create_task(launcher._run_headless(cfg))
- # Warte bis Server gestartet
- for _ in range(50):
- await asyncio.sleep(0.02)
+def test_headless_starts_and_stops_on_signal() -> None:
+ """_run_headless durchläuft start → wait → cancel → stop sauber."""
+ from jarvis.ui.web import launcher # noqa: PLC0415
+
+ args = _make_args()
+
+ async def _driver() -> None:
+ task = asyncio.create_task(launcher._run_headless(args))
+ # Poll until the MockWebServer.start() has been called (≤ 1 s).
+ for _ in range(100):
+ await asyncio.sleep(0.01)
if _MockWebServer.instances and _MockWebServer.instances[0].started:
break
- # Kill-Switch: finde die asyncio.Event() die der Launcher nutzt.
- # Da wir nicht direkt rankommen, cancelln wir den Task — das bricht
- # stop_event.wait() ab und triggert den finally-Zweig.
+ # Simulate SIGINT / stop signal by cancelling the task.
+ # CancelledError is raised at `await stop_event.wait()`, the finally
+ # block runs and calls server.stop() → inst.stopped = True.
task.cancel()
try:
await task
@@ -76,32 +280,30 @@ def test_headless_starts_and_stops_on_signal():
asyncio.run(_driver())
- assert len(_MockWebServer.instances) == 1
+ assert len(_MockWebServer.instances) == 1, "WebServer must be instantiated exactly once"
inst = _MockWebServer.instances[0]
- assert inst.started is True
- assert inst.stopped is True
+ assert inst.started is True, "server.start() must have been called"
+ assert inst.stopped is True, "server.stop() must be called in the finally block"
-def test_headless_stop_event_path():
- """Alternativer Pfad: wir patchen asyncio.Event damit der Wait sofort returnt."""
- from jarvis.ui.web import launcher
+def test_headless_stop_event_path() -> None:
+ """Zweiter Pfad: Task wird erst nach kurzer Pause gecancelt."""
+ from jarvis.ui.web import launcher # noqa: PLC0415
- cfg = _make_cfg(port=18222)
+ args = _make_args(port=18222)
- async def _driver():
- # Starte Launcher in Task.
- task = asyncio.create_task(launcher._run_headless(cfg))
- # Gib dem Launcher Zeit WebServer.start() durchzuführen.
- await asyncio.sleep(0.1)
- # Setze SIGINT-like-Shutdown: cancel triggert finally → server.stop()
+ async def _driver() -> None:
+ task = asyncio.create_task(launcher._run_headless(args))
+ # Give the launcher time to reach stop_event.wait().
+ await asyncio.sleep(0.15)
task.cancel()
try:
- rc = await task
+ await task
except asyncio.CancelledError:
- rc = None
- return rc
+ pass
asyncio.run(_driver())
- assert _MockWebServer.instances, "WebServer sollte instanziiert worden sein"
- assert _MockWebServer.instances[-1].stopped is True
+ assert _MockWebServer.instances, "WebServer should have been instantiated"
+ inst = _MockWebServer.instances[-1]
+ assert inst.stopped is True, "server.stop() must be called on clean shutdown"
diff --git a/tests/integration/test_tier1_speed.py b/tests/integration/test_tier1_speed.py
index d6a7219636..85bc6187d6 100644
--- a/tests/integration/test_tier1_speed.py
+++ b/tests/integration/test_tier1_speed.py
@@ -12,9 +12,6 @@ import time
import pytest
-from jarvis.core.protocols import ToolResult
-
-
def _api_key_available() -> bool:
import os
return bool(os.environ.get("ANTHROPIC_API_KEY") or os.environ.get("GEMINI_API_KEY"))
@@ -26,6 +23,7 @@ def _oauth_available() -> bool:
return _api_key_available()
@pytest.mark.skipif(not _api_key_available(), reason="kein Brain-API-Key")
@pytest.mark.asyncio
async def test_latency_simple_answer():
@@ -39,6 +37,7 @@ async def test_latency_simple_answer():
assert dt < 8.0, f"Zu langsam: {dt}s"
@pytest.mark.skipif(not _api_key_available(), reason="kein Brain-API-Key")
@pytest.mark.asyncio
async def test_rate_limit_tracker_skips_bad_provider():
@@ -56,18 +55,17 @@ async def test_rate_limit_tracker_skips_bad_provider():
assert dt < 25.0
@pytest.mark.skipif(not _oauth_available(), reason="kein Claude OAuth")
@pytest.mark.asyncio
async def test_multitool_latency():
+ """Latenz-Test: Multi-Part-Request muss innerhalb der Deadline beantwortet werden.
+
+ (open_app wurde in älteren Builds als Tool-Assertion-Anker genutzt; das Tool
+ wurde entfernt — dieser Test misst jetzt reine Antwort-Latenz.)
+ """
from jarvis.brain.factory import build_default_brain
brain = build_default_brain()
- calls: list = []
-
- async def fake_open(args, ctx):
- calls.append(args)
- return ToolResult(success=True, output="ok")
-
- brain._tools["open_app"].execute = fake_open
t0 = time.perf_counter()
r = await asyncio.wait_for(
@@ -77,5 +75,5 @@ async def test_multitool_latency():
dt = time.perf_counter() - t0
print(f"\nMulti-Tool-Latenz Tier-1: {dt:.2f}s")
print(f"Response: {r[:150]}")
- print(f"Tool-Calls: {len(calls)}")
- assert len(calls) >= 2
+ assert r, "Brain muss eine Antwort liefern"
+ assert dt < 25.0, f"Brain zu langsam: {dt}s"
diff --git a/tests/unit/plugins/tool/test_app_control_tools.py b/tests/unit/plugins/tool/test_app_control_tools.py
index 5385e3245d..14fb9fd666 100644
--- a/tests/unit/plugins/tool/test_app_control_tools.py
+++ b/tests/unit/plugins/tool/test_app_control_tools.py
@@ -51,6 +51,12 @@ def make_cfg(*, brain="grok", tts="grok-voice", stt="faster-whisper", sub="claud
ui=SimpleNamespace(theme="dark"),
profile=SimpleNamespace(language="auto"),
persona=SimpleNamespace(name="Jarvis"),
+ # resolve_assistant_name now derives the name from the wake phrase
+ # (wake_word coupling 2026-06-20), not persona.name. Set the trigger
+ # block so "Hey Jarvis" → "Jarvis" in build_settings_snapshot.
+ trigger=SimpleNamespace(
+ wake_word=SimpleNamespace(phrase="Hey Jarvis"),
+ ),
wake=SimpleNamespace(phrase="hey jarvis", engine="openwakeword"),
autostart=SimpleNamespace(enabled=True),
computer_use=SimpleNamespace(step_budget=100),
diff --git a/tests/unit/plugins/tool/test_navigate.py b/tests/unit/plugins/tool/test_navigate.py
index 417208031b..44e15dcd87 100644
--- a/tests/unit/plugins/tool/test_navigate.py
+++ b/tests/unit/plugins/tool/test_navigate.py
@@ -112,6 +112,8 @@ def test_known_sections_match_frontend_section_ids() -> None:
text = events_ts.read_text(encoding="utf-8")
block = re.search(r"SECTION_IDS\s*=\s*\[(.*?)\]\s*as const", text, re.DOTALL)
assert block, "could not find SECTION_IDS array in store/events.ts"
- ts_ids = set(re.findall(r'"([a-z0-9-]+)"', block.group(1)))
+ # [a-z0-9_-]+ — underscore added to match "run_inspector" (hyphen-only
+ # pattern silently dropped it, so KNOWN had run_inspector but ts_ids didn't).
+ ts_ids = set(re.findall(r'"([a-z0-9_-]+)"', block.group(1)))
assert ts_ids, "no ids parsed from SECTION_IDS"
assert NavigateTool.known_sections() == ts_ids