Skip to content

Changelog

Notable changes to the kova-sdk crate, newest first. Versions follow SemVer; the crate is published on crates.io.

0.9.0 — Stateless core: memory, orchestrator, and push-streaming removed

Section titled “0.9.0 — Stateless core: memory, orchestrator, and push-streaming removed”

Removed (breaking) — the agent is now stateless-only; persistence, sessions, and multi-agent composition are host concerns.

  • memory module — the MemoryStore trait, InMemoryStore, and AgentBuilder::memory. Own a Vec<ConversationMessage> and persist response.new_messages yourself. See Conversations & History.
  • orchestrator moduleOrchestrator and its Sequential / Parallel / Router patterns. Compose agents with plain Rust over Agent::run (a few lines of ?, tokio::join!, or match). See A Multi-Agent Pipeline.
  • Session / chat layerAgent::chat, chat_response, and chat_stream. Use run / run_stream over caller-owned history.
  • Push-based streaming — the StreamingHandler trait and AgentBuilder::streaming_handler. The pull-based run_stream (yielding AgentEvents) is the streaming surface. See Streaming.
  • KovaError::Memory and KovaError::Orchestration variants.

No functional change to run / run_stream / run_structured / run_cancellable.

0.8.0 — Native Anthropic, structured output, embeddings, cancellation, error classification, MCP resilience

Section titled “0.8.0 — Native Anthropic, structured output, embeddings, cancellation, error classification, MCP resilience”

Added

  • Native Anthropic provider (provider::anthropic, feature anthropic, on by default) — the Messages API directly: streaming SSE, tool use, adaptive extended thinking, and automatic prompt caching. Signed reasoning blocks round-trip through history as ContentBlock::Thinking. See Configuring a Provider.
  • Structured outputInferenceConfig::response_format + Agent::run_structured::<T>(messages, format) constrain the final text to a JSON schema (native per provider; Bedrock rejects it). See Structured Output.
  • Embeddings — the EmbeddingProvider trait with OpenAI-compatible and Ollama implementations (kova ships no vector store). See Embeddings.
  • Token counting + context budgetsLlmProvider::count_tokens (offline heuristic by default; native on Anthropic) and AgentBuilder::context_budget, which fails over-long prompts with KovaError::ContextBudgetExceeded before the request.
  • Prompt-cache accountingUsageStats::cache_read_tokens / cache_creation_tokens (and the matching StreamEvent::UsageEvent fields); opt-in Bedrock caching via BedrockProviderConfig::with_cache(true).
  • CancellationAgent::run_cancellable / run_stream_cancellable take a CancellationToken (prelude re-export) and abort with KovaError::Cancelled, producing no messages.
  • Provider error classificationProviderErrorClass on KovaError::Provider { class }, err.provider_class(), and the constructors provider_http / provider_invalid / provider_auth. See Error Types.
  • MCP resilienceMcpClient::reconnect(), tools/list caching, and tools_call_with_timeout; a dead transport auto-reconnects once. See Connecting MCP Servers.

Changed (breaking)

  • KovaError::Provider gained a required class field; build provider errors through the new constructors. is_retryable() now derives from the class.
  • OpenAI-compatible usage reports input_tokens excluding cached prompt tokens (they arrive in cache_read_tokens), so input_tokens + cache_read_tokens is the full prompt on every provider.
  • MCP transport-level I/O failures now surface as KovaError::Connection instead of KovaError::Mcp; server-reported JSON-RPC errors remain Mcp.

0.7.0 — Streamable HTTP transport + OAuth tokens

Section titled “0.7.0 — Streamable HTTP transport + OAuth tokens”

