Skip to content

v0.3.0

Choose a tag to compare

@xfgong xfgong released this 14 May 08:14
· 646 commits to main since this release

Highlights

Messages & state

  • New metadata field on UserMessage / AssistantMessage / ToolResultMessage — survives checkpointer ser/deser.
  • AgentContext.extra mutable dict for per-thread state, shared with Agent._extra and 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.AgentTool parameters and preserves images / structured content / isError.

Agent loop

  • New middleware hooks: transform_system_prompt (chain composition) and after_model_response (with TurnAction).
  • convert_to_llm hook composed properly into the agent loop.
  • ctx.extra mutations, response mutation, and inject_messages propagate correctly across the loop.

Providers — Anthropic

  • Configurable CacheMarkerPolicy for cache_control placement.
  • New base_url parameter (forwarded to AsyncAnthropic) so Anthropic-compat proxies work without monkey-patching.
  • temperature skipped 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_headers constructor args.
  • Streaming usage capture via stream_options.include_usage (can be opted out via on_payload).
  • input_tokens excludes cached_tokens to 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 / $defs stripped; title preserved inside anyOf; $ref sibling keys merged onto resolved schema).
  • max_tokens / temperature no longer auto-injected; caller responsibility via on_payload.

CI

  • Postgres service in CI to unblock checkpointer E2E.
  • codecov project check + PR comment.

Full changelog: v0.2.0...v0.3.0