feat: background remote agent updates survive SAC navigation (0.20.19)

This commit is contained in:
2026-06-21 11:01:26 +10:00
parent d7bbcc5337
commit 5635be1322
16 changed files with 642 additions and 161 deletions
+19 -3
View File
@@ -104,16 +104,32 @@ def mock_agent_git_release(monkeypatch):
)
@pytest.fixture(autouse=True)
def reset_remote_action_state():
from app.services import host_remote_actions
with host_remote_actions._lock:
host_remote_actions._running.clear()
yield
with host_remote_actions._lock:
host_remote_actions._running.clear()
@pytest.fixture
def client(db_session, monkeypatch):
def client(db_session, db_engine, monkeypatch):
monkeypatch.setenv("SAC_REMOTE_ACTION_INLINE", "1")
monkeypatch.setattr("app.main.bootstrap_api_key", lambda: None)
monkeypatch.setattr("app.main.bootstrap_users", lambda: None)
test_session_local = sessionmaker(bind=db_engine, autocommit=False, autoflush=False)
monkeypatch.setattr("app.services.host_remote_actions.SessionLocal", test_session_local)
def override_get_db():
session = test_session_local()
try:
yield db_session
yield session
finally:
pass
session.close()
fastapi_app.dependency_overrides[get_db] = override_get_db
with TestClient(fastapi_app) as c: