github cloudflare/agents agents@0.18.0

latest releases: @cloudflare/shell@0.4.2, @cloudflare/voice@0.3.5, @cloudflare/codemode@0.4.4...
3 hours ago

Minor Changes

  • #1860 f5b1dd8 Thanks @mattzcarey! - Group SDK-managed initialization, startup, chat interactions, turns, and durable submissions into semantic phases. Storage-heavy setup, hydration, recovery, request persistence, and response persistence each receive a named bucket, keeping inference and tool spans visible without discarding lower-level Durable Object SQLite spans. Each span records agent identity, storage phase, a stable marker for UI grouping, and operation-specific metadata. No-op on runtimes without the tracing API.

  • #1860 f5b1dd8 Thanks @mattzcarey! - Add agents/observability/ai with wrapAISDK for AI SDK v6 and createAISDKTelemetry for AI SDK v7. Both project Cloudflare-native invoke_agent {agent}, chat {model}, and execute_tool {tool} spans using scalar OpenTelemetry GenAI attributes, including request settings, token usage, finish reasons, tool-call IDs, model-call time to first chunk, bounded AI SDK v6 approval lifecycle spans, and conditional AI Gateway log references. Payload storage is opt-in: storeMessages writes OTel-schema input/output message arrays to chat ({ role, parts }, canonical text/reasoning/tool parts, and output finish_reason; oldest messages are dropped past the budget while protecting the first two), and storeTools writes arguments/results to execute_tool. The flags themselves are never emitted as span attributes. Schemas, request headers, provider options, and raw errors remain excluded.

Patch Changes

  • #1959 a3cbed1 Thanks @mattzcarey! - Cache MCP JSON Schema conversion for the current catalog on each live connection, and let Think agents skip direct MCP AI-tool exposure when those tools are exposed through Code Mode or another mechanism outside Think's automatic tool set.

  • #1963 3ce98ff Thanks @mattzcarey! - Reconcile stale useAgentChat server-streaming state after an errored client reconnects.

    Reconnect probes now include correlation IDs, and STREAM_RESUME_NONE distinguishes globally idle agents from active continuations owned by another connection. The hook clears fallback streaming state only for a correlated idle response. Reconnect opens are retained while a prior resume or status transition settles, in-flight handshakes are retransmitted on replacement sockets, and all AI SDK resume entry points share one serialization gate.

  • #1944 fff4131 Thanks @cjol! - Make the agents/vite turndown stub fail with a diagnostic error when app code calls it directly, and document the stubTurndown: false opt-out for applications that use turndown themselves.

  • #1926 6861933 Thanks @mattzcarey! - Verify MCP OAuth callback state before changing a connection. Forged, expired, and replayed callbacks no longer disrupt the genuine authorization flow, and addMcpServer() refreshes auth URLs whose embedded state has expired.

  • #1924 c19d58a Thanks @mattzcarey! - Harden MCP connection recovery: honor retry budgets for resolved connection failures, finish in-flight restore work before stable-id migration, and close connections replaced by the legacy connect() path.

  • #1923 33e59c4 Thanks @mattzcarey! - Recover streamable HTTP connections when a server rejects a persisted session with HTTP 404. The client clears the stale session from memory and storage, initializes a new session, and rediscovers capabilities once.

Don't miss a new agents release

NewReleases is sending notifications on new releases.