v0.2.0rc2
Pre-release
Pre-release
Second release candidate for 0.2.0. Completes the async migration and
stabilizes the worker pool architecture.
Breaking Changes
Fully async database layer
configure_engine()andget_session()now require an async SQLAlchemy engine (AsyncEngine) and returnAsyncSession- Database URLs must use async drivers (e.g.
sqlite+aiosqlite://,postgresql+asyncpg://) sqlalchemy[asyncio]is now a core dependency;aiosqliteadded as dev dependency
Async activity query API
activity.list(),activity.detail(), andactivity.count_active()are now async and acceptAsyncSession- Activity handlers are now async (
async def __call__)
Removed session parameter from activity mutations
activity.create(),activity.update(),activity.complete(), andactivity.error()no longer accept asessionparameter — the handler owns its own session lifecycle
Queue priority parameter
BaseQueueBackend.push()signature changed fromhigh_priority: booltopriority: Priority | None- Affects Redis, Kafka, and any custom queue backend implementations
New Features
CLI entrypoint
- New
agentexecCLI command via[project.scripts]
Activity model create() classmethod
Activity.create()encapsulates record + initial log entry creation in one async call
Async engine disposal
dispose_engine()ensures the async engine's background threads exit cleanly on shutdown
Architecture Changes
Worker pool refactor
- Workers now use the
spawnmultiprocessing start method with explicit context — no inherited state StateEventreplaced with stdlibmultiprocessing.Event— removes dependency on the state backend for shutdown coordination- Event handling and scheduling extracted into
_EventHandlerand_Schedulerclasses - Worker processes are now daemonic with
SIGINTignored — clean shutdown driven by the event pool.start()handlesCancelledErrordirectly for Ctrl+C shutdown
Logging overhaul
- Removed
worker/logging.pyandcore/logging.py— all modules use stdliblogging.getLogger(__name__) - Spawned workers bootstrap a
StreamHandleron the root logger so logs reach stderr - Pool messages use
logger.info/logger.errorinstead ofprint()
Bug Fixes
- Fixed crash when worker receives a task for an unregistered task name (now logs error and skips)
- Failed tasks now log full tracebacks via
logger.exceptioninstead oflogger.error - Kafka consumer handles
Nonemessage values without crashing ActivityUpdated.statusis nowStatusenum instead of raw stringraise einstead of bareraisein task execution for clearer tracebacks
Improvements
- Dependency groups use PEP 735
[dependency-groups]instead of[tool.uv] - Ruff line-length increased to 110
- Removed verbose docstring examples and redundant comments throughout activity models
selectinloadfor eager loading of activity logs inget_by_agent_id- Redis backend adds
type: ignoreannotations for redis-py async stubs