Skip to content

v0.2.0

Choose a tag to compare

@WendellXY WendellXY released this 15 Mar 18:10
· 639 commits to main since this release

This release builds on v0.1.0 with a stronger runtime surface for real agent systems: long-term memory, provider-neutral usage reporting, model resolution helpers, better custom-tool ergonomics, OpenAI OAuth support, and more durable team/runtime persistence.

Across v0.1.0..HEAD, this release includes 37 commits and 91 changed files.

Breaking API Changes

  • Agent::send, Agent::run, Agent::resume, and Agent::resume_with_options now return Result<Message, RuntimeError> instead of Result<(), RuntimeError>.

    • Callers can now consume the final assistant message directly.
    • Code that previously assumed these methods only signaled success/failure will need to handle the returned Message.
  • Provider response and streaming APIs now carry token-usage metadata.

    • Response now includes usage: Option<TokenUsage>.
    • ProviderEvent::MessageDelta now includes usage.
    • Custom provider integrations that construct Response values or emit streaming events must be updated to populate or forward usage data.
  • Runtime hook implementations need a signature update.

    • RuntimeHook::on_event now receives &dyn AuditStore instead of &dyn RuntimeStore.
    • Downstream hook implementations will need to update their method signatures accordingly.
  • Runtime persistence was split into narrower traits.

    • RuntimeStore now composes smaller seams such as AgentStore, RunStore, TaskStore, AuditStore, LeaseStore, and MemoryStore.
    • Custom stores may need to implement the new trait set or adjust existing implementations.
  • ToolSpec gained execution_timeout.

    • If you construct ToolSpec with a struct literal, you now need to add the new field.
    • ToolSpec::builder(...) is now the preferred construction path.

Features

  • Added a long-term memory subsystem.

    • New public memory APIs include MemoryEngine, memory records/search types, and SqliteHybridMemoryStore.
    • Added hybrid runtime persistence with HybridRuntimeStore.
    • Added builtin memory tools for search, pin, and forget workflows.
  • Added model resolution helpers.

    • New ModelSelector and Runtime::resolve_model(...) APIs make it easier to choose an explicit model or resolve the newest available model from a registered provider.
  • Added provider-neutral token usage reporting.

    • OpenAI, Anthropic, and Gemini streams now surface normalized usage data through TokenUsage.
    • Usage is available in provider responses and runtime hook events.
  • Added feature-gated OpenAI OAuth support.

    • New openai-oauth feature exports mentra::auth::openai.
    • Includes secure token stores, persistent credential helpers, and an OAuth example.
  • Added typed app context support for tools.

    • Runtime builders can now register typed host-side state.
    • Tools can retrieve that state through ToolContext and ParallelToolContext.
  • Added public test helpers.

    • New test-utils feature exposes deterministic runtime/testing support for scripted providers and public API verification.

Improvements

  • Improved custom tool ergonomics.

    • Added ToolSpec::builder(...).
    • Added runtime-enforced per-tool execution timeouts.
    • Added ParallelToolContext::spawn_subagent() for disposable delegated work.
    • Clarified ToolResult semantics for tool-level errors vs runtime failures.
  • Added tool profiles for agent-level tool visibility control.

    • AgentConfig::tool_profile can now allowlist or hide tools per operating mode.
  • Improved runtime memory behavior.

    • Added hybrid memory ingestion, recall, compaction plumbing, and searchable persisted memory records.
  • Improved team persistence and recovery.

    • Persistent teammates are now hosted on shared Tokio tasks and wake correctly on resume/revival.
    • Resume/recovery paths are more reliable for persisted team state and pending work.
  • Expanded examples and docs.

    • Added examples for CLI runtime, custom tools, subagent tools, team collaboration, and OpenAI OAuth.
    • Chat example gained a --fresh reset flow.
    • README and runtime docs now cover model resolution, persistence seams, app context, and teammate hosting architecture.
  • CI and portability cleanups.

    • Improved platform gating for auth/tests.
    • Updated CI matrix behavior and Unix/macOS handling.

Migration Notes

  • If you call agent lifecycle methods, update call sites to use the returned Message.
  • If you implement a custom provider, add usage handling to both full responses and streamed MessageDelta events.
  • If you implement custom runtime hooks or stores, update trait implementations for the new hook/store interfaces.
  • If you build ToolSpec manually, prefer ToolSpec::builder(...) or add execution_timeout: None.

Full Changelog

v0.1.0...v0.2.0