Added

  • McpTransport::StreamableHttp { url, headers, auth } — the MCP 2025 Streamable-HTTP transport. Unlike HttpSse, it performs the initialize / notifications/initialized handshake, tracks the server’s Mcp-Session-Id and echoes it on every request, and parses both plain-JSON and SSE responses.
  • TokenProvider trait (token(), refresh()) — a pluggable bearer-token source for StreamableHttp. The transport attaches Authorization: Bearer … to each request and, on a 401, calls refresh() once and retries. Kova owns no OAuth logic; the host supplies tokens.

Stdio and HttpSse are unchanged and remain supported; prefer StreamableHttp for modern remote servers. See Connecting MCP Servers.

Added

  • UsageStats::thinking_tokens: Option<u32> — reasoning token count when the provider reports it separately. It’s a subset of output_tokens (not additive); None means “unknown” rather than a misleading 0.
  • StreamEvent::UsageEvent::thinking_tokens — reasoning tokens on streaming usage events.

Changed

  • OpenAI (o-series) and Gemini now surface reasoning-token counts; Bedrock and Ollama fold them into output_tokens and report None. See Thinking & Reasoning Models.

Added

  • McpTransport::Stdio { env } — extra environment variables for the spawned MCP server process.
  • McpTransport::HttpSse { headers } — extra HTTP headers on every JSON-RPC request (e.g. Authorization).

Added

  • Built-in tools (kova_sdk::tools) behind two feature flags:
    • toolsread_file, list_dir, search, edit_file, write_file, patch_file, shell (light deps).
    • web-tools (implies tools) — fetch_webpage plus the fetch_text SSRF-guarded helper.
  • ToolPolicy / WebPolicy — injected, config-agnostic guardrails.
  • register_all_tools() / register_all_tools_with_policy(...).
  • SSRF defense in web tools: private-address rejection, DNS-pinned client, per-hop redirect re-validation.

See Built-in Tools & ToolPolicy.

Added

  • Stateless core loop: Agent::run(&[ConversationMessage]) -> AgentResponse — caller-owned history in, full result out, no memory store.
  • Agent::run_with_config, Agent::run_stream (pull-based AgentEvent stream), Agent::chat_response.
  • Retries with exponential backoff (RetryConfig, default 2), applied to provider calls and stream establishment; KovaError::is_retryable() / status_code().
  • Provider feature flags (openai, gemini, ollama, bedrock).
  • InferenceConfig::top_p / stop_sequences; kova_sdk::prelude; AgentBuilder::metrics; tool approval decisions (ApprovedForSession, DeniedAlways, DeniedWithReason).

Changed

  • Memory writes are transactional per turn — a failed turn leaves the conversation unchanged.
  • InMemoryStore truncation is tool-pair safe (cuts at a user-message boundary).
  • ToolRegistry methods are synchronous; tool_definitions returns a cached value invalidated on registration.
  • Streaming decodes bytes line-wise (UTF-8 safe across chunk splits); parallel tool-call deltas correlated by provider index.

Added

  • OllamaProvider / OllamaProviderConfig / OllamaThink — local models, no API key, NDJSON streaming.
  • GeminiProvider / GeminiProviderConfigx-goog-api-key, with_thinking_budget.
  • OpenAiProviderConfig::with_reasoning_effort; BedrockProviderConfig::with_additional_model_request_fields.
  • ModelResponse::thinking and StreamEvent::ThinkingDelta across all four providers; Agent::last_turn_input_tokens; StreamEvent::UsageEvent.

Added

  • Agent with blocking (chat) and streaming (chat_stream) loops; AgentBuilder with validation.
  • LlmProvider trait + OpenAiCompatibleProvider and BedrockProvider.
  • Tool trait + thread-safe ToolRegistry.
  • MemoryStore trait + InMemoryStore (unbounded and capped).
  • McpClient (stdio + HTTP+SSE) and the McpTool adapter.
  • StreamingHandler trait + SSE parser.
  • Orchestrator with Sequential, Parallel, and Router patterns.
  • TelemetryConfig (feature-gated OTEL) and always-available MetricsCollector.
  • Unified KovaError enum; compile-time Send + Sync assertions.