CubeLoop — a Pythonic, async-native agent harness core designed for high performance, readability, and production-grade persistence.
Python agent-frameworkagent-harnessagent-runtimeagentic-aiai-agentsai-frameworkanthropicharnessharness-engineeringharness-frameworklanggraphlanggraph-alternativellmmcpopenaipi-agentpi-agent-corepythonpython-agent
import tempfile
from pathlib import Path
import aiosqlite
import pytest
from cubeloop.checkpointer.exceptions import CheckpointerLockTimeoutError
from cubeloop.checkpointer.sqlite import SQLiteCheckpointer
from cubeloop.providers.base import TextContent, UserMessage
@pytest.mark.asyncio
async def test_lock_timeout_surfaces_as_typed_error(monkeypatch):
with tempfile.TemporaryDirectory() as d:
path = str(Path(d) / "x.db")
async with SQLiteCheckpointer(path) as cp:
await cp._db.execute("PRAGMA busy_timeout = 100")
other = await aiosqlite.connect(path)
try:
await other.execute("BEGIN IMMEDIATE")
msg = UserMessage(content=[TextContent(text="x")])
with pytest.raises(CheckpointerLockTimeoutError):
await cp.append("t", [msg])
finally:
await other.rollback()
await other.close()