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(tests): preserve unseeded sqlite cases

cyhb1f0c715c6f2
diff --git a/tests/conftest.py b/tests/conftest.py
index 13a2b34f3..a67aa029c 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -165,12 +165,14 @@ def _seed_sqlite_state_template(
Migration/bootstrap tests opt out with ``no_sqlite_template`` because their
purpose is to exercise the real upgrade/import path from an unseeded DB.
+ Real-path tests are always read-only and must never receive a template copy.
Every other test keeps its per-test database copy, so writes and schema
mutations remain isolated without replaying all migrations per test.
"""
if (
- request.node.get_closest_marker("no_sqlite_template")
+ request.node.get_closest_marker("uses_real_paths")
+ or request.node.get_closest_marker("no_sqlite_template")
or not _module_uses_default_sqlite_state(request)
):
yield
diff --git a/tests/test_cli_task_command.py b/tests/test_cli_task_command.py
index a837dd0a4..ab733eb5a 100644
--- a/tests/test_cli_task_command.py
+++ b/tests/test_cli_task_command.py
@@ -3459,8 +3459,10 @@ def test_default_agent_pointer_is_created(tmp_path: Path) -> None:
assert agent_store.get_default_agent().backend == "codex"
[email protected]_sqlite_template
def test_resolve_agent_for_target_bootstraps_sqlite_before_scope_lookup(tmp_path: Path) -> None:
db_path = tmp_path / "fresh-state" / "vibe.sqlite"
+ assert not db_path.exists()
default_agent = SimpleNamespace(name="default", backend="codex")
fake_store = SimpleNamespace(
require=lambda name: (_ for _ in ()).throw(ValueError(f"agent '{name}' not found")),
diff --git a/tests/test_internal_server.py b/tests/test_internal_server.py
index 94bbb8ae6..bf4b701a2 100644
--- a/tests/test_internal_server.py
+++ b/tests/test_internal_server.py
@@ -2795,6 +2795,7 @@ def test_backend_drain_resolves_inherited_default_agent_backend(tmp_path, monkey
assert manager._deferred_restart_sessions == {"codex": {session_id}}
[email protected]_sqlite_template
def test_backend_drain_flushes_deferred_session_after_cutover():
controller = _build_controller_double()
manager = session_turns.SessionTurnManager(controller)
diff --git a/tests/test_session_cli.py b/tests/test_session_cli.py
index 1bf2ad27a..2fd336369 100644
--- a/tests/test_session_cli.py
+++ b/tests/test_session_cli.py
@@ -116,11 +116,13 @@ def test_list_uses_shared_pagination_contract(monkeypatch, tmp_path, capsys):
assert page2["pagination"]["has_more"] is False
[email protected]_sqlite_template
def test_list_on_fresh_home_returns_empty(monkeypatch, tmp_path, capsys):
# No ensure_sqlite_state(): _open_session_engine must bootstrap the DB itself,
# so a fresh Avibe home returns a clean empty list, not "no such table" (Codex P2).
monkeypatch.setenv("AVIBE_HOME", str(tmp_path))
paths.ensure_data_dirs()
+ assert not paths.get_sqlite_state_path().exists()
code, payload = _run(cli.cmd_session_list, ["session", "list"], capsys)
assert code == 0
assert payload["sessions"] == []