Conversation
89cc28e to
048dfdf
Compare
| { | ||
| "name": "@cloudflare/ai-chat", | ||
| "version": "0.3.2", | ||
| "version": "0.4.0", |
There was a problem hiding this comment.
🟡 Stale peer dependency: @cloudflare/ai-chat 0.4.0 allows agents <0.10.0 but unstable_chatRecovery requires runFiber from 0.10.0
@cloudflare/ai-chat is released as 0.4.0, advertising the new unstable_chatRecovery feature which calls this.runFiber(...) at runtime (packages/ai-chat/src/index.ts:706). However, the peer dependency on agents at packages/ai-chat/package.json:31 was not updated from >=0.8.7 <1.0.0 — it still accepts agents 0.8.7–0.9.x, which do not have the runFiber method on the Agent base class. A user who installs @cloudflare/ai-chat@0.4.0 with agents@0.9.0 and sets unstable_chatRecovery = true will get a runtime TypeError: this.runFiber is not a function. The peer dependency minimum should be bumped to >=0.10.0 <1.0.0.
Prompt for agents
The peer dependency on agents in packages/ai-chat/package.json (line 31) needs to be updated from '>=0.8.7 <1.0.0' to '>=0.10.0 <1.0.0'. The new unstable_chatRecovery feature calls this.runFiber() which was introduced in agents 0.10.0. Without this change, npm/pnpm will happily resolve agents 0.9.x alongside ai-chat 0.4.0, and enabling the recovery feature will crash at runtime. Similarly, _handleInternalFiberRecovery is an override of a method that only exists in agents 0.10.0. The same consideration applies to packages/think/package.json (line 31), which re-exports FiberContext/FiberRecoveryContext types from agents — while those are type-only and won't crash at runtime, the changelog declares Think 0.2.0 was released as part of the unified fiber architecture, so the peer dep minimum should also be bumped for correctness.
Was this helpful? React with 👍 or 👎 to provide feedback.
08389e4 to
c865657
Compare
| ], | ||
| "type": "module", | ||
| "version": "0.1.2", | ||
| "version": "0.2.0", |
There was a problem hiding this comment.
🔴 @cloudflare/think peer dep allows agents versions missing required exports
@cloudflare/think@0.2.0 imports FiberContext and FiberRecoveryContext types from agents (packages/think/src/think.ts:89) and Session from agents/experimental/memory/session (packages/think/src/think.ts:111), all of which were added in agents@0.10.0. It also inherits runFiber() from the Agent base class (new in 0.10.0). However, the peer dependency is still "agents": ">=0.8.7 <1.0.0" (packages/think/package.json:31). A user installing @cloudflare/think@0.2.0 with any agents version from 0.8.7 to 0.9.x will get runtime import failures because those exports don't exist. The lower bound should be >=0.10.0.
Prompt for agents
The @cloudflare/think package at version 0.2.0 now depends on features from agents 0.10.0 (FiberContext, FiberRecoveryContext types, runFiber method, Session from agents/experimental/memory/session). The peer dependency in packages/think/package.json line 31 should be updated from ">=0.8.7 <1.0.0" to ">=0.10.0 <1.0.0" to prevent users from installing incompatible combinations.
Was this helpful? React with 👍 or 👎 to provide feedback.
c865657 to
0d98f8e
Compare
0d98f8e to
309f473
Compare
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.
Releases
agents@0.10.0
Minor Changes
#1256
dfab937Thanks @threepointone! - Add durable fiber execution to the Agent base class.runFiber(name, fn)registers work in SQLite, holds akeepAliveref, and enables recovery viaonFiberRecoveredafter DO eviction.ctx.stash()andthis.stash()checkpoint progress that survives eviction.AIChatAgentgainsunstable_chatRecovery— when enabled, each chat turn is wrapped in a fiber.onChatRecoveryprovides provider-specific recovery (Workers AI continuation, OpenAI response retrieval, Anthropic synthetic message).continueLastTurn()appends to the interrupted assistant message seamlessly.Thinknow extendsAgentdirectly (no mixin). Fiber support is inherited from the base class.Breaking (experimental APIs only):
withFibersmixin (agents/experimental/forever)withDurableChatmixin (@cloudflare/ai-chat/experimental/forever)./experimental/foreverexport from both packagesfibersflag — recovery is automatic via alarm housekeepingPatch Changes
#1259
1933eb4Thanks @threepointone! - Run fiber recovery eagerly inonStart()instead of deferring to the next alarm. Interrupted fibers are now detected immediately on the first request after DO wake, with the alarm path as a fallback. A re-entrancy guard prevents double recovery.#1263
e3ceb82Thanks @threepointone! - FixrouteAgentEmail()keeping the target DO non-hibernatable for ~100-120s afteronEmail()returns. Replaces bare closure RPC targets with a singleRpcTargetbridge (EmailBridge) that has explicitSymbol.disposelifecycle, allowing the runtime to tear down the bidirectional RPC session promptly instead of tying it to the caller's execution context lifetime.c5ca556Thanks @threepointone! - Capvitepeer dependency at>=6.0.0 <9.0.0to avoid silently accepting untested future major versions.#1271
0cc2daeThanks @threepointone! - Add optionalMCPServerFilterparameter togetAITools(),listTools(),listPrompts(),listResources(), andlistResourceTemplates()for scoping results to specific MCP servers by ID, name, or connection state.#1267
d1ee61aThanks @dmmulroy! - Fix MCP streamable HTTP client session lifecycle so closing connections explicitly terminates active sessions and persists session IDs across reconnects/restores.#1270
87b4512Thanks @threepointone! - Wire Session into Think as the storage layer, achieving full feature parity with AIChatAgent plus Session-backed advantages.Think (
@cloudflare/think):this.messagesbacked bysession.getHistory(), tree-structured messages, context blocks, compaction, FTS5 searchconfigureSession()override for context blocks, compaction, search, skills (sync or async)assembleContext()returns{ system, messages }with context block compositiononChatResponse()lifecycle hook fires from all turn pathstrigger: "regenerate-message"with Session branchingsaveMessages()for programmatic turn entry (scheduled responses, webhooks, proactive agents)continueLastTurn()for extending the last assistant responsesanitizeMessageForPersistence()hook for PII redactionmessageConcurrencystrategies (queue/latest/merge/drop/debounce)resetTurnState()extracted as protected methodunstable_chatRecoverywithrunFiberwrapping on all 4 turn pathsonChatRecovery()hook withChatRecoveryContexthasPendingInteraction()/waitUntilStable()for quiescence detectionSessionfrom@cloudflare/thinkonStart— subclasses never needsuper.onStart()agents (
agents/chat):AbortRegistry,applyToolUpdate+ builders,parseProtocolMessageinto sharedagents/chatlayerapplyChunkToPartsexport for fiber recoveryAIChatAgent (
@cloudflare/ai-chat):AbortRegistryfromagents/chatcontinuationflag toOnChatMessageOptionsgetAgentMessages()and tool part helpersgetHttpUrl()touseAgentreturn value@cloudflare/ai-chat@0.4.0
Minor Changes
#1264
95b4d6aThanks @threepointone! - RenamedurableStreamingtounstable_chatRecovery. Fix abort controller leak whenonChatMessagethrows. Wrap all 4 chat turn paths (WS, auto-continuation, programmatic, continueLastTurn) inrunFiberwhen enabled. Guard_chatRecoveryContinueagainst stale continuations viatargetAssistantIdin schedule payload.#1256
dfab937Thanks @threepointone! - Add durable fiber execution to the Agent base class.runFiber(name, fn)registers work in SQLite, holds akeepAliveref, and enables recovery viaonFiberRecoveredafter DO eviction.ctx.stash()andthis.stash()checkpoint progress that survives eviction.AIChatAgentgainsunstable_chatRecovery— when enabled, each chat turn is wrapped in a fiber.onChatRecoveryprovides provider-specific recovery (Workers AI continuation, OpenAI response retrieval, Anthropic synthetic message).continueLastTurn()appends to the interrupted assistant message seamlessly.Thinknow extendsAgentdirectly (no mixin). Fiber support is inherited from the base class.Breaking (experimental APIs only):
withFibersmixin (agents/experimental/forever)withDurableChatmixin (@cloudflare/ai-chat/experimental/forever)./experimental/foreverexport from both packagesfibersflag — recovery is automatic via alarm housekeepingPatch Changes
#1270
87b4512Thanks @threepointone! - Wire Session into Think as the storage layer, achieving full feature parity with AIChatAgent plus Session-backed advantages.Think (
@cloudflare/think):this.messagesbacked bysession.getHistory(), tree-structured messages, context blocks, compaction, FTS5 searchconfigureSession()override for context blocks, compaction, search, skills (sync or async)assembleContext()returns{ system, messages }with context block compositiononChatResponse()lifecycle hook fires from all turn pathstrigger: "regenerate-message"with Session branchingsaveMessages()for programmatic turn entry (scheduled responses, webhooks, proactive agents)continueLastTurn()for extending the last assistant responsesanitizeMessageForPersistence()hook for PII redactionmessageConcurrencystrategies (queue/latest/merge/drop/debounce)resetTurnState()extracted as protected methodunstable_chatRecoverywithrunFiberwrapping on all 4 turn pathsonChatRecovery()hook withChatRecoveryContexthasPendingInteraction()/waitUntilStable()for quiescence detectionSessionfrom@cloudflare/thinkonStart— subclasses never needsuper.onStart()agents (
agents/chat):AbortRegistry,applyToolUpdate+ builders,parseProtocolMessageinto sharedagents/chatlayerapplyChunkToPartsexport for fiber recoveryAIChatAgent (
@cloudflare/ai-chat):AbortRegistryfromagents/chatcontinuationflag toOnChatMessageOptionsgetAgentMessages()and tool part helpersgetHttpUrl()touseAgentreturn value@cloudflare/think@0.2.0
Minor Changes
#1270
87b4512Thanks @threepointone! - Wire Session into Think as the storage layer, achieving full feature parity with AIChatAgent plus Session-backed advantages.Think (
@cloudflare/think):this.messagesbacked bysession.getHistory(), tree-structured messages, context blocks, compaction, FTS5 searchconfigureSession()override for context blocks, compaction, search, skills (sync or async)assembleContext()returns{ system, messages }with context block compositiononChatResponse()lifecycle hook fires from all turn pathstrigger: "regenerate-message"with Session branchingsaveMessages()for programmatic turn entry (scheduled responses, webhooks, proactive agents)continueLastTurn()for extending the last assistant responsesanitizeMessageForPersistence()hook for PII redactionmessageConcurrencystrategies (queue/latest/merge/drop/debounce)resetTurnState()extracted as protected methodunstable_chatRecoverywithrunFiberwrapping on all 4 turn pathsonChatRecovery()hook withChatRecoveryContexthasPendingInteraction()/waitUntilStable()for quiescence detectionSessionfrom@cloudflare/thinkonStart— subclasses never needsuper.onStart()agents (
agents/chat):AbortRegistry,applyToolUpdate+ builders,parseProtocolMessageinto sharedagents/chatlayerapplyChunkToPartsexport for fiber recoveryAIChatAgent (
@cloudflare/ai-chat):AbortRegistryfromagents/chatcontinuationflag toOnChatMessageOptionsgetAgentMessages()and tool part helpersgetHttpUrl()touseAgentreturn value#1256
dfab937Thanks @threepointone! - Add durable fiber execution to the Agent base class.runFiber(name, fn)registers work in SQLite, holds akeepAliveref, and enables recovery viaonFiberRecoveredafter DO eviction.ctx.stash()andthis.stash()checkpoint progress that survives eviction.AIChatAgentgainsunstable_chatRecovery— when enabled, each chat turn is wrapped in a fiber.onChatRecoveryprovides provider-specific recovery (Workers AI continuation, OpenAI response retrieval, Anthropic synthetic message).continueLastTurn()appends to the interrupted assistant message seamlessly.Thinknow extendsAgentdirectly (no mixin). Fiber support is inherited from the base class.Breaking (experimental APIs only):
withFibersmixin (agents/experimental/forever)withDurableChatmixin (@cloudflare/ai-chat/experimental/forever)./experimental/foreverexport from both packagesfibersflag — recovery is automatic via alarm housekeeping@cloudflare/codemode@0.3.4
Patch Changes
#1266
d5dbf45Thanks @threepointone! - Add optionaldescriptiontocodeMcpServer, matching the existing option oncreateCodeTool. Supports{{types}}and{{example}}placeholders; falls back to the built-in default when omitted.c5ca556Thanks @threepointone! - Fix@tanstack/aipeer dependency range from^0.8.0to>=0.8.0 <1.0.0. The caret range for pre-1.0 packages only allows>=0.8.0 <0.9.0, which excluded the current 0.10.0 release.hono-agents@3.0.8
Patch Changes
c5ca556Thanks @threepointone! - Bumpagentspeer dependency lower bound from>=0.3.10to>=0.9.0to reflect actual compatibility.@cloudflare/shell@0.3.2
Patch Changes
#1249
bfbed21Thanks @threepointone! - Fixgit.clone()withoutdepthfailing withENOENT: .git/shallow. The git fs adapter'sunlinknow wraps errors with.codeso isomorphic-git can handle missing files gracefully.Updated dependencies [
d5dbf45,c5ca556]:@cloudflare/voice@0.0.5
Patch Changes
c5ca556Thanks @threepointone! - Replace wildcard*peer dependencies with real version ranges:agentsto>=0.9.0 <1.0.0andpartysocketto^1.0.0.