v0.3.0
Highlights
Messages & state
- New
metadatafield onUserMessage/AssistantMessage/ToolResultMessage— survives checkpointer ser/deser. AgentContext.extramutable dict for per-thread state, shared withAgent._extraand persisted across turns.
Checkpointer
- New
PostgresCheckpointer(SQLAlchemy models, alembic helpers,load/append/save_extra+ schema-version verification). - Lazy SQLite import; postgres E2E tests skip when the DB is unreachable.
MCP
- HTTP and stdio tool loaders with per-operation timeout (
cubepi.mcp.load_http_tools/load_stdio_tools). - Tool adapter normalises MCP JSON Schemas to
cubepi.AgentToolparameters and preserves images / structured content /isError.
Agent loop
- New middleware hooks:
transform_system_prompt(chain composition) andafter_model_response(withTurnAction). convert_to_llmhook composed properly into the agent loop.ctx.extramutations, response mutation, andinject_messagespropagate correctly across the loop.
Providers — Anthropic
- Configurable
CacheMarkerPolicyforcache_controlplacement. - New
base_urlparameter (forwarded toAsyncAnthropic) so Anthropic-compat proxies work without monkey-patching. temperatureskipped when extended thinking is enabled (Anthropic disallows the combo).await stream.get_final_message()fix.
Providers — OpenAI
payload_quirks=["max_completion_tokens_alias"]for old-API providers.- New
extra_body/extra_headersconstructor args. - Streaming
usagecapture viastream_options.include_usage(can be opted out viaon_payload). input_tokensexcludescached_tokensto match Responses/faux accounting.- OSS reasoning field extraction (
reasoning/reasoning_content/reasoning_details). - Tool-schema normalisation for byte-stream cache parity with langchain-openai (top-level
title/description/$defsstripped;titlepreserved insideanyOf;$refsibling keys merged onto resolved schema). max_tokens/temperatureno longer auto-injected; caller responsibility viaon_payload.
CI
- Postgres service in CI to unblock checkpointer E2E.
- codecov project check + PR comment.
Full changelog: v0.2.0...v0.3.